MFD: DA9052 Code refactored to use regmap
Subsystems (2)
PATCH 1/11 MFD: DA9052 Code refactored to use regmap
DA9052 MFD Code is refactored to add remap support in the DA9052. Recent changes to DA9052 battery module also required certain components to be added in this patch. Also set bits and clear bits are removed and instead da9052_reg_update() will be used in future.
Signed-off-by David Dajun Chen <[email protected]>
Signed-off-by Ashish Jangam <[email protected]>
--- drivers/mfd/Kconfig | 2 + drivers/mfd/da9052-core.c | 243 ++++++++---------------------------- drivers/mfd/da9052-i2c.c | 73 +++-------- drivers/mfd/da9052-spi.c | 55 +++------ include/linux/mfd/da9052/da9052.h | 13 +-- include/linux/mfd/da9052/pdata.h | 3 +- include/linux/mfd/da9052/reg.h | 2 + 7 files changed, 98 insertions(+), 293 deletions(-)
drivers/mfd/Kconfig +2 -0
@@ -350,6 +350,7 @@ config MFD_DA9052_SPI bool "Support Dialog Semiconductor DA9052 PMIC with SPI" select MFD_CORE select PMIC_DA9052 + select REGMAP_SPI depends on SPI_MASTER=y help Support for the Dialog Semiconductor DA9052 PMIC
@@ -361,6 +362,7 @@ config MFD_DA9052_I2C bool "Support Dialog Semiconductor DA9052 PMIC with I2C" select MFD_CORE select PMIC_DA9052 + select REGMAP_I2C depends on I2C=y help Support for the Dialog Semiconductor DA9052 PMIC
drivers/mfd/da9052-core.c +54 -189
318 lines not on this page · raw message
drivers/mfd/da9052-i2c.c +21 -52
125 lines not on this page · raw message
drivers/mfd/da9052-spi.c +15 -40
80 lines not on this page · raw message
include/linux/mfd/da9052/da9052.h +3 -10
@@ -27,6 +27,7 @@#include <linux/slab.h> #include <linux/interrupt.h> #include <linux/mfd/core.h> +#include <linux/regmap.h> /* HWMON Channel Definations */ #define DA9052_ADC_VDDOUT 0
@@ -50,16 +51,12 @@ struct da9052 {struct device *dev;struct spi_device *spi_dev;struct i2c_client *i2c_client; +struct regmap *regmap;int irq_base; -u8 rw_pol; -u32 events_mask; +u32 events_mask;int chip_irq; -int (*read_dev) (struct da9052 *da9052,unsigned char reg, -unsigned bytes,unsigned char *val); -int (*write_dev) (struct da9052 *da9052,unsigned char reg, -unsigned bytes,unsigned char *val); };/* ADC API */
@@ -77,10 +74,6 @@ int da9052_group_write(struct da9052 *da9052, unsigned char reg, unsigned bytes, unsigned char *val);int da9052_reg_update (struct da9052 *da9052,unsigned char reg,unsigned char bit_mask,unsigned char reg_val); -int da9052_set_bits (struct da9052 *da9052,unsigned char reg, -unsigned char bit_mask); -int da9052_clear_bits (struct da9052 *da9052,unsigned char reg, -unsigned char bit_mask);int da9052_device_init (struct da9052 *da9052);void da9052_device_exit (struct da9052 *da9052);
include/linux/mfd/da9052/pdata.h +1 -2
@@ -30,13 +30,12 @@ struct da9052;struct da9052_pdata {struct led_platform_data *pled; -struct da9052_wdt_platform_data *pwdt; -struct da9052_tsi_platform_data *ptsi;int (*init) (struct da9052 *da9052);int irq;int irq_base;int num_regulators;int gpio_base; +int use_for_apm;struct regulator_init_data *regulators[DA9052_MAX_REGULATORS ]; };
include/linux/mfd/da9052/reg.h +2 -0
@@ -58,6 +58,8 @@/*GPIO REGISTERS*/ #define DA9052_GPIO_0_1_REG 21#define DA9052_GPIO_2_3_REG 22 +#define DA9052_GPIO_4_5_REG 23 +#define DA9052_GPIO_6_7_REG 24#define DA9052_GPIO_14_15_REG 28/*LDO AND BUCK REGISTERS*/
drivers/mfd/Kconfig config MFD_DA9052_SPI · line 356
Quoted 10 lines · On Thu, Aug 04, 2011 at 06:15:02PM +0530, ashishj3 wrote:
drivers/mfd/Kconfig +1
-0@@ -350,6 +350,7 @@ config MFD_DA9052_SPI bool "Support Dialog Semiconductor DA9052 PMIC with SPI" select MFD_CORE select PMIC_DA9052 + select REGMAP_SPI depends on SPI_MASTER=y help Support for the Dialog Semiconductor DA9052 PMIC
This is an incremental patch against a driver that's not yet been merged. As has been pointed out before you should send the complete patch when submitting drivers that have not yet been merged.