Re: [RFC PATCH v4 2/5] mfd: add driver for Marvell 88PM886 PMIC

From: Karel Balej
Date: Thu Mar 21 2024 - 13:06:25 EST


Lee Jones, 2024-03-21T16:20:45+00:00:
> On Thu, 21 Mar 2024, Karel Balej wrote:
>
> > Lee Jones, 2024-03-21T15:42:11+00:00:
> > > On Mon, 11 Mar 2024, Karel Balej wrote:
> > > > diff --git a/include/linux/mfd/88pm886.h b/include/linux/mfd/88pm886.h
> > > > new file mode 100644
> > > > index 000000000000..a5e6524bb19d
> > > > --- /dev/null
> > > > +++ b/include/linux/mfd/88pm886.h
> > > > @@ -0,0 +1,38 @@
> > > > +/* SPDX-License-Identifier: GPL-2.0-only */
> > > > +#ifndef __MFD_88PM886_H
> > > > +#define __MFD_88PM886_H
> > > > +
> > > > +#include <linux/i2c.h>
> > > > +#include <linux/regmap.h>
> > > > +
> > > > +#define PM886_A1_CHIP_ID 0xa1
> > > > +
> > > > +#define PM886_REGMAP_CONF_MAX_REG 0xfe
> > > > +
> > > > +#define PM886_REG_ID 0x00
> > > > +
> > > > +#define PM886_REG_STATUS1 0x01
> > > > +#define PM886_ONKEY_STS1 BIT(0)
> > > > +
> > > > +#define PM886_REG_MISC_CONFIG1 0x14
> > > > +#define PM886_SW_PDOWN BIT(5)
> > > > +
> > > > +#define PM886_REG_MISC_CONFIG2 0x15
> > > > +#define PM886_INT_INV BIT(0)
> > > > +#define PM886_INT_CLEAR BIT(1)
> > > > +#define PM886_INT_RC 0x00
> > > > +#define PM886_INT_WC BIT(1)
> > > > +#define PM886_INT_MASK_MODE BIT(2)
> > > > +
> > > > +struct pm886_chip {
> > > > + struct i2c_client *client;
> > > > + unsigned int chip_id;
> > > > + struct regmap *regmap;
> > > > +};
> > > > +
> > > > +static const struct regmap_config pm886_i2c_regmap = {
> > > > + .reg_bits = 8,
> > > > + .val_bits = 8,
> > > > + .max_register = PM886_REGMAP_CONF_MAX_REG,
> > > > +};
> > >
> > > Why is this in here?
> >
> > Because since I moved the regulators regmap initialization into the
> > regulators driver, I need to access it from there.
>
> So move it into the regulators driver?

It is used in the MFD driver too for the base regmap.

K. B.