[PATCH 05/11] soc: samsung: exynos-chipid: introduce match_data->get_chipid_info()
Krzysztof Kozlowski
krzk at kernel.org
Mon Nov 3 02:15:50 PST 2025
On Fri, Oct 31, 2025 at 12:56:04PM +0000, Tudor Ambarus wrote:
> Newer SoCs, like GS101, don't have a dedicated Chip ID controller.
This would suggest that these are completely different devices and
should not be part of the same bindings. Actually bindings also
suggested this - changing programming model.
> The GS101 Chip ID info is available as part of the OTP controller
> registers, among other things. For GS101 we will read the Chip ID from
> the OTP controller using the nvmem API.
>
> Extend the match_data with a get_chipid_info() method, to allow nvmem
> integration.
>
> `struct exynos_chipid_info` is moved to the top of the file to avoid a
> forward declaration. The structure is extended with pointers to device
> and regmap to allow current implementation to obtain the regmap in the
> newly introduced exynos_chipid_get_regmap_chipid_info() method. The
> nvmem consumer support that will follow won't use the regmap, and
> instead will use the nvmem API. It will need the pointer to the device
> to report errors.
>
> Signed-off-by: Tudor Ambarus <tudor.ambarus at linaro.org>
> ---
> drivers/soc/samsung/exynos-chipid.c | 35 ++++++++++++++++++++++-------------
> 1 file changed, 22 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/soc/samsung/exynos-chipid.c b/drivers/soc/samsung/exynos-chipid.c
> index ab6bdf24a754a0faf974190c1fa1f99735cbef8e..7b1951f28e8d4958ab941af91dab4b0183ceda5f 100644
> --- a/drivers/soc/samsung/exynos-chipid.c
> +++ b/drivers/soc/samsung/exynos-chipid.c
> @@ -26,17 +26,21 @@
>
> #include "exynos-asv.h"
>
> +struct exynos_chipid_info {
> + struct regmap *regmap;
> + struct device *dev;
> + u32 product_id;
> + u32 revision;
> +};
> +
> struct exynos_chipid_variant {
> + int (*get_chipid_info)(const struct exynos_chipid_variant *data,
> + struct exynos_chipid_info *exynos_chipid);
> unsigned int rev_reg; /* revision register offset */
> unsigned int main_rev_shift; /* main revision offset in rev_reg */
> unsigned int sub_rev_shift; /* sub revision offset in rev_reg */
> };
>
> -struct exynos_chipid_info {
> - u32 product_id;
> - u32 revision;
> -};
> -
> static const struct exynos_soc_id {
> const char *name;
> unsigned int id;
> @@ -80,13 +84,19 @@ static const char *product_id_to_soc_id(unsigned int product_id)
> return NULL;
> }
>
> -static int exynos_chipid_get_chipid_info(struct regmap *regmap,
> - const struct exynos_chipid_variant *data,
> +static int exynos_chipid_get_regmap_chipid_info(const struct exynos_chipid_variant *data,
> struct exynos_chipid_info *exynos_chipid)
> {
This function now gets both regmap and chip info, that's too much.
Probably all ASV and regmap getting should be somehow split/customized
per variant.
I don't know yet, need to read rest of patches.
Best regards,
Krzysztof
More information about the linux-arm-kernel
mailing list