Re: [PATCH 1/2] mfd: Core support for the WM8400 AudioPlus HiFi CODEC and PMU

Previous thread: [PATCH] vfs: added better file aio_read aio_write operations presence check by Marco Stornelli on Tuesday, September 16, 2008 - 2:29 am. (5 messages)

Next thread: wdt285: fix sparse warnings by Ben Dooks on Tuesday, September 16, 2008 - 3:31 am. (1 message)
From: Mark Brown
Date: Tuesday, September 16, 2008 - 2:42 am

These patches against the regulator development tree add basic support
for the WM8400, an audio CODEC and PMU targeted at multimedia systems,
covering basic PMIC functionality only.  Since the functionality of the
device covers multiple subsystems with arbitration required a core
driver is provided in drivers/mfd.

I think I've covered all the issues raised last time, erring on the side
of split headers rather than unifying them, details in the individual
patches.

The following changes since commit fa83aec82558c7d5822c47e52db3f1f6b104a930:
  Liam Girdwood (1):
        maintainers: update email address for Liam Girdwood

are available in the git repository at:

  git://opensource.wolfsonmicro.com/linux-2.6-audioplus for-lrg

Mark Brown (2):
      mfd: Core support for the WM8400 AudioPlus HiFi CODEC and PMU
      regulator: Add WM8400 regulator support

 drivers/mfd/Kconfig                  |    8 +
 drivers/mfd/Makefile                 |    2 +
 drivers/mfd/wm8400-core.c            |  457 +++++++++++++
 drivers/regulator/Kconfig            |    8 +-
 drivers/regulator/Makefile           |    1 +
 drivers/regulator/wm8400-regulator.c |  367 +++++++++++
 include/linux/mfd/wm8400-audio.h     | 1186 ++++++++++++++++++++++++++++++++++
 include/linux/mfd/wm8400-private.h   |  936 +++++++++++++++++++++++++++
 include/linux/mfd/wm8400.h           |   40 ++
 9 files changed, 3004 insertions(+), 1 deletions(-)
 create mode 100644 drivers/mfd/wm8400-core.c
 create mode 100644 drivers/regulator/wm8400-regulator.c
 create mode 100644 include/linux/mfd/wm8400-audio.h
 create mode 100644 include/linux/mfd/wm8400-private.h
 create mode 100644 include/linux/mfd/wm8400.h
--

From: Mark Brown
Date: Tuesday, September 16, 2008 - 2:43 am

The WM8400 is a highly integrated audio CODEC and power management unit
optimised for use in mobile multimedia applications.  This patch adds
core support for the WM8400 to the MFD subsystem.

Both I2C and SPI access are supported by the hardware but currently only
I2C access is implemented.  The code is structured to allow SPI support
to be slotted in later.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
Changes since last time:
 - Don't depend on MFD_CORE, we don't use it.
 - Change name of codec reset function to _reset_codec_reg_cache() for
   clarity.
 - Split out audio registers into a separate header half the size.

 drivers/mfd/Kconfig                |    8 +
 drivers/mfd/Makefile               |    2 +
 drivers/mfd/wm8400-core.c          |  457 ++++++++++++++
 include/linux/mfd/wm8400-audio.h   | 1186 ++++++++++++++++++++++++++++++++++++
 include/linux/mfd/wm8400-private.h |  935 ++++++++++++++++++++++++++++
 5 files changed, 2588 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mfd/wm8400-core.c
 create mode 100644 include/linux/mfd/wm8400-audio.h
 create mode 100644 include/linux/mfd/wm8400-private.h

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 10c44d3..0541dfb 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -78,6 +78,14 @@ config MFD_TC6393XB
 	help
 	  Support for Toshiba Mobile IO Controller TC6393XB
 
+config MFD_WM8400
+	tristate "Support Wolfson Microelectronics WM8400"
+	help
+	  Support for the Wolfson Microelecronics WM8400 PMIC and audio
+	  CODEC.  This driver adds provides common support for accessing
+	  the device, additional drivers must be enabled in order to use
+	  the functionality of the device.
+
 endmenu
 
 menu "Multimedia Capabilities Port drivers"
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 03ad239..172439d 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -12,6 +12,8 @@ obj-$(CONFIG_MFD_T7L66XB)	+= t7l66xb.o
 ...
