Skip to contentSkip to conversation

MFD: DA9052 MFD core module v8

PATCH In review Ashish Jangam 2 participants 3 messages Nov 3, 2011 – Nov 18, 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 v8:
- Add read/write mask flag for SPI
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 IRQ_NONE
- Remove register address conversion
Changes since v4:
- Modify KConfig
- Use device registration for determining 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 re-factored 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         |  371 ++++++++++++++++++
 drivers/mfd/da9052-i2c.c          |  144 +++++++
 drivers/mfd/da9052-irq.c          |  175 +++++++++
 drivers/mfd/da9052-spi.c          |  169 ++++++++
 include/linux/mfd/da9052/da9052.h |  154 ++++++++
 include/linux/mfd/da9052/pdata.h  |   42 ++
 include/linux/mfd/da9052/reg.h    |  777 +++++++++++++++++++++++++++++++++++++
 9 files changed, 1865 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 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 +371 -0

371 lines not on this page · raw message

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

144 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 +169 -0

169 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
Quoted 9 lines · Ashish Jangam

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 10 lines
---
 drivers/mfd/Kconfig               |   26 ++
 drivers/mfd/Makefile              |    7 +
 drivers/mfd/da9052-core.c         |  371 ++++++++++++++++++
 drivers/mfd/da9052-i2c.c          |  144 +++++++
 drivers/mfd/da9052-irq.c          |  175 +++++++++
 drivers/mfd/da9052-spi.c          |  169 ++++++++
 include/linux/mfd/da9052/da9052.h |  154 ++++++++
 include/linux/mfd/da9052/pdata.h  |   42 ++
 include/linux/mfd/da9052/reg.h    |  777 +++++++++++++++++++++++++++++++++++++
Quoted 8 lines
 9 files changed, 1865 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

These three headers are needed by drivers/gpio/gpio-da9052.c. (That file also needs a fourth header, linux/mfd/da9052/gpio.h, but maybe that's added by another patch in this series. I didn't check). That file got added by commit 07bfc91523 ("GPIO: DA9052 GPIO module v3"), and is included since v3.1.

drivers/mfd/Kconfig config PMIC_DA903X · line 333

Quoted 11 lines
drivers/mfd/Kconfig +3 -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

And the DA9052 GPIO module currently depends on this Kconfig symbol.

Quoted 15 lines
drivers/mfd/Kconfig +15 -0
+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

drivers/mfd/Kconfig config PMIC_DA903X · line 359

Quoted 10 lines
drivers/mfd/Kconfig +7 -0
+	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

[...]

So the DA9052 GPIO module that is currently in the mainline tree was added as unbuildable code, wasn't it?

Paul Bolle

#2 lore raw
Quoted 14 lines

-----Original Message-----
From: Paul Bolle [mailto:[email protected]]
Sent: Friday, November 18, 2011 3:27 PM
To: Ashish Jangam
Cc: Mark Brown; [email protected]; [email protected]; linux- [email protected]; Dajun; [email protected]
Subject: Re: [PATCH 1/11] MFD: DA9052 MFD core module v8

Quoted 4 lines · Ashish Jangam

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

Quoted 8 lines
Quoted 5 lines

control and other functionality.

---

So the DA9052 GPIO module that is currently in the mainline tree was added as unbuildable code, wasn't it?

DA9052 MFD has undergone changes even after ack of DA9052 GPIO so with the current MFD it may not work. Now once MFD gets through I will send an incr patch for DA9052 GPIO.

Quoted 4 lines

Paul Bolle

���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m���� ������?�I