Skip to contentSkip to conversation

MFD: DA9052/53 MFD core module v10

PATCH Applied Ashish Jangam 3 participants 5 messages Dec 12, 2011 – Dec 18, 2011

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

PATCH 1/6 MFD: DA9052/53 MFD core module v10

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.

This patch is functionally tested on Samsung SMDKV6410.

---
Changes since v10:
- Add regmap-cache support
- Add regulator devices as MFD children
- Replace && operator with || operator
- Fix a memory leak in i2c_probe
- Remove i2c_client from struct da9052
Changes since v9:
- Add support for regmap_irq
- Patch split into I2C, ADC and SPI
- Support unconditional registration of all the regulators
- Replace magic number with define
- Remove user define bus_type from struct da9052
- Use spi_device_id - implemented in spi incremental patch
- Remove ADC deadlock issue - implemented in ADC incremental patch 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 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               |   16 +
 drivers/mfd/Makefile              |    4 +
 drivers/mfd/da9052-core.c         |  690 ++++++++++++++++++++++++++++++++++
 drivers/mfd/da9052-i2c.c          |  140 +++++++
 include/linux/mfd/da9052/da9052.h |  129 +++++++
 include/linux/mfd/da9052/pdata.h  |   40 ++
 include/linux/mfd/da9052/reg.h    |  749 +++++++++++++++++++++++++++++++++++++
 7 files changed, 1768 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mfd/da9052-core.c
 create mode 100644 drivers/mfd/da9052-i2c.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 +16 -0
index f1391c2..baced42 100644
@@ -328,6 +328,22 @@ 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_I2C
+	bool "Support Dialog Semiconductor DA9052/53 PMIC variants with I2C"
+	select REGMAP_I2C
+	select REGMAP_IRQ
+	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 +4 -0
index b2292eb..484f209 100644
@@ -67,6 +67,10 @@ endif
 obj-$(CONFIG_UCB1400_CORE)	+= ucb1400_core.o
 
 obj-$(CONFIG_PMIC_DA903X)	+= da903x.o
+
+obj-$(CONFIG_PMIC_DA9052)	+= da9052-core.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 +690 -0

690 lines not on this page · raw message

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

140 lines not on this page · raw message

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

129 lines not on this page · raw message

include/linux/mfd/da9052/pdata.h new file +40 -0
new file mode 100644
index 0000000..62c5c3c
@@ -0,0 +1,40 @@
+/*
+ * Platform data declarations for DA9052 PMICs.
+ *
+ * Copyright(c) 2011 Dialog Semiconductor Ltd.
+ *
+ * Author: David Dajun Chen <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#ifndef __MFD_DA9052_PDATA_H__
+#define __MFD_DA9052_PDATA_H__
+
+#define DA9052_MAX_REGULATORS	14
+
+struct da9052;
+
+struct da9052_pdata {
+	struct led_platform_data *pled;
+	int (*init) (struct da9052 *da9052);
+	int irq_base;
+	int gpio_base;
+	int use_for_apm;
+	struct regulator_init_data *regulators[DA9052_MAX_REGULATORS];
+};
+
+#endif
include/linux/mfd/da9052/reg.h new file +749 -0

749 lines not on this page · raw message

Reviewed-by on v1 1/6
#1 lore raw
Quoted 7 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.

This patch is functionally tested on Samsung SMDKV6410.

Looking good now! Samuel, this uses regmap-irq so either I can carry this or you can merge:

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git topic/irq

into your tree to get the changes that the driver depends on.

Acked-by
#2 lore raw

Hi Mark,

Quoted 9 lines · Mark Brown
Quoted 7 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.

This patch is functionally tested on Samsung SMDKV6410.

Quoted 8 lines

Looking good now! Samuel, this uses regmap-irq so either I can carry this or you can merge:

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git topic/irq

into your tree to get the changes that the driver depends on.

It's probably easier for you to merge it. Please add my

to it.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/
#3 lore raw
In reply to Mark Brown

Hi Mark,

Quoted 7 lines · Mark Brown
Quoted 5 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 6 lines
Quoted 1 line

This patch is functionally tested on Samsung SMDKV6410.

Looking good now! Samuel, this uses regmap-irq so either I can carry this or you can merge:

The former is fine with me, thanks in advance.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/
Applied
#4 lore raw
In reply to Ashish Jangam
Quoted 2 lines · Ashish Jangam

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

Applied, thanks.