Re: [PATCH 2/6] mfd: adp5585: add ADI adp5585 core support

From: Linus Walleij
Date: Mon Aug 05 2024 - 03:49:10 EST


Hi Frank,

thanks for your patch!

On Tue, Jul 16, 2024 at 9:29 PM Frank Li <Frank.Li@xxxxxxx> wrote:

> +struct adp5585_dev {
> + struct device *dev;
> + struct i2c_client *i2c_client;
> +
> + int (*read_reg)(struct adp5585_dev *adp5585, u8 reg, u8 *val);
> + int (*write_reg)(struct adp5585_dev *adp5585, u8 reg, u8 val);
> +};

The read_reg() and write_reg() accessors looks like a reimplementation
of regmap.

Can you check if you can just let the subdrivers access a regmap
for the parent MFD device and use that to read/write registers?

There are many examples of this in recent MFD drivers.

Yours,
Linus Walleij