Skip to contentSkip to conversation

MFD: DA9052/53 MFD core module v6

PATCH In review ashishj3 4 participants 4 messages Sep 19, 2011 – Sep 29, 2011

Subsystems (2)
lore
Share & tools
lore

ashishj3

author
#0 lore raw

PATCH 1/11 MFD: DA9052/53 MFD core module v6

The DA9052/53 is a highly integrated PMIC subsystem with supply domain flexibility to support wide range of high performance application.

It provides voltage regulators, GPIO controller, Touch Screen, RTC, Battery control and other functionality.

---
Changes since v6:
- Move inlined device I/O functions to header file
Changes since v5:
- Inline device I/O
- Unhandle IRQ return RQ_NONE
- Remove register address conversion
Changes since v4:
- Modify KConfig
- Use device registration for detemining chip id
- Remove preprocessor directive with runtime bustype variable
- Replace module_init() for spi with subsys_initcall()
- Remove platform string from MODULE_ALIAS of spi module. Changes since v3:
- Code refactored to use REGMAP API.
- Add Battery resources.
- da9052_set_bits() and da9052_clear_bits() replaced by da9052_reg_update().
- Add support for DA9053 PMIC
Changes since v2:
- Drop da9052_irqs[] table.
- Move struct da9052_subdev_info[].
- Remove initialization of static member.
- Care for NULL pdata init().
- Check removal of subdevices on errors.
- Remove open source spi code.
- Remove '_spi' from the driver name.
- Move tbat_lookup table from header file.
- Remove irq.h
- Remove num_gpio variable from pdata

---
 drivers/mfd/Kconfig               |   26 ++
 drivers/mfd/Makefile              |    7 +
 drivers/mfd/da9052-core.c         |  333 ++++++++++++++++
 drivers/mfd/da9052-i2c.c          |  142 +++++++
 drivers/mfd/da9052-irq.c          |  173 ++++++++
 drivers/mfd/da9052-spi.c          |  166 ++++++++
 include/linux/mfd/da9052/da9052.h |  139 +++++++
 include/linux/mfd/da9052/pdata.h  |   42 ++
 include/linux/mfd/da9052/reg.h    |  777 +++++++++++++++++++++++++++++++++++++
 9 files changed, 1805 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mfd/da9052-core.c
 create mode 100644 drivers/mfd/da9052-i2c.c
 create mode 100644 drivers/mfd/da9052-irq.c
 create mode 100644 drivers/mfd/da9052-spi.c
 create mode 100644 include/linux/mfd/da9052/da9052.h
 create mode 100644 include/linux/mfd/da9052/pdata.h
 create mode 100644 include/linux/mfd/da9052/reg.h
drivers/mfd/Kconfig +26 -0
index 21574bd..572a6a8 100644
@@ -343,6 +343,32 @@ config PMIC_DA903X
 	  individual components like LCD backlight, voltage regulators,
 	  LEDs and battery-charger under the corresponding menus.
 
+config PMIC_DA9052
+	bool
+	select MFD_CORE
+
+config MFD_DA9052_SPI
+	bool "Support Dialog Semiconductor DA9052/53 PMIC variants with SPI"
+	select REGMAP_SPI
+	select PMIC_DA9052
+	depends on SPI_MASTER=y
+	help
+	  Support for the Dialog Semiconductor DA9052 PMIC
+	  when controlled using SPI. This driver provides common support
+	  for accessing the device, additional drivers must be enabled in
+	  order to use the functionality of the device.
+
+config MFD_DA9052_I2C
+	bool "Support Dialog Semiconductor DA9052/53 PMIC variants with I2C"
+	select REGMAP_I2C
+	select PMIC_DA9052
+	depends on I2C=y
+	help
+	  Support for the Dialog Semiconductor DA9052 PMIC
+	  when controlled using I2C. This driver provides common support
+	  for accessing the device, additional drivers must be enabled in
+	  order to use the functionality of the device.
+
 config PMIC_ADP5520
 	bool "Analog Devices ADP5520/01 MFD PMIC Core Support"
 	depends on I2C=y
