Skip to contentSkip to conversation

PCF50633 support

PATCH In review Balaji Rao 3 participants 11 messages Jan 5, 2009 – Jan 13, 2009

Subsystems (4)
lore
Share & tools
lore

Balaji Rao

author
#0 lore raw

v3 cover PCF50633 support

Changes from V1:
- Subdevice specific header files now included in its respective patch.
- Introduces pcf50633_register_irq and pcf50633_free_irq for irq management
- Many changes in how subdevices are created and information is passed to them. Thanks to Alessandro Zummo for suggestions.
Changes from V2:
- Changed RTC driver to use new alarm/update interfaces.
- Cosmetic changes in ADC driver.

The following series implements support for NXP PCF50633. It's basically an I2C device with 9 regulators, an ADC, a PMIC, a Battery Charger and a RTC.

This chip is used in Openmoko Neo Freerunner mobile phone.

The specs are open and are available at
http://people.openmoko.org/tony_tu/GTA02/datasheet/PMU/PCF50633DS_02.pdf

---
Balaji Rao (7):
mfd: PCF50633 core driver
mfd: PCF50633 adc driver
mfd: PCF50633 gpio support
rtc: PCF50633 rtc driver
power_supply: PCF50633 battery charger driver
input: PCF50633 input driver
regulator: PCF50633 pmic driver

 drivers/input/misc/Kconfig             |    7 
 drivers/input/misc/Makefile            |    1 
 drivers/input/misc/pcf50633-input.c    |  132 ++++++
 drivers/mfd/Kconfig                    |   23 +
 drivers/mfd/Makefile                   |    6 
 drivers/mfd/pcf50633-adc.c             |  277 ++++++++++++
 drivers/mfd/pcf50633-core.c            |  710 ++++++++++++++++++++++++++++++++
 drivers/mfd/pcf50633-gpio.c            |  118 +++++
 drivers/power/Kconfig                  |    6 
 drivers/power/Makefile                 |    1 
 drivers/power/pcf50633-charger.c       |  358 ++++++++++++++++
 drivers/regulator/Kconfig              |    7 
 drivers/regulator/Makefile             |    1 
 drivers/regulator/pcf50633-regulator.c |  329 +++++++++++++++
 drivers/rtc/Kconfig                    |    7 
 drivers/rtc/Makefile                   |    1 
 drivers/rtc/rtc-pcf50633.c             |  344 ++++++++++++++++
 include/linux/mfd/pcf50633/adc.h       |   72 +++
 include/linux/mfd/pcf50633/core.h      |  218 ++++++++++
 include/linux/mfd/pcf50633/gpio.h      |   52 ++
 include/linux/mfd/pcf50633/mbc.h       |  134 ++++++
 include/linux/mfd/pcf50633/pmic.h      |   67 +++
 22 files changed, 2870 insertions(+), 1 deletions(-)
 create mode 100644 drivers/input/misc/pcf50633-input.c
 create mode 100644 drivers/mfd/pcf50633-adc.c
 create mode 100644 drivers/mfd/pcf50633-core.c
 create mode 100644 drivers/mfd/pcf50633-gpio.c
 create mode 100644 drivers/power/pcf50633-charger.c
 create mode 100644 drivers/regulator/pcf50633-regulator.c
 create mode 100644 drivers/rtc/rtc-pcf50633.c
 create mode 100644 include/linux/mfd/pcf50633/adc.h
 create mode 100644 include/linux/mfd/pcf50633/core.h
 create mode 100644 include/linux/mfd/pcf50633/gpio.h
 create mode 100644 include/linux/mfd/pcf50633/mbc.h
 create mode 100644 include/linux/mfd/pcf50633/pmic.h
Signature · 2 lines
Thanks,
Balaji Rao
author
#1 lore raw

PATCH v3 1/7 mfd: PCF50633 core driver

This patch implements the core of the PCF50633 driver. This core driver has generic register read/write functions and does interrupt management for its sub devices.

Cc Andy Green <[email protected]>
Cc Samuel Ortiz <[email protected]>
---
 drivers/mfd/Kconfig               |    9 
 drivers/mfd/Makefile              |    4 
 drivers/mfd/pcf50633-core.c       |  710 +++++++++++++++++++++++++++++++++++++
 include/linux/mfd/pcf50633/core.h |  218 +++++++++++
 4 files changed, 940 insertions(+), 1 deletions(-)
 create mode 100644 drivers/mfd/pcf50633-core.c
 create mode 100644 include/linux/mfd/pcf50633/core.h
drivers/mfd/Kconfig +9 -0
index 2572773..73f4aeb 100644
@@ -153,6 +153,15 @@ config MFD_WM8350_I2C
 	  I2C as the control interface.  Additional options must be
 	  selected to enable support for the functionality of the chip.
 
+config MFD_PCF50633
+	tristate "Support for NXP PCF50633"
+	depends on I2C
+	help
+	  Say yes here if you have NXP PCF50633 chip on your board.
+	  This core driver provides register access and IRQ handling
+	  facilities, and registers devices for the various functions
+	  so that function-specific drivers can bind to them.
+
 endmenu
 
 menu "Multimedia Capabilities Port drivers"
drivers/mfd/Makefile +3 -1
index 9a5ad8a..6a4add8 100644
@@ -31,4 +31,6 @@ obj-$(CONFIG_MCP_UCB1200)	+= ucb1x00-assabet.o
 endif
 obj-$(CONFIG_UCB1400_CORE)	+= ucb1400_core.o
 
-obj-$(CONFIG_PMIC_DA903X)	+= da903x.o
\ No newline at end of file
+obj-$(CONFIG_PMIC_DA903X)	+= da903x.o
+
+obj-$(CONFIG_MFD_PCF50633)	+= pcf50633-core.o
drivers/mfd/pcf50633-core.c new file +710 -0

710 lines not on this page · raw message

include/linux/mfd/pcf50633/core.h new file +218 -0

218 lines not on this page · raw message

author
#2 lore raw

PATCH v3 2/7 mfd: PCF50633 adc driver

In reply to Balaji Rao

This patch adds basic support for the PCF50633 ADC. The subtractive mode is not supported yet.

Since we don't have adc subsystem, it currently lives in drivers/mfd.

---
 drivers/mfd/Kconfig              |    7 +
 drivers/mfd/Makefile             |    1 
 drivers/mfd/pcf50633-adc.c       |  277 ++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/pcf50633/adc.h |   72 ++++++++++
 4 files changed, 357 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mfd/pcf50633-adc.c
 create mode 100644 include/linux/mfd/pcf50633/adc.h
drivers/mfd/Kconfig +7 -0
index 73f4aeb..3af4cd1 100644
@@ -162,6 +162,13 @@ config MFD_PCF50633
 	  facilities, and registers devices for the various functions
 	  so that function-specific drivers can bind to them.
 
+config PCF50633_ADC
+	tristate "Support for NXP PCF50633 ADC"
+	depends on MFD_PCF50633
+	help
+	 Say yes here if you want to include support for ADC in the
+	 NXP PCF50633 chip.
+
 endmenu
 
 menu "Multimedia Capabilities Port drivers"
drivers/mfd/Makefile +1 -0
index 6a4add8..7a12b09 100644
@@ -34,3 +34,4 @@ obj-$(CONFIG_UCB1400_CORE)	+= ucb1400_core.o
 obj-$(CONFIG_PMIC_DA903X)	+= da903x.o
 
 obj-$(CONFIG_MFD_PCF50633)	+= pcf50633-core.o
+obj-$(CONFIG_PCF50633_ADC)	+= pcf50633-adc.o
drivers/mfd/pcf50633-adc.c new file +277 -0

277 lines not on this page · raw message

include/linux/mfd/pcf50633/adc.h new file +72 -0

72 lines not on this page · raw message

author
#3 lore raw

PATCH v3 3/7 mfd: PCF50633 gpio support

In reply to Balaji Rao

What the PCF05633 calls as a 'GPIO' is much more than the GPIO in the linux sense and there are only 4 of them - which means, the gpiolib is not used here.

Cc Andy Green <[email protected]>
Cc Samuel Ortiz <[email protected]>
---
 drivers/mfd/Kconfig               |    7 ++
 drivers/mfd/Makefile              |    1 
 drivers/mfd/pcf50633-gpio.c       |  118 +++++++++++++++++++++++++++++++++++++
 include/linux/mfd/pcf50633/gpio.h |   52 ++++++++++++++++
 4 files changed, 178 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mfd/pcf50633-gpio.c
 create mode 100644 include/linux/mfd/pcf50633/gpio.h
drivers/mfd/Kconfig +7 -0
index 3af4cd1..8d8c8df 100644
@@ -169,6 +169,13 @@ config PCF50633_ADC
 	 Say yes here if you want to include support for ADC in the
 	 NXP PCF50633 chip.
 
+config PCF50633_GPIO
+	tristate "Support for NXP PCF50633 GPIO"
+	depends on MFD_PCF50633
+	help
+	 Say yes here if you want to include support GPIO for pins on
+	 the PCF50633 chip.
+
 endmenu
 
 menu "Multimedia Capabilities Port drivers"
drivers/mfd/Makefile +1 -0
index 7a12b09..5bc7c9f 100644
@@ -35,3 +35,4 @@ obj-$(CONFIG_PMIC_DA903X)	+= da903x.o
 
 obj-$(CONFIG_MFD_PCF50633)	+= pcf50633-core.o
 obj-$(CONFIG_PCF50633_ADC)	+= pcf50633-adc.o
+obj-$(CONFIG_PCF50633_GPIO)	+= pcf50633-gpio.o
drivers/mfd/pcf50633-gpio.c new file +118 -0

118 lines not on this page · raw message

include/linux/mfd/pcf50633/gpio.h new file +52 -0

52 lines not on this page · raw message

author
#4 lore raw

PATCH v3 4/7 rtc: PCF50633 rtc driver

In reply to Balaji Rao
Cc Andy Green <[email protected]>
Cc Alessandro Zummo <[email protected]>
Cc Paul Gortmaker <[email protected]>

---

Changes from V1:
- Removed include/linux/mfd/pcf50633/rtc.h and moved defenitions into the source file.
- Remove PIE and introduce UIE support. UIE being the one actually supported in the chip.
Changes from V2:
- Updated the driver to use new interfaces for alarm/update.

---
 drivers/rtc/Kconfig        |    7 +
 drivers/rtc/Makefile       |    1 
 drivers/rtc/rtc-pcf50633.c |  344 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 352 insertions(+), 0 deletions(-)
 create mode 100644 drivers/rtc/rtc-pcf50633.c
drivers/rtc/Kconfig +7 -0
index 165a818..63b1fea 100644
@@ -501,6 +501,13 @@ config RTC_DRV_WM8350
 	  This driver can also be built as a module. If so, the module
 	  will be called "rtc-wm8350".
 
+config RTC_DRV_PCF50633
+	depends on MFD_PCF50633
+	tristate "NXP PCF50633 RTC"
+	help
+	  If you say yes here you get support for the RTC subsystem of the
+	  NXP PCF50633 used in embedded systems.
+
 comment "on-CPU RTC drivers"
 
 config RTC_DRV_OMAP
drivers/rtc/Makefile +1 -0
index 6e79c91..a717fec 100644
@@ -70,3 +70,4 @@ obj-$(CONFIG_RTC_DRV_V3020)	+= rtc-v3020.o
 obj-$(CONFIG_RTC_DRV_VR41XX)	+= rtc-vr41xx.o
 obj-$(CONFIG_RTC_DRV_WM8350)	+= rtc-wm8350.o
 obj-$(CONFIG_RTC_DRV_X1205)	+= rtc-x1205.o
+obj-$(CONFIG_RTC_DRV_PCF50633)	+= rtc-pcf50633.o
drivers/rtc/rtc-pcf50633.c new file +344 -0

344 lines not on this page · raw message

Acked-by on v3 4/7
#5 lore raw

Re: [PATCH V3 4/7] rtc: PCF50633 rtc driver

Quoted 5 lines · On Mon, 05 Jan 2009 23:44:31 +0530 Balaji Rao <[email protected]> wrote:
Cc Andy Green <[email protected]>
Cc Alessandro Zummo <[email protected]>
Cc Paul Gortmaker <[email protected]>
Signature · 6 lines
 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it
