Skip to contentSkip to conversation

MFD: DA9052 MFD core module v8

PATCH In review Ashish Jangam 2 participants 2 messages Oct 19, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/11 MFD: DA9052 MFD core module v8

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 v7:
- Replace ADC polling with interrupt mechanism
- Move macros related to battery module IRQs to header file 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         |  370 ++++++++++++++++++
 drivers/mfd/da9052-i2c.c          |  143 +++++++
 drivers/mfd/da9052-irq.c          |  175 +++++++++
 drivers/mfd/da9052-spi.c          |  166 ++++++++
 include/linux/mfd/da9052/da9052.h |  154 ++++++++
 include/linux/mfd/da9052/pdata.h  |   42 ++
 include/linux/mfd/da9052/reg.h    |  777 +++++++++++++++++++++++++++++++++++++
 9 files changed, 1860 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mfd/da9052-core.c
 create mode 100644 drivers/mfd/da9052-i2c.c
 create mode 100755 drivers/mfd/da9052-irq.c
 create mode 100755 drivers/mfd/da9052-spi.c
 create mode 100755 include/linux/mfd/da9052/da9052.h
 create mode 100755 include/linux/mfd/da9052/pdata.h
 create mode 100755 include/linux/mfd/da9052/reg.h
drivers/mfd/Kconfig +26 -0
index f1391c2..268f03b 100644
@@ -328,6 +328,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 b2292eb..2867276 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 +370 -0

370 lines not on this page · raw message

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

143 lines not on this page · raw message

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

175 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 +154 -0

154 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

#1 lore raw

drivers/mfd/da9052-spi.c line 29

Quoted 6 lines · Ashish Jangam
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)

So, as I think I mentioned last time based on the previous non-regmap versions of the patch I don't expect this to work at all. You should use the read_mask and/or write_mask options to set the flag bits you need to indicated if this is a read or write.