drivers/mfd/Makefile +7 -0
index c580203..89a5837 100644
@@ -67,6 +67,13 @@ endif
 obj-$(CONFIG_UCB1400_CORE)	+= ucb1400_core.o
 
 obj-$(CONFIG_PMIC_DA903X)	+= da903x.o
+
+da9052-objs			:= da9052-core.o da9052-irq.o
+obj-$(CONFIG_PMIC_DA9052)	+= da9052.o
+
+obj-$(CONFIG_MFD_DA9052_SPI)	+= da9052-spi.o
+obj-$(CONFIG_MFD_DA9052_I2C)	+= da9052-i2c.o
+
 max8925-objs			:= max8925-core.o max8925-i2c.o
 obj-$(CONFIG_MFD_MAX8925)	+= max8925.o
 obj-$(CONFIG_MFD_MAX8997)	+= max8997.o max8997-irq.o
drivers/mfd/da9052-core.c new file +333 -0

333 lines not on this page · raw message

drivers/mfd/da9052-i2c.c new file +142 -0

142 lines not on this page · raw message

drivers/mfd/da9052-irq.c new file +173 -0

173 lines not on this page · raw message

drivers/mfd/da9052-spi.c new file +166 -0

166 lines not on this page · raw message

include/linux/mfd/da9052/da9052.h new file +139 -0

139 lines not on this page · raw message

include/linux/mfd/da9052/pdata.h new file +42 -0

42 lines not on this page · raw message

include/linux/mfd/da9052/reg.h new file +777 -0

777 lines not on this page · raw message

Acked-by on v1 1/11
#1 lore raw
Quoted 8 lines · On Mon, Sep 19, 2011 at 8:33 PM, ashishj3 <[email protected]> wrote:

The DA9052/53 is a highly integrated PMIC subsystem with supply domain flexibility to support wide range of high performance application.

It provides voltage regulators, GPIO controller, Touch Screen, RTC, Battery control and other functionality.

Looks good to me.

#2 lore raw

Hi Eric,

Quoted 7 lines · Eric Miao
Quoted 6 lines · On Mon, Sep 19, 2011 at 8:33 PM, ashishj3 <[email protected]> wrote:

The DA9052/53 is a highly integrated PMIC subsystem with supply domain flexibility to support wide range of high performance application.

It provides voltage regulators, GPIO controller, Touch Screen, RTC, Battery control and other functionality.

Quoted 6 lines
Quoted 2 lines

Looks good to me.

I was not cc'ed on the thread, so I don't even have the patch to review it. Would you mind sending it to me ?

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/
#3 lore raw
In reply to ashishj3
Quoted 5 lines · On Mon, Sep 19, 2011 at 06:03:16PM +0530, ashishj3 wrote:

The DA9052/53 is a highly integrated PMIC subsystem with supply domain flexibility to support wide range of high performance application.

It provides voltage regulators, GPIO controller, Touch Screen, RTC, Battery control and other functionality.

So, this looks good. However...

drivers/mfd/da9052-spi.c line 29

Quoted 6 lines
drivers/mfd/da9052-spi.c new file +6 -0
+static struct regmap_config da9052_regmap_config = {
+	.reg_bits = 8,
+	.val_bits = 8,
+};
+
+static int da9052_spi_probe(struct spi_device *spi)

...having reviewed previous versions of your driver I believe you need to set either or both of read_flag_mask or write_flag_mask your regmap config (these have been added in -next) - previous versions of your driver had code which was trying to bodge this in, you've removed this code but not added any use of the generic facility so I rather suspect that currently the driver doesn't work with SPI.

Samuel, as a fix will depend on -next regmap I guess it makes sense for me to apply this if a new version is provided before the next merge window?