author
#6 lore raw

PATCH v3 5/7 power_supply: PCF50633 battery charger driver

In reply to Balaji Rao
---
 drivers/power/Kconfig            |    6 +
 drivers/power/Makefile           |    1 
 drivers/power/pcf50633-charger.c |  358 ++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/pcf50633/mbc.h |  134 ++++++++++++++
 4 files changed, 499 insertions(+), 0 deletions(-)
 create mode 100644 drivers/power/pcf50633-charger.c
 create mode 100644 include/linux/mfd/pcf50633/mbc.h
drivers/power/Kconfig +6 -0
index 8e0c2b4..3240b9c 100644
@@ -68,4 +68,10 @@ config BATTERY_BQ27x00
 	help
 	  Say Y here to enable support for batteries with BQ27200(I2C) chip.
 
+config CHARGER_PCF50633
+	tristate "NXP PCF50633 MBC"
+	depends on MFD_PCF50633
+	help
+	 Say Y to include support for NXP PCF50633 Main Battery Charger.
+
 endif # POWER_SUPPLY
drivers/power/Makefile +1 -0
index e8f1ece..a15739a 100644
@@ -23,3 +23,4 @@ obj-$(CONFIG_BATTERY_OLPC)	+= olpc_battery.o
 obj-$(CONFIG_BATTERY_TOSA)	+= tosa_battery.o
 obj-$(CONFIG_BATTERY_WM97XX)	+= wm97xx_battery.o
 obj-$(CONFIG_BATTERY_BQ27x00)	+= bq27x00_battery.o
+obj-$(CONFIG_CHARGER_PCF50633)	+= pcf50633-charger.o
drivers/power/pcf50633-charger.c new file +358 -0

358 lines not on this page · raw message

include/linux/mfd/pcf50633/mbc.h new file +134 -0

134 lines not on this page · raw message

author
#7 lore raw

PATCH v3 6/7 input: PCF50633 input driver

In reply to Balaji Rao
---
 drivers/input/misc/Kconfig          |    7 ++
 drivers/input/misc/Makefile         |    1 
 drivers/input/misc/pcf50633-input.c |  132 +++++++++++++++++++++++++++++++++++
 3 files changed, 140 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/misc/pcf50633-input.c
drivers/input/misc/Kconfig +7 -0
index 199055d..67e5553 100644
@@ -220,4 +220,11 @@ config HP_SDC_RTC
 	  Say Y here if you want to support the built-in real time clock
 	  of the HP SDC controller.
 
+config INPUT_PCF50633_PMU
+	tristate "PCF50633 PMU events"
+	depends on MFD_PCF50633
+	help
+	 Say Y to include support for delivering  PMU events via  input
+	 layer on NXP PCF50633.
+
 endif
drivers/input/misc/Makefile +1 -0
index d7db2ae..bb62e6e 100644
@@ -21,3 +21,4 @@ obj-$(CONFIG_HP_SDC_RTC)		+= hp_sdc_rtc.o
 obj-$(CONFIG_INPUT_UINPUT)		+= uinput.o
 obj-$(CONFIG_INPUT_APANEL)		+= apanel.o
 obj-$(CONFIG_INPUT_SGI_BTNS)		+= sgi_btns.o
+obj-$(CONFIG_INPUT_PCF50633_PMU)	+= pcf50633-input.o
drivers/input/misc/pcf50633-input.c new file +132 -0

132 lines not on this page · raw message

author
#8 lore raw

PATCH v3 7/7 regulator: PCF50633 pmic driver

In reply to Balaji Rao

Changes from V1:
- Removed support for suspend_enable & suspend_disable functions.

---
 drivers/regulator/Kconfig              |    7 +
 drivers/regulator/Makefile             |    1 
 drivers/regulator/pcf50633-regulator.c |  329 ++++++++++++++++++++++++++++++++
 include/linux/mfd/pcf50633/pmic.h      |   67 +++++++
 4 files changed, 404 insertions(+), 0 deletions(-)
 create mode 100644 drivers/regulator/pcf50633-regulator.c
 create mode 100644 include/linux/mfd/pcf50633/pmic.h
