Re: [PATCH mfd v2 1/2] mfd: rsmu: support I2C SMBus access

From: Lee Jones
Date: Fri May 03 2024 - 05:32:38 EST


On Wed, 01 May 2024, Min Li wrote:

> From: Min Li <min.li.xe@xxxxxxxxxxx>
>
> 8a3400x device implements its own reg_read and reg_write,
> which only supports I2C bus access. This patch adds support
> for SMBus access.
>
> Signed-off-by: Min Li <min.li.xe@xxxxxxxxxxx>
> ---
> - Provide cover-letter suggested by Lee
>
> drivers/mfd/rsmu_i2c.c | 107 +++++++++++++++++++++++++++++++++++------
> drivers/mfd/rsmu_spi.c | 8 +--
> 2 files changed, 97 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/mfd/rsmu_i2c.c b/drivers/mfd/rsmu_i2c.c
> index 5711e512b..cba64f107 100644
> --- a/drivers/mfd/rsmu_i2c.c
> +++ b/drivers/mfd/rsmu_i2c.c
> @@ -32,6 +32,8 @@
> #define RSMU_SABRE_PAGE_ADDR 0x7F
> #define RSMU_SABRE_PAGE_WINDOW 128
>
> +typedef int (*rsmu_rw_device)(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u8 bytes);

We're not going to start passing around function points all over the
place. Use a variable 'bool smbus'(?) instead and call the correct
helper based on that instead.

--
Lee Jones [李琼斯]