From: Krzysztof Kozlowski <krzk@kernel.org>
To: Vladimir Zapolskiy <vz@mleia.com>, Arnd Bergmann <arnd@arndb.de>
Cc: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] soc: nxp: Add a simple NXP LPC32xx socinfo driver
Date: Fri, 2 Jan 2026 13:54:38 +0100 [thread overview]
Message-ID: <1eef3c49-83a7-48d4-96ad-ffb71df2be7a@kernel.org> (raw)
In-Reply-To: <eb9ef21a-c0b4-4c8d-b1b1-6c76f45c53aa@mleia.com>
On 02/01/2026 13:36, Vladimir Zapolskiy wrote:
> On 1/2/26 11:58, Krzysztof Kozlowski wrote:
>> On 02/01/2026 00:56, Vladimir Zapolskiy wrote:
>>> Add NXP LPC32xx specific driver to get unique SoC ID from System Control
>>> Block registers and export it to userspace.
>>>
>>> Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
>>> ---
>>> drivers/soc/Kconfig | 1 +
>>> drivers/soc/Makefile | 1 +
>>> drivers/soc/nxp/Kconfig | 16 +++++
>>> drivers/soc/nxp/Makefile | 2 +
>>> drivers/soc/nxp/lpc32xx-soc.c | 114 ++++++++++++++++++++++++++++++++++
>>> 5 files changed, 134 insertions(+)
>>> create mode 100644 drivers/soc/nxp/Kconfig
>>> create mode 100644 drivers/soc/nxp/Makefile
>>> create mode 100644 drivers/soc/nxp/lpc32xx-soc.c
>>>
>>> diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig
>>> index a2d65adffb80..c21b0d2f58fc 100644
>>> --- a/drivers/soc/Kconfig
>>> +++ b/drivers/soc/Kconfig
>>> @@ -18,6 +18,7 @@ source "drivers/soc/loongson/Kconfig"
>>> source "drivers/soc/mediatek/Kconfig"
>>> source "drivers/soc/microchip/Kconfig"
>>> source "drivers/soc/nuvoton/Kconfig"
>>> +source "drivers/soc/nxp/Kconfig"
>>> source "drivers/soc/pxa/Kconfig"
>>> source "drivers/soc/qcom/Kconfig"
>>> source "drivers/soc/renesas/Kconfig"
>>> diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile
>>> index 47a3925ff84c..a04c21a8a5a4 100644
>>> --- a/drivers/soc/Makefile
>>> +++ b/drivers/soc/Makefile
>>> @@ -24,6 +24,7 @@ obj-y += loongson/
>>> obj-y += mediatek/
>>> obj-y += microchip/
>>> obj-y += nuvoton/
>>> +obj-y += nxp/
>>> obj-y += pxa/
>>> obj-y += qcom/
>>> obj-y += renesas/
>>
>> Missing maintainers entry.
>>
>>
>>> +
>>> +static int lpc32xx_soc_probe(struct platform_device *pdev)
>>> +{
>>> + struct soc_device_attribute *soc_dev_attr;
>>> + struct device *dev = &pdev->dev;
>>> + struct soc_device *soc_dev;
>>> + struct regmap *scb;
>>> + u32 serial_id[4];
>>> + int ret;
>>> +
>>> + soc_dev_attr = devm_kzalloc(dev, sizeof(*soc_dev_attr), GFP_KERNEL);
>>> + if (!soc_dev_attr)
>>> + return -ENOMEM;
>>> +
>>> + soc_dev_attr->family = "NXP LPC32xx";
>>> +
>>> + ret = of_property_read_string(of_root, "model", &soc_dev_attr->machine);
>>> + if (ret)
>>> + return ret;
>>> +
>>> + scb = syscon_regmap_lookup_by_compatible("nxp,lpc3220-scb");
>>
>> This is undocumented ABI.
>
> What is the expected level of documentation for syscon?
git grep nxp,lpc3220-scb
gives me 0 results.
Documentation is supposed to be in this patchset. If it is not, you have
changelog part to explain dependencies and unusual things.
>
>> Anyway, you should look up devices via phandles.
>>
>
> I may miss the context, was syscon_regmap_lookup_by_compatible() deprecated?
Not deprecated. It has its own purpose, so you can explain why here you
cannot have phandle.
Without phandle you do not have proper device probe ordering and you do
not properly express the dependency between hardware modules. Maybe this
is not even real hardware, which you attach your driver to, so that's
another thing to consider. Anyway, commit msg should explain all these.
>
> Most of drivers/soc uses syscon_regmap_lookup_by_compatible() variant over
> syscon_regmap_lookup_by_phandle(), and overall
They have their own reason.
>
> % git grep syscon_regmap_lookup_by_compatible v6.19-rc1 | wc -l
> 105
>
Best regards,
Krzysztof
next prev parent reply other threads:[~2026-01-02 12:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-01 23:56 [PATCH 0/2] soc: nxp: Add a simple NXP LPC32xx socinfo driver Vladimir Zapolskiy
2026-01-01 23:56 ` [PATCH 1/2] soc: Sort the list of subfolders alphabetically Vladimir Zapolskiy
2026-01-01 23:56 ` [PATCH 2/2] soc: nxp: Add a simple NXP LPC32xx socinfo driver Vladimir Zapolskiy
2026-01-02 9:34 ` Arnd Bergmann
2026-01-02 9:58 ` Krzysztof Kozlowski
2026-01-02 12:36 ` Vladimir Zapolskiy
2026-01-02 12:54 ` Krzysztof Kozlowski [this message]
2026-01-02 13:21 ` Vladimir Zapolskiy
2026-01-03 12:43 ` Krzysztof Kozlowski
2026-01-03 22:14 ` Vladimir Zapolskiy
2026-01-05 7:18 ` Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1eef3c49-83a7-48d4-96ad-ffb71df2be7a@kernel.org \
--to=krzk@kernel.org \
--cc=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=piotr.wojtaszczyk@timesys.com \
--cc=vz@mleia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox