[PATCH 2/4] nvmem: add mt6323 PMIC EFUSE driver

Andy Shevchenko andy.shevchenko at gmail.com
Thu Jun 11 09:13:38 PDT 2026


On Thu, Jun 11, 2026 at 1:21 PM Roman Vivchar via B4 Relay
<devnull+rva333.protonmail.com at kernel.org> wrote:
>
> Add support for the EFUSE controller found in the Mediatek MT6323 PMIC.
> The MT6323 EFUSE stores 24 bytes of hardware-related data, such as
> thermal sensor calibration values.

Reviewed-by: Andy Shevchenko <andy at kernel.org>

...

> +static int mt6323_efuse_read(void *context, unsigned int offset, void *val,
> +                            size_t bytes)
> +{
> +       struct regmap *map = context;
> +       u32 tmp;
> +       u16 *buf = val;
> +       int ret;

Perhaps reversed xmas tree order? And it's actually better to see
assignments first.

> +       /*
> +        * A manual loop using regmap_read is required because PWRAP is not
> +        * a continuous MMIO space, but rather a FSM that doesn't implement the
> +        * necessary read callback for the regmap_read_raw and regmap_read_bulk
> +        * functions.
> +        */
> +       for (size_t i = 0; i < bytes; i += sizeof(*buf)) {
> +               ret = regmap_read(map, MT6323_EFUSE_DOUT_BASE + offset + i, &tmp);
> +               if (ret)
> +                       return ret;
> +
> +               *buf++ = tmp;
> +       }
> +
> +       return 0;
> +}

-- 
With Best Regards,
Andy Shevchenko



More information about the linux-arm-kernel mailing list