[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a07n=5X5Cv7crAu_XCzoLA=o1wZjmO5r6=bwdGr2nHSwQ@mail.gmail.com>
Date: Thu, 16 Apr 2020 16:38:24 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Baolin Wang <baolin.wang7@...il.com>
Cc: Lee Jones <lee.jones@...aro.org>, Mark Brown <broonie@...nel.org>,
Orson Zhai <orsonzhai@...il.com>,
Lyra Zhang <zhang.lyra@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v2 3/3] soc: sprd: Add Spreadtrum special bits
updating support
On Thu, Apr 16, 2020 at 3:49 PM Baolin Wang <baolin.wang7@...il.com> wrote:
>
> OK, I think adding a Spreadtrum compatible string will be an easy and
> clear way, so what about below sample code?
>
> DT:
> ap_ahb_regs: syscon@...10000 {
> compatible = "sprd,sc9860-syscon", "syscon";
> reg = <0 0x20210000 0 0x10000>;
> };
>
> /* The Spreadtrum syscon need register a real physical regmap bus with
> new bits updating method. */
> if (of_device_is_compatible(np, "sprd,sc9860-syscon") && syscon_phy_regmap_bus)
> regmap = regmap_init(NULL, syscon_phy_regmap_bus, base, &syscon_config);
> else
> regmap = regmap_init_mmio(NULL, base, &syscon_config);
Ok, sounds good. Maybe also define another compatible string that
is more generic than "sprd,sc9860-syscon" (but less generic than
"syscon") so you can still identify the chip specific syscon area if
necessary, while not having to list each future chip individually.
Something like
compatible = "sprd,sc9860-syscon", "sprd,atomic-syscon", "syscon";
Also I'd add an IS_ENABLED() check so it gets the 'else' path
at compile-time when CONFIG_ARCH_SPRD is disabled.
Arnd
Powered by blists - more mailing lists