drivers/regulator/Kconfig +7 -0
index 39360e2..e7e0cf1 100644
@@ -73,4 +73,11 @@ config REGULATOR_DA903X
 	  Say y here to support the BUCKs and LDOs regulators found on
 	  Dialog Semiconductor DA9030/DA9034 PMIC.
 
+config REGULATOR_PCF50633
+	tristate "PCF50633 regulator driver"
+        depends on MFD_PCF50633
+	help
+	 Say Y here to support the voltage regulators and convertors
+	 on PCF50633
+
 endif
drivers/regulator/Makefile +1 -0
index 254d40c..61b30c6 100644
@@ -11,5 +11,6 @@ obj-$(CONFIG_REGULATOR_BQ24022) += bq24022.o
 obj-$(CONFIG_REGULATOR_WM8350) += wm8350-regulator.o
 obj-$(CONFIG_REGULATOR_WM8400) += wm8400-regulator.o
 obj-$(CONFIG_REGULATOR_DA903X)	+= da903x.o
+obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o
 
 ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG
drivers/regulator/pcf50633-regulator.c new file +329 -0

329 lines not on this page · raw message

include/linux/mfd/pcf50633/pmic.h new file +67 -0

67 lines not on this page · raw message

#9 lore raw
In reply to Balaji Rao
Quoted 9 lines · On Mon, 05 Jan 2009 23:42:42 +0530 Balaji Rao <[email protected]> wrote:

The following series implements support for NXP PCF50633. It's basically an I2C device with 9 regulators, an ADC, a PMIC, a Battery Charger and a RTC.

This chip is used in Openmoko Neo Freerunner mobile phone.

The specs are open and are available at
http://people.openmoko.org/tony_tu/GTA02/datasheet/PMU/PCF50633DS_02.pdf

Quoted 9 lines

---
Balaji Rao (7):
mfd: PCF50633 core driver
mfd: PCF50633 adc driver
mfd: PCF50633 gpio support
rtc: PCF50633 rtc driver
power_supply: PCF50633 battery charger driver
input: PCF50633 input driver
regulator: PCF50633 pmic driver

You have patches here which should strictly be merged by various different subsystem trees. That gets tricky because presumably there are dependencies.

What _are_ the dependencies here? Do patches 2-7 depend upon #1, perhaps?

If so, then one approach would be to merge the first patch into mainline now then trickle the rest out into subsystem trees.

Or, with suitable acks, I can merge the lot. Perhaps into 2.6.29..

author
#10 lore raw
Quoted 22 lines · Andrew Morton
Quoted 9 lines · On Mon, 05 Jan 2009 23:42:42 +0530 Balaji Rao <[email protected]> wrote:

The following series implements support for NXP PCF50633. It's basically an I2C device with 9 regulators, an ADC, a PMIC, a Battery Charger and a RTC.

This chip is used in Openmoko Neo Freerunner mobile phone.

The specs are open and are available at
http://people.openmoko.org/tony_tu/GTA02/datasheet/PMU/PCF50633DS_02.pdf

Quoted 9 lines

---
Balaji Rao (7):
mfd: PCF50633 core driver
mfd: PCF50633 adc driver
mfd: PCF50633 gpio support
rtc: PCF50633 rtc driver
power_supply: PCF50633 battery charger driver
input: PCF50633 input driver
regulator: PCF50633 pmic driver

Quoted 6 lines

You have patches here which should strictly be merged by various different subsystem trees. That gets tricky because presumably there are dependencies.

What _are_ the dependencies here? Do patches 2-7 depend upon #1, perhaps?

yes, patches 2-7 depend on the first one.

Quoted 5 lines

If so, then one approach would be to merge the first patch into mainline now then trickle the rest out into subsystem trees.

Or, with suitable acks, I can merge the lot. Perhaps into 2.6.29..

Andrew,

Samuel had sent a git-pull for the linux-mfd tree containing this series a couple of days ago and now I see that it's merged. So, I think you can remove these from -mm.

Thanks,
Balaji