From: "André Draszik" <andre.draszik@linaro.org>
To: Tudor Ambarus <tudor.ambarus@linaro.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Alim Akhtar <alim.akhtar@samsung.com>,
Peter Griffin <peter.griffin@linaro.org>,
Srinivas Kandagatla <srini@kernel.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
semen.protsenko@linaro.org, willmcvicker@google.com,
kernel-team@android.com, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 5/6] soc: samsung: exynos-chipid: add google,gs101-otp support
Date: Mon, 22 Dec 2025 14:39:20 +0000 [thread overview]
Message-ID: <a7af16e25ad6403e867a32d9d0f26931ac40199d.camel@linaro.org> (raw)
In-Reply-To: <e9a39590-39ce-43ae-8f44-1edd137d4ade@linaro.org>
Hi Tudor,
On Mon, 2025-12-22 at 16:12 +0200, Tudor Ambarus wrote:
> Hi!
>
> On 12/19/25 5:10 PM, André Draszik wrote:
>
> cut
>
> > > static const char *exynos_product_id_to_name(unsigned int product_id)
> > > @@ -93,19 +99,53 @@ static int exynos_chipid_get_chipid_info(struct device *dev,
> > > return dev_err_probe(dev, ret, "failed to read Product ID\n");
> > > soc_info->product_id = val & EXYNOS_MASK;
> > >
> > > - if (data->rev_reg != EXYNOS_CHIPID_REG_PRO_ID) {
> > > - ret = regmap_read(regmap, data->rev_reg, &val);
> > > + if (data->sub_rev_reg == EXYNOS_CHIPID_REG_PRO_ID) {
> > > + /* exynos4210 case */
> > > + main_rev = (val >> data->main_rev_shift) & EXYNOS_REV_PART_MASK;
> > > + sub_rev = (val >> data->sub_rev_shift) & EXYNOS_REV_PART_MASK;
> > > + } else {
> > > + unsigned int val2;
> > > +
> > > + ret = regmap_read(regmap, data->sub_rev_reg, &val2);
> > > if (ret < 0)
> > > return dev_err_probe(dev, ret,
> > > "failed to read revision\n");
> > > +
> > > + if (data->main_rev_reg == EXYNOS_CHIPID_REG_PRO_ID)
> > > + /* gs101 case */
> > > + main_rev = (val >> data->main_rev_shift) & EXYNOS_REV_PART_MASK;
> > > + else
> > > + /* exynos850 case */
> > > + main_rev = (val2 >> data->main_rev_shift) & EXYNOS_REV_PART_MASK;
> > > +
> > > + sub_rev = (val2 >> data->sub_rev_shift) & EXYNOS_REV_PART_MASK;
> >
> > The above looks a little fragile, comparing register offsets between different
> > hardware platforms and macros, but I guess it works for now and isn't really
> > much different to before.
>
> Right, I thought we'll get this in faster if I keep the old style.
>
> I can introduce a drv_data->get_chipid_info() method and add methods for exynos4210
> and exynos850 before adding the g101 support. It duplicated a bit the code when I
> tried it, and I chose to keep it as it is now. Happy to switch to a drv data method
> if you prefer, just say.
The above was simply an observation, and as mentioned it's not really worse than
before, therefore OK to leave from my pov.
Cheers,
A.
next prev parent reply other threads:[~2025-12-22 14:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-20 11:29 [PATCH v3 0/6] soc: samsung: exynos-chipid: add gs101 support Tudor Ambarus
2025-11-20 11:29 ` [PATCH v3 1/6] soc: samsung: exynos-chipid: use devm action to unregister soc device Tudor Ambarus
2025-12-19 14:53 ` André Draszik
2025-11-20 11:29 ` [PATCH v3 2/6] soc: samsung: exynos-chipid: use dev_err_probe where appropiate Tudor Ambarus
2025-12-19 14:57 ` André Draszik
2025-11-20 11:29 ` [PATCH v3 3/6] soc: samsung: exynos-chipid: rename method Tudor Ambarus
2025-11-20 11:29 ` [PATCH v3 4/6] soc: samsung: exynos-chipid: downgrade dev_info to dev_dbg for soc info Tudor Ambarus
2025-12-19 14:58 ` André Draszik
2025-11-20 11:29 ` [PATCH v3 5/6] soc: samsung: exynos-chipid: add google,gs101-otp support Tudor Ambarus
2025-12-19 15:10 ` André Draszik
2025-12-22 14:12 ` Tudor Ambarus
2025-12-22 14:39 ` André Draszik [this message]
2025-11-20 11:29 ` [PATCH v3 6/6] arm64: dts: exynos: gs101: add OTP node Tudor Ambarus
2025-12-21 13:50 ` [PATCH v3 0/6] soc: samsung: exynos-chipid: add gs101 support Krzysztof Kozlowski
2025-12-21 13:52 ` (subset) " 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=a7af16e25ad6403e867a32d9d0f26931ac40199d.camel@linaro.org \
--to=andre.draszik@linaro.org \
--cc=alim.akhtar@samsung.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kernel-team@android.com \
--cc=krzk+dt@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=peter.griffin@linaro.org \
--cc=robh@kernel.org \
--cc=semen.protsenko@linaro.org \
--cc=srini@kernel.org \
--cc=tudor.ambarus@linaro.org \
--cc=willmcvicker@google.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
all inboxes | Powered by JetHome®