lkml.org 
[lkml]   [2014]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/3] mfd: MAX6650/6651 support
From
On Tue, Jan 7, 2014 at 2:11 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Dec 23, 2013 at 5:08 PM, Laszlo Papp <lpapp@kde.org> 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>
> (...)
>> +++ b/include/linux/mfd/max6651-private.h
>> +struct max6651_dev {
>> + struct device *dev;
>> + struct mutex iolock;
>> +
>> + struct i2c_client *i2c;
>> +
>> + int type;
>> +};
>> +
>> +enum max6651_types {
>> + TYPE_MAX6650,
>> + TYPE_MAX6651,
>> +};
>> +
>> +extern int max6651_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest);
>> +extern int max6651_write_reg(struct i2c_client *i2c, u8 reg, u8 value);
>
> It looks like you're reinventing regmap.
>
> - In the Kconfig entry for the MFD device:
> select REGMAP_I2C
>
> - Look in drivers/mfd/stw481x.c for an example using
> <linux/regmap.h>
>
> - Look into
> drivers/regulator/stw481x-vmmc.c
> for an example regmap MFD spawned child cell.

Oh, thanks, Linus!

I will have a look.


\
 
 \ /
  Last update: 2014-01-08 17:41    [W:0.187 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site