From: Mark Brown
Date: Tuesday, September 16, 2008 - 2:43 am

The WM8400 provides two programmable DCDC step-down (buck) convertors
and four low-dropout (LDO) regulators. This driver provides support for
runtime managment of these in the standard regulator API.

Support for configuration of the suspend and hibernate mode behaviour
of the regulators is not yet included.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
Changes since last time:
 - Report that the optimum mode is REGULATOR_MODE_NORMAL rather than
   _IDLE.

 drivers/regulator/Kconfig            |    8 +-
 drivers/regulator/Makefile           |    1 +
 drivers/regulator/wm8400-regulator.c |  367 ++++++++++++++++++++++++++++++++++
 include/linux/mfd/wm8400-private.h   |    1 +
 include/linux/mfd/wm8400.h           |   40 ++++
 5 files changed, 416 insertions(+), 1 deletions(-)
 create mode 100644 drivers/regulator/wm8400-regulator.c
 create mode 100644 include/linux/mfd/wm8400.h

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index a656128..442800e 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -56,4 +56,10 @@ config REGULATOR_BQ24022
 	  charging select between 100 mA and 500 mA charging current
 	  limit.
 
-endmenu
+config REGULATOR_WM8400
+	tristate "Wolfson Microelectroncis WM8400 AudioPlus PMIC"
+	depends on MFD_WM8400
+	select REGULATOR
+	help
+	  This driver provides support for the voltage regulators of the
+	  WM8400 AudioPlus PMIC.
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index ac2c64e..3c6ac73 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -8,5 +8,6 @@ obj-$(CONFIG_REGULATOR_FIXED_VOLTAGE) += fixed.o
 obj-$(CONFIG_REGULATOR_VIRTUAL_CONSUMER) += virtual.o
 
 obj-$(CONFIG_REGULATOR_BQ24022) += bq24022.o
+obj-$(CONFIG_REGULATOR_WM8400) += wm8400-regulator.o
 
 ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG
diff --git a/drivers/regulator/wm8400-regulator.c b/drivers/regulator/wm8400-regulator.c
new file mode 100644
index ...
From: Andrew Morton
Date: Wednesday, September 17, 2008 - 7:28 pm

hm, checkpatch chews a couple minutes CPU time then misses this error.

static struct {


} reg_data[] = {



Is CONFIG_I2C=n worth supporting?  Is anyone likely to test and

Always freaks me out to see read/write methods returning `int' instead


This patch adds an amazing 1733 #defines, of which only a few
percent are used.  Oh well.

--

From: Mark Brown
Date: Thursday, September 18, 2008 - 3:29 am

Thanks.  Liam, I've just pushed out a version of the series fixing the




I doubt it but once you get on to multi-line operations in the middle of
the lock (which some of the other functions do) I find it much clearer

Right now it's silly to build the driver without I2C but once I push in
the SPI support for the device it's likely that some systems will want
to use the driver with I2C built out for the space saving.  I do intend
to support users doing that.

As far as test coverage goes it shouldn't make much difference if I2C is
built or not when the device is accessed via SPI - the I2C support will


No, the cache is stored in CPU format.  In normal operation reads are

Yeah, we have a program which generates these #defines from data
extracted from the chip definition.  If it helps rather more (but most
likely not half) of them will be used once the remaining drivers for the
chip are pushed.  The current driver only covers a small proportion of
the functionality of the device.
--

From: Samuel Ortiz
Date: Monday, September 22, 2008 - 11:33 am

Hi Mark,

If it's not too late:
Acked-by: Samuel Ortiz <sameo@openedhand.com>

Cheers,
> +#define WM8400_RMP4_WIDTH                 
From: Liam Girdwood
Date: Monday, September 22, 2008 - 5:27 pm

It isn't :)

Thanks. Will pull & push to voltage tree.

Liam

--

Previous thread: [PATCH] vfs: added better file aio_read aio_write operations presence check by Marco Stornelli on Tuesday, September 16, 2008 - 2:29 am. (5 messages)

Next thread: wdt285: fix sparse warnings by Ben Dooks on Tuesday, September 16, 2008 - 3:31 am. (1 message)