Messages in this thread Patch in this message | | | Subject | Re: [PATCH v2] mfd: MAX6650/6651 support | From | Krzysztof Kozlowski <> | Date | Mon, 10 Feb 2014 08:37:42 +0100 |
| |
Hi,
On Sat, 2014-02-08 at 11:33 +0000, Laszlo Papp wrote: > MAX6650/MAX6651 chip is a multi-function device with I2C busses. The > chip includes fan-speed regulators and monitors, GPIO, and alarm. > > This patch is an initial release of a MAX6650/6651 MFD driver that > supports to enable the chip with its primary I2C bus that will connect > the hwmon, and then the gpio devices for now. > > Signed-off-by: Laszlo Papp <lpapp@kde.org> > --- > drivers/mfd/Kconfig | 11 +++++ > drivers/mfd/Makefile | 1 + > drivers/mfd/max665x.c | 88 +++++++++++++++++++++++++++++++++++++ > include/linux/mfd/max665x-private.h | 42 ++++++++++++++++++ > 4 files changed, 142 insertions(+) > create mode 100644 drivers/mfd/max665x.c > create mode 100644 include/linux/mfd/max665x-private.h > > diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig > index 49bb445..e25be62 100644 > --- a/drivers/mfd/Kconfig > +++ b/drivers/mfd/Kconfig > @@ -368,6 +368,17 @@ config MFD_MAX8907 > accessing the device; additional drivers must be enabled in order > to use the functionality of the device. > > +config MFD_MAX665X > + bool "Maxim Semiconductor MAX6650/MAX6651 Support" > + select MFD_CORE > + depends on I2C > + select REGMAP_I2C > + help > + Say yes here to support for Maxim Semiconductor MAX6650/MAX6651. This is > + a fan speed regulator and monitor IC. This driver provies common support
s/provies/provides/
(...)
> +const struct regmap_config max665x_regmap_config = { > + .reg_bits = 5, > +}; > + > +static int max665x_probe(struct i2c_client *i2c, > + const struct i2c_device_id *id) > +{ > + struct max665x_dev *max665x; > + int ret; > + > + max665x = devm_kzalloc(&i2c->dev, sizeof(*max665x), GFP_KERNEL); > + if (!max665x) > + return -ENOMEM; > + > + i2c_set_clientdata(i2c, max665x); > + max665x->dev = &i2c->dev; > + max665x->i2c = i2c; > + max665x->map = regmap_init_i2c(i2c, &max665x_regmap_config);
Use devm_regmap_init_i2c() (or add missing regmap_exit()).
Best regards, Krzysztof
| |