From 676e02d7a2ed9bb02994670a07df533a29a99de6 Mon Sep 17 00:00:00 2001 From: Joonyoung Shim Date: Fri, 6 Aug 2010 11:28:06 +0900 Subject: mfd: Use i2c_client as an argument on MAX8998 i2c routines The MAX8998 chip have regulator and rtc features. The i2c slave address of regulator and rtc is different, so needs each i2c client on i2c operation functions. Also, this patch exports i2c operation functions instead of callback to make easy to read. Signed-off-by: Joonyoung Shim Signed-off-by: Kyungmin Park Signed-off-by: Samuel Ortiz --- include/linux/mfd/max8998-private.h | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) (limited to 'include') diff --git a/include/linux/mfd/max8998-private.h b/include/linux/mfd/max8998-private.h index 6dc75b3e2d33..f0a20cdc288c 100644 --- a/include/linux/mfd/max8998-private.h +++ b/include/linux/mfd/max8998-private.h @@ -75,38 +75,18 @@ enum { /** * struct max8998_dev - max8998 master device for sub-drivers * @dev: master device of the chip (can be used to access platform data) - * @i2c_client: i2c client private data - * @dev_read(): chip register read function - * @dev_write(): chip register write function - * @dev_update(): chip register update function + * @i2c: i2c client private data * @iolock: mutex for serializing io access */ struct max8998_dev { struct device *dev; - struct i2c_client *i2c_client; - int (*dev_read)(struct max8998_dev *max8998, u8 reg, u8 *dest); - int (*dev_write)(struct max8998_dev *max8998, u8 reg, u8 val); - int (*dev_update)(struct max8998_dev *max8998, u8 reg, u8 val, u8 mask); + struct i2c_client *i2c; struct mutex iolock; }; -static inline int max8998_read_reg(struct max8998_dev *max8998, u8 reg, - u8 *value) -{ - return max8998->dev_read(max8998, reg, value); -} - -static inline int max8998_write_reg(struct max8998_dev *max8998, u8 reg, - u8 value) -{ - return max8998->dev_write(max8998, reg, value); -} - -static inline int max8998_update_reg(struct max8998_dev *max8998, u8 reg, - u8 value, u8 mask) -{ - return max8998->dev_update(max8998, reg, value, mask); -} +extern int max8998_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest); +extern int max8998_write_reg(struct i2c_client *i2c, u8 reg, u8 value); +extern int max8998_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask); #endif /* __LINUX_MFD_MAX8998_PRIV_H */ -- cgit v1.2.3