Re: [PATCH 1/2] mfd: syscon: Support physical regmap bus

From: Arnd Bergmann
Date: Fri Apr 24 2020 - 04:24:30 EST


On Fri, Apr 24, 2020 at 10:11 AM Lee Jones <lee.jones@xxxxxxxxxx> wrote:
> On Fri, 17 Apr 2020, Baolin Wang wrote:
> > @@ -106,14 +107,25 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_clk)
> > syscon_config.val_bits = reg_io_width * 8;
> > syscon_config.max_register = resource_size(&res) - reg_io_width;
> >
> > - regmap = regmap_init_mmio(NULL, base, &syscon_config);
> > + /*
> > + * The Spreadtrum syscon need register a real physical regmap bus
> > + * with new atomic bits updating operation instead of using
> > + * read-modify-write.
> > + */
> > + if (IS_ENABLED(CONFIG_ARCH_SPRD) &&
> > + of_device_is_compatible(np, "sprd,atomic-syscon") &&
>
> Please find a more generic way of supporting your use-case. This is a
> generic driver, and as such I am vehemently against adding any sort of
> vendor specific code in here.

I suggested doing it this way, as all alternatives seemed worse than this.

Arnd