Skip to contentSkip to conversation

mfd: tps65912: Add new mfd device

PATCH Superseded Margarita Olaya 2 participants 2 messages May 10, 2011 Multifunction devices (MFD)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 mfd: tps65912: Add new mfd device

The tps65912 chip is a power management IC. It contains the following components:

- Regulators
- GPIO controller

The tps65912 core driver is registered as a platform driver, it provides communition through I2C and SPI interfaces.

---
 drivers/mfd/Kconfig          |    8 +
 drivers/mfd/Makefile         |    1 +
 drivers/mfd/tps65912.c       |  353 ++++++++++++++++++++++++++++++++
 include/linux/mfd/tps65912.h |  457 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 819 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mfd/tps65912.c
 create mode 100644 include/linux/mfd/tps65912.h
drivers/mfd/Kconfig +8 -0
index 3ed3ff0..94ce6c4 100644
@@ -157,6 +157,14 @@ config TPS6507X
 	  This driver can also be built as a module.  If so, the module
 	  will be called tps6507x.
 
+config MFD_TPS65912
+	bool "TPS95612 Power Management chip"
+	select MFD_CORE
+	depends on I2C && GPIOLIB
+	help
+	  If you say yes here you get support for the TPS65912 series of
+	  PM chips.
+
 config MENELAUS
 	bool "Texas Instruments TWL92330/Menelaus PM chip"
 	depends on I2C=y && ARCH_OMAP2
drivers/mfd/Makefile +1 -0
index 419caa9..9d60cfd 100644
@@ -31,6 +31,7 @@ wm8350-objs			+= wm8350-irq.o
 obj-$(CONFIG_MFD_WM8350)	+= wm8350.o
 obj-$(CONFIG_MFD_WM8350_I2C)	+= wm8350-i2c.o
 obj-$(CONFIG_MFD_WM8994)	+= wm8994-core.o wm8994-irq.o
+obj-$(CONFIG_MFD_TPS65912)	+= tps65912.o
 
 obj-$(CONFIG_TPS6105X)		+= tps6105x.o
 obj-$(CONFIG_TPS65010)		+= tps65010.o
drivers/mfd/tps65912.c new file +353 -0

353 lines not on this page · raw message

include/linux/mfd/tps65912.h new file +457 -0

457 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#1 lore raw

drivers/mfd/Kconfig config TPS6507X · line 167

Quoted 8 lines · Margarita Olaya
drivers/mfd/Kconfig +8 -0
+config MFD_TPS65912
+	bool "TPS95612 Power Management chip"
+	select MFD_CORE
+	depends on I2C && GPIOLIB
+	help
+	  If you say yes here you get support for the TPS65912 series of
+	  PM chips.
+

There's a whole bunch of optional SPI code in the driver so either the dependency is wrong or the code doesn't do anything. It's generally better to split the buses if you've got both SPI and I2C as PMICs pretty much have to be built in and this will force both buses to be built in, though it's not really *too* big a deal.

drivers/mfd/Makefile wm8350-objs += wm8350-irq.o · line 37

Quoted 9 lines

+++ b/drivers/mfd/Makefile

drivers/mfd/Makefile +1 -0
@@ -31,6 +31,7 @@ wm8350-objs			+= wm8350-irq.o
 obj-$(CONFIG_MFD_WM8350)	+= wm8350.o
 obj-$(CONFIG_MFD_WM8350_I2C)	+= wm8350-i2c.o
 obj-$(CONFIG_MFD_WM8994)	+= wm8994-core.o wm8994-irq.o
+obj-$(CONFIG_MFD_TPS65912)	+= tps65912.o
 
 obj-$(CONFIG_TPS6105X)		+= tps6105x.o
 obj-$(CONFIG_TPS65010)		+= tps65010.o

Seems nicer to sort this with the other tps drivers?

drivers/mfd/tps65912.c line 165

Quoted 3 lines
drivers/mfd/tps65912.c new file +3 -0
+	tx_buf = spi_data;
+	rx_buf = 0;
+	xfer.speed_hz	= spi->max_speed_hz;

The default max_speed_hz from the driver should be used if you don't do anything so this isn't needed.

include/linux/mfd/tps65912.h line 145

Quoted 13 lines
include/linux/mfd/tps65912.h new file +13 -0
+#define GPIO1_R_IT_SHIFT		6
+#define HOTDIE_IT_MASK			0x20
+#define HOTDIE_IT_SHIFT			5
+#define PWRHOLD_R_IT_MASK		0x10
+#define PWRHOLD_R_IT_SHIFT		4
+#define PWRON_LP_IT_MASK		0x08
+#define PWRON_LP_IT_SHIFT		3
+#define PWRON_IT_MASK			0x04
+#define PWRON_IT_SHIFT			2
+#define VMON_IT_MASK			0x02
+#define VMON_IT_SHIFT			1
+#define PWRHOLD_F_IT_MAKS		0x01
+#define PWRHOLD_F_IT_SHIFT		0

Most of the identifiers in the header look like they ought to be namespaced.