[PATCH] Mfd: Initial support for Texas Instruments AIC family of CODECs

2012-12-12 Thread Mehar Bajwa
Initial support for TI's AIC platform and TLV320AIC3262 CODEC device.

The AIC platform provides common interface to series of low power audio CODECS.
This MFD core driver instantiates subdevices that help in supporting range of 
features
provided by AIC family of devices.

Signed-off-by: Mehar Bajwa 
---
 drivers/mfd/Kconfig |   41 +++
 drivers/mfd/Makefile|3 +
 drivers/mfd/tlv320aic3xxx-core.c|  462 +++
 drivers/mfd/tlv320aic3xxx-i2c.c |   97 ++
 drivers/mfd/tlv320aic3xxx-irq.c |  234 ++
 drivers/mfd/tlv320aic3xxx-spi.c |   96 ++
 include/linux/mfd/tlv320aic3262-registers.h |  312 ++
 include/linux/mfd/tlv320aic3xxx-core.h  |  153 +
 include/linux/mfd/tlv320aic3xxx-registers.h |   75 +
 9 files changed, 1473 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mfd/tlv320aic3xxx-core.c
 create mode 100644 drivers/mfd/tlv320aic3xxx-i2c.c
 create mode 100644 drivers/mfd/tlv320aic3xxx-irq.c
 create mode 100644 drivers/mfd/tlv320aic3xxx-spi.c
 create mode 100644 include/linux/mfd/tlv320aic3262-registers.h
 create mode 100644 include/linux/mfd/tlv320aic3xxx-core.h
 create mode 100644 include/linux/mfd/tlv320aic3xxx-registers.h

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 50bbe88..2ecfbad 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -45,6 +45,47 @@ config MFD_88PM805
  components like codec device, headset/Mic device under the
  corresponding menus.
 
+config MFD_AIC3XXX
+   bool "Support for AIC3XXX"
+   select REGMAP
+   select MFD_CORE
+   help
+ Say yes here if you want support for Texas Instruments AIC audio
+ codec.
+ You have to select individual I2C or SPI depending on
+ AIC3XXX interfacing with platform.
+
+config MFD_AIC3XXX_I2C
+   bool "Support Texas Instruments AIC3XXX platform with I2C"
+   select MFD_AIC3XXX
+   select REGMAP_I2C
+   depends on I2C
+   help
+ Support for the Texas Instruments TLV320AIC3XXX family of audio SoC
+ core functionality controlled via 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 MFD_AIC3XXX_SPI
+   bool "Support Texas Instruments AIC3XXX  platform with SPI"
+   select MFD_AIC3XXX
+   select REGMAP_SPI
+   depends on SPI_MASTER
+   help
+ Support for the Texas Instruments TLV320AIC3XXX family of audio SoC
+ core functionality controlled via 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_AIC3262
+   bool "Support Texas Instruments AIC3262"
+   depends on MFD_AIC3XXX
+   help
+ If you say yes here you will get support for Texas Instrument
+ TLV320AIC3262 low power audio SoC.
+ Addition driver must be enabled to use this in order to use
+ functionality on device.
+
 config MFD_SM501
tristate "Support for Silicon Motion SM501"
 ---help---
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index f2216df..8c97872 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -6,6 +6,9 @@
 obj-$(CONFIG_MFD_88PM860X) += 88pm860x.o
 obj-$(CONFIG_MFD_88PM800)  += 88pm800.o 88pm80x.o
 obj-$(CONFIG_MFD_88PM805)  += 88pm805.o 88pm80x.o
+obj-$(CONFIG_MFD_AIC3XXX)  += tlv320aic3xxx-core.o tlv320aic3xxx-irq.o
+obj-$(CONFIG_MFD_AIC3XXX_I2C)  += tlv320aic3xxx-i2c.o
+obj-$(CONFIG_MFD_AIC3XXX_SPI)  += tlv320aic3xxx-spi.o
 obj-$(CONFIG_MFD_SM501)+= sm501.o
 obj-$(CONFIG_MFD_ASIC3)+= asic3.o tmio_core.o
 
diff --git a/drivers/mfd/tlv320aic3xxx-core.c b/drivers/mfd/tlv320aic3xxx-core.c
new file mode 100644
index 000..6fd151b
--- /dev/null
+++ b/drivers/mfd/tlv320aic3xxx-core.c
@@ -0,0 +1,462 @@
+/*
+ * tlv320aic3xxx-core.c  -- driver for TLV320AIC3XXX
+ *
+ * Author:  Mukund Navada 
+ *  Mehar Bajwa 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 

[PATCH] Mfd: Initial support for Texas Instruments AIC family of CODECs

2012-12-12 Thread Mehar Bajwa
Initial support for TI's AIC platform and TLV320AIC3262 CODEC device.

The AIC platform provides common interface to series of low power audio CODECS.
This MFD core driver instantiates subdevices that help in supporting range of 
features
provided by AIC family of devices.

Signed-off-by: Mehar Bajwa mehar.ba...@ti.com
---
 drivers/mfd/Kconfig |   41 +++
 drivers/mfd/Makefile|3 +
 drivers/mfd/tlv320aic3xxx-core.c|  462 +++
 drivers/mfd/tlv320aic3xxx-i2c.c |   97 ++
 drivers/mfd/tlv320aic3xxx-irq.c |  234 ++
 drivers/mfd/tlv320aic3xxx-spi.c |   96 ++
 include/linux/mfd/tlv320aic3262-registers.h |  312 ++
 include/linux/mfd/tlv320aic3xxx-core.h  |  153 +
 include/linux/mfd/tlv320aic3xxx-registers.h |   75 +
 9 files changed, 1473 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mfd/tlv320aic3xxx-core.c
 create mode 100644 drivers/mfd/tlv320aic3xxx-i2c.c
 create mode 100644 drivers/mfd/tlv320aic3xxx-irq.c
 create mode 100644 drivers/mfd/tlv320aic3xxx-spi.c
 create mode 100644 include/linux/mfd/tlv320aic3262-registers.h
 create mode 100644 include/linux/mfd/tlv320aic3xxx-core.h
 create mode 100644 include/linux/mfd/tlv320aic3xxx-registers.h

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 50bbe88..2ecfbad 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -45,6 +45,47 @@ config MFD_88PM805
  components like codec device, headset/Mic device under the
  corresponding menus.
 
+config MFD_AIC3XXX
+   bool Support for AIC3XXX
+   select REGMAP
+   select MFD_CORE
+   help
+ Say yes here if you want support for Texas Instruments AIC audio
+ codec.
+ You have to select individual I2C or SPI depending on
+ AIC3XXX interfacing with platform.
+
+config MFD_AIC3XXX_I2C
+   bool Support Texas Instruments AIC3XXX platform with I2C
+   select MFD_AIC3XXX
+   select REGMAP_I2C
+   depends on I2C
+   help
+ Support for the Texas Instruments TLV320AIC3XXX family of audio SoC
+ core functionality controlled via 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 MFD_AIC3XXX_SPI
+   bool Support Texas Instruments AIC3XXX  platform with SPI
+   select MFD_AIC3XXX
+   select REGMAP_SPI
+   depends on SPI_MASTER
+   help
+ Support for the Texas Instruments TLV320AIC3XXX family of audio SoC
+ core functionality controlled via 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_AIC3262
+   bool Support Texas Instruments AIC3262
+   depends on MFD_AIC3XXX
+   help
+ If you say yes here you will get support for Texas Instrument
+ TLV320AIC3262 low power audio SoC.
+ Addition driver must be enabled to use this in order to use
+ functionality on device.
+
 config MFD_SM501
tristate Support for Silicon Motion SM501
 ---help---
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index f2216df..8c97872 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -6,6 +6,9 @@
 obj-$(CONFIG_MFD_88PM860X) += 88pm860x.o
 obj-$(CONFIG_MFD_88PM800)  += 88pm800.o 88pm80x.o
 obj-$(CONFIG_MFD_88PM805)  += 88pm805.o 88pm80x.o
+obj-$(CONFIG_MFD_AIC3XXX)  += tlv320aic3xxx-core.o tlv320aic3xxx-irq.o
+obj-$(CONFIG_MFD_AIC3XXX_I2C)  += tlv320aic3xxx-i2c.o
+obj-$(CONFIG_MFD_AIC3XXX_SPI)  += tlv320aic3xxx-spi.o
 obj-$(CONFIG_MFD_SM501)+= sm501.o
 obj-$(CONFIG_MFD_ASIC3)+= asic3.o tmio_core.o
 
diff --git a/drivers/mfd/tlv320aic3xxx-core.c b/drivers/mfd/tlv320aic3xxx-core.c
new file mode 100644
index 000..6fd151b
--- /dev/null
+++ b/drivers/mfd/tlv320aic3xxx-core.c
@@ -0,0 +1,462 @@
+/*
+ * tlv320aic3xxx-core.c  -- driver for TLV320AIC3XXX
+ *
+ * Author:  Mukund Navada nav...@ti.com
+ *  Mehar Bajwa mehar.ba...@ti.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+#include linux/kernel.h
+#include