Re: [PATCH 13/16] ARM: omap: move platform_data definitions

2012-09-18 Thread Peter Ujfalusi
Hi Arnd,

On 09/12/2012 08:20 PM, Arnd Bergmann wrote:
 On Tuesday 11 September 2012, Peter Ujfalusi wrote:
 OMAP McBSP has nothing to do with a dsp.
 A better name would be: ti-mcbsp.h (or leave it as mcbsp.h)
 McBSP stands for: Multichannel Buffered Serial Port and it is used for audio
 connection (I2S, TDM, etc).
 
 changed to asoc-ti-mcbsp.h to, as discussed.
 
  .../include/plat/dsp.h = include/linux/platform_data/dsp-omap.h   |0
  .../plat/keypad.h = include/linux/platform_data/keypad-omap.h |0
  .../plat/lcd_mipid.h = include/linux/platform_data/lcd-mipid.h|0
  .../plat/nand.h = include/linux/platform_data/mtd-nand-omap2.h|0
  .../onenand.h = include/linux/platform_data/mtd-onenand-omap2.h   |0
  .../remoteproc.h = include/linux/platform_data/remoteproc-omap.h  |0
  .../voltage.h = include/linux/platform_data/smartreflex-omap.h|0
  .../plat/mcspi.h = include/linux/platform_data/spi-omap2-mcspi.h  |0
  include/linux/power/smartreflex.h  |2 
 +-

 Let me see these:

 This four drivers are going to be removed via sound tree.
  sound/soc/omap/igep0020.c  |2 
 +-
  sound/soc/omap/omap3beagle.c   |2 
 +-
  sound/soc/omap/omap3evm.c  |2 
 +-
  sound/soc/omap/overo.c |2 
 +-

 The new driver which replaces these (omap-twl4030.c) does not include
 plat/mcbsp.h
 
 For the sake of bisection, I think we should leave the patch as is.
 When merging the two branches, we will get a small conflict that
 is trivial to resolve.
 
 From these ASoC machine drivers you can just remove the plat/mcbsp.h
 include since they should not include them (I have pending patch for this to
 be sent):
  sound/soc/omap/am3517evm.c |2 
 +-
  sound/soc/omap/ams-delta.c |2 
 +-
  sound/soc/omap/n810.c  |2 
 +-
  sound/soc/omap/omap3pandora.c  |2 
 +-
  sound/soc/omap/osk5912.c   |2 
 +-
  sound/soc/omap/rx51.c  |2 
 +-
  sound/soc/omap/sdp3430.c   |2 
 +-
  sound/soc/omap/zoom2.c |2 
 +-

  sound/soc/omap/omap-mcbsp.c|2 
 +-
  sound/soc/omap/mcbsp.c |2 
 +-
 
 Can you do that change on top of mine? I would prefer to leave it as is
 because I could create this version with a script.
 
 The alternative is that I leave the mcbsp.h file alone entirely and you
 submit a patch to fix all instances where it's used, either rename or
 remove them.

I thought I have replied to this...
Whichever way you prefer. I can craft a series to clean up the plat/mcbsp.h
usage and move the mcbsp header via ASoC tree.
I'm also fine if you do the move.
Let me know what you prefer.

Thanks,
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 00/14] MFD/ASoC/Input: twl4030-audio submodule DT support

2012-09-19 Thread Peter Ujfalusi
Hi Samuel,

On 09/19/2012 03:24 AM, Samuel Ortiz wrote:
 Hi Peter,
 
 On Mon, Sep 10, 2012 at 01:46:18PM +0300, Peter Ujfalusi wrote:
 Hello,

 Generated on top of:
 git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git topic/omap
 I applied the first 8 patches, but I'd like to get Mark's ACK for the rest of
 the serie.
 Unless you're expecting Mark to take the whole thing, in which case you can
 add my:
 
 Acked-by: Samuel Ortiz sa...@linux.intel.com
 
 to the MFD patches.
 Please let me know how you'd like to proceed.

If Mark is still OK with it I think it would be better to queue this series
via ASoC so we can keep them in one place (also I think patch 14 needs patch 6
in order to not break x86/x86_64 allmodconfig).
On the other hand if they go separately (1-8 via MFD, 9-14 via ASoC) they will
meet in linux-next where this matters the most.

Thank you,
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] ARM/dts: OMAP4: Enable twl6040 GPO functionality

2012-09-19 Thread Peter Ujfalusi
Hello,

The following two patch is needed for the twl6040 GPO driver (going via MFD
tree) to work correctly.

Regards,
Peter
---
Peter Ujfalusi (2):
  ARM/dts: omap4-sdp: Enable GPO functionality for twl6040
  ARM/dts: omap4-panda: Enable GPO functionality for twl6040

 arch/arm/boot/dts/omap4-panda.dts | 3 +++
 arch/arm/boot/dts/omap4-sdp.dts   | 3 +++
 2 files changed, 6 insertions(+)

-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] ARM/dts: omap4-sdp: Enable GPO functionality for twl6040

2012-09-19 Thread Peter Ujfalusi
Add the needed properties for twl6040 so the GPO functionality can be used
by other drivers.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/boot/dts/omap4-sdp.dts | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index 94a23b3..2c4fc1e 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -155,6 +155,9 @@
 
twl6040: twl@4b {
compatible = ti,twl6040;
+   gpio-controller;
+   #gpio-cells = 1;
+
reg = 0x4b;
/* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */
interrupts = 0 119 4; /* IRQ_SYS_2N cascaded to gic */
-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] ARM/dts: omap4-panda: Enable GPO functionality for twl6040

2012-09-19 Thread Peter Ujfalusi
Add the needed properties for twl6040 so the GPO functionality can be used
by other drivers.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/boot/dts/omap4-panda.dts | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boot/dts/omap4-panda.dts 
b/arch/arm/boot/dts/omap4-panda.dts
index 20b966e..94adabb 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -71,6 +71,9 @@
 
twl6040: twl@4b {
compatible = ti,twl6040;
+   gpio-controller;
+   #gpio-cells = 1;
+
reg = 0x4b;
/* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */
interrupts = 0 119 4; /* IRQ_SYS_2N cascaded to gic */
-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 08/29] ARM: OMAP2+: Make board-zoom.h local

2012-09-20 Thread Peter Ujfalusi
Hi Tony,


On 09/20/2012 12:05 AM, Tony Lindgren wrote:
 This can be local to mach-omap2 after we rip out the messed up
 extmute stuff from board-zoom-peripherals.c that's all over
 the place and probably does not even work because of all the
 hardcoded GPIO numbers.
 
 I also suggest ASoC gusy remove all extmute handling from
 sound/soc/codecs/twl4030.c unless it's been tested to work
 and implemented in a saner way.

I just wanted to note that I also have pending patch for zoom2.c as part of
the twl4030 audio module DT support series:
http://lkml.indiana.edu/hypermail/linux/kernel/1209.1/00711.html


 
 Cc: Peter Ujfalusi peter.ujfal...@ti.com
 Cc: Jarkko Nikula jarkko.nik...@bitmer.com
 Cc: Liam Girdwood l...@ti.com
 Cc: Mark Brown broo...@opensource.wolfsonmicro.com
 Cc: alsa-de...@alsa-project.org
 Signed-off-by: Tony Lindgren t...@atomide.com
 ---
  arch/arm/mach-omap2/board-3630sdp.c   |2 +-
  arch/arm/mach-omap2/board-ldp.c   |2 +-
  arch/arm/mach-omap2/board-zoom-debugboard.c   |2 +-
  arch/arm/mach-omap2/board-zoom-display.c  |2 +-
  arch/arm/mach-omap2/board-zoom-peripherals.c  |   16 +---
  arch/arm/mach-omap2/board-zoom.c  |2 +-
  arch/arm/mach-omap2/board-zoom.h  |0 
  sound/soc/omap/zoom2.c|2 +-
  8 files changed, 7 insertions(+), 21 deletions(-)
  rename arch/arm/mach-omap2/{include/mach/board-zoom.h = board-zoom.h} (100%)
 
 diff --git a/arch/arm/mach-omap2/board-3630sdp.c 
 b/arch/arm/mach-omap2/board-3630sdp.c
 index 8518b13..c7d6ea2 100644
 --- a/arch/arm/mach-omap2/board-3630sdp.c
 +++ b/arch/arm/mach-omap2/board-3630sdp.c
 @@ -20,7 +20,7 @@
  #include plat/gpmc-smc91x.h
  #include plat/usb.h
  
 -#include mach/board-zoom.h
 +#include board-zoom.h
  
  #include board-flash.h
  #include mux.h
 diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
 index 3f3a552..d0372a6 100644
 --- a/arch/arm/mach-omap2/board-ldp.c
 +++ b/arch/arm/mach-omap2/board-ldp.c
 @@ -36,7 +36,7 @@
  #include plat/mcspi.h
  #include common.h
  #include plat/gpmc.h
 -#include mach/board-zoom.h
 +#include board-zoom.h
  #include plat/usb.h
  #include plat/gpmc-smsc911x.h
  
 diff --git a/arch/arm/mach-omap2/board-zoom-debugboard.c 
 b/arch/arm/mach-omap2/board-zoom-debugboard.c
 index 0d8d919..42c97c2 100644
 --- a/arch/arm/mach-omap2/board-zoom-debugboard.c
 +++ b/arch/arm/mach-omap2/board-zoom-debugboard.c
 @@ -20,7 +20,7 @@
  #include plat/gpmc.h
  #include plat/gpmc-smsc911x.h
  
 -#include mach/board-zoom.h
 +#include board-zoom.h
  
  #include soc.h
  #include common.h
 diff --git a/arch/arm/mach-omap2/board-zoom-display.c 
 b/arch/arm/mach-omap2/board-zoom-display.c
 index ea79bc2..6a162fb 100644
 --- a/arch/arm/mach-omap2/board-zoom-display.c
 +++ b/arch/arm/mach-omap2/board-zoom-display.c
 @@ -16,7 +16,7 @@
  #include linux/spi/spi.h
  #include plat/mcspi.h
  #include video/omapdss.h
 -#include mach/board-zoom.h
 +#include board-zoom.h
  
  #include common.h
  
 diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c 
 b/arch/arm/mach-omap2/board-zoom-peripherals.c
 index 6bcc107..c8377b71 100644
 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c
 +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
 @@ -28,7 +28,7 @@
  #include common.h
  #include plat/usb.h
  
 -#include mach/board-zoom.h
 +#include board-zoom.h
  
  #include mux.h
  #include hsmmc.h
 @@ -245,12 +245,6 @@ static int zoom_twl_gpio_setup(struct device *dev,
   return ret;
  }
  
 -/* EXTMUTE callback function */
 -static void zoom2_set_hs_extmute(int mute)
 -{
 - gpio_set_value(ZOOM2_HEADSET_EXTMUTE_GPIO, mute);
 -}
 -
  static struct twl4030_gpio_platform_data zoom_gpio_data = {
   .setup  = zoom_twl_gpio_setup,
  };
 @@ -271,14 +265,6 @@ static int __init omap_i2c_init(void)
   TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO,
   TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
  
 - if (machine_is_omap_zoom2()) {
 - struct twl4030_codec_data *codec_data;
 - codec_data = zoom_twldata.audio-codec;
 -
 - codec_data-ramp_delay_value = 3;   /* 161 ms */
 - codec_data-hs_extmute = 1;
 - codec_data-set_hs_extmute = zoom2_set_hs_extmute;
 - }
   omap_pmic_init(1, 2400, twl5030, 7 + OMAP_INTC_START, zoom_twldata);
   omap_register_i2c_bus(2, 400, NULL, 0);
   omap_register_i2c_bus(3, 400, NULL, 0);
 diff --git a/arch/arm/mach-omap2/board-zoom.c 
 b/arch/arm/mach-omap2/board-zoom.c
 index 4994438..cbfd9df 100644
 --- a/arch/arm/mach-omap2/board-zoom.c
 +++ b/arch/arm/mach-omap2/board-zoom.c
 @@ -24,7 +24,7 @@
  #include common.h
  #include plat/usb.h
  
 -#include mach/board-zoom.h
 +#include board-zoom.h
  
  #include board-flash.h
  #include mux.h
 diff --git a/arch/arm/mach-omap2/include/mach/board-zoom.h 
 b/arch/arm/mach-omap2/board-zoom.h
 similarity index

Re: [PATCH 2/3] OMAP i2c: pinctrl-ify i2c-omap.c

2012-09-21 Thread Peter Ujfalusi
On 09/19/2012 07:07 PM, Pantelis Antoniou wrote:
 Add support for pinctrl mux settings in the OMAP I2C driver.
 If no such pinctl bindings are found a warning message is printed.
 
 Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com
 ---
  drivers/i2c/busses/i2c-omap.c | 7 +++
  1 file changed, 7 insertions(+)
 
 diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
 index b149e32..f722478 100644
 --- a/drivers/i2c/busses/i2c-omap.c
 +++ b/drivers/i2c/busses/i2c-omap.c
 @@ -43,6 +43,8 @@
  #include linux/slab.h
  #include linux/i2c-omap.h
  #include linux/pm_runtime.h
 +#include linux/pinctrl/consumer.h
 +#include linux/err.h
  
  /* I2C controller revisions */
  #define OMAP_I2C_OMAP1_REV_2 0x20
 @@ -1057,6 +1059,7 @@ omap_i2c_probe(struct platform_device *pdev)
   const struct of_device_id *match;
   int irq;
   int r;
 + struct pinctrl *pinctrl;
  
   /* NOTE: driver uses the static register mapping */
   mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 @@ -1197,6 +1200,10 @@ omap_i2c_probe(struct platform_device *pdev)
  
   of_i2c_register_devices(adap);
  
 + pinctrl = devm_pinctrl_get_select_default(pdev-dev);
 + if (IS_ERR(pinctrl))
 + dev_warn(dev-dev, pins are not configured from the driver\n);

Can you use pdev-dev for the dev_warn() here?
the dev-dev is quite confusing especially since you used pdev-dev for the
pinctrl call.

 +
   pm_runtime_mark_last_busy(dev-dev);
   pm_runtime_put_autosuspend(dev-dev);
  
 


-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3] ARM: OMAP4: twl-common: Support for additional devices on i2c1 bus

2012-09-24 Thread Peter Ujfalusi
On OMAP4 the i2c1 bus is dedicated for the PMIC and audio related devices.
Manufacturers can opt to use different codec than twl6040 and also can add
audio related IC to the bus (external amplifier for example on SDP4430).

Make it possible to add different set of additional devices to i2c1 bus on
OMAP4 boards.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
Hi Tony,

I have refreshed the patch on top of arm-soc/for-next branch. Would it be
possible to queue this patch via arm-soc so it will be in 3.7-rc1 already?
Originally this patch was sent for 3.6...

Regards,
Peter

 arch/arm/mach-omap2/board-4430sdp.c| 12 +--
 arch/arm/mach-omap2/board-omap4panda.c | 12 +--
 arch/arm/mach-omap2/twl-common.c   | 37 ++
 arch/arm/mach-omap2/twl-common.h   |  3 ++-
 4 files changed, 33 insertions(+), 31 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index 6fe9079..7c1a662 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -545,6 +545,14 @@ static struct twl6040_platform_data twl6040_data = {
.audpwron_gpio  = 127,
 };
 
+static struct i2c_board_info __initdata sdp4430_i2c_1_boardinfo[] = {
+   {
+   I2C_BOARD_INFO(twl6040, 0x4b),
+   .irq = OMAP44XX_IRQ_SYS_2N,
+   .platform_data = twl6040_data,
+   },
+};
+
 static struct twl4030_platform_data sdp4430_twldata = {
/* Regulators */
.vusim  = sdp4430_vusim,
@@ -578,8 +586,8 @@ static int __init omap4_i2c_init(void)
TWL_COMMON_REGULATOR_CLK32KG |
TWL_COMMON_REGULATOR_V1V8 |
TWL_COMMON_REGULATOR_V2V1);
-   omap4_pmic_init(twl6030, sdp4430_twldata,
-   twl6040_data, 119 + OMAP44XX_IRQ_GIC_START);
+   omap4_pmic_init(twl6030, sdp4430_twldata, sdp4430_i2c_1_boardinfo,
+   ARRAY_SIZE(sdp4430_i2c_1_boardinfo));
omap_register_i2c_bus(2, 400, NULL, 0);
omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
ARRAY_SIZE(sdp4430_i2c_3_boardinfo));
diff --git a/arch/arm/mach-omap2/board-omap4panda.c 
b/arch/arm/mach-omap2/board-omap4panda.c
index 8ebb16c..eb7a9a8 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -264,6 +264,14 @@ static struct twl6040_platform_data twl6040_data = {
.audpwron_gpio  = 127,
 };
 
+static struct i2c_board_info __initdata panda_i2c_1_boardinfo[] = {
+   {
+   I2C_BOARD_INFO(twl6040, 0x4b),
+   .irq = OMAP44XX_IRQ_SYS_2N,
+   .platform_data = twl6040_data,
+   },
+};
+
 /* Panda board uses the common PMIC configuration */
 static struct twl4030_platform_data omap4_panda_twldata;
 
@@ -291,8 +299,8 @@ static int __init omap4_panda_i2c_init(void)
TWL_COMMON_REGULATOR_CLK32KG |
TWL_COMMON_REGULATOR_V1V8 |
TWL_COMMON_REGULATOR_V2V1);
-   omap4_pmic_init(twl6030, omap4_panda_twldata,
-   twl6040_data, 119 + OMAP44XX_IRQ_GIC_START);
+   omap4_pmic_init(twl6030, omap4_panda_twldata, panda_i2c_1_boardinfo,
+   ARRAY_SIZE(panda_i2c_1_boardinfo));
omap_register_i2c_bus(2, 400, NULL, 0);
/*
 * Bus 3 is attached to the DVI port where devices like the pico DLP
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index 040f480..e279732 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -40,16 +40,6 @@ static struct i2c_board_info __initdata pmic_i2c_board_info 
= {
.flags  = I2C_CLIENT_WAKE,
 };
 
-static struct i2c_board_info __initdata omap4_i2c1_board_info[] = {
-   {
-   .addr   = 0x48,
-   .flags  = I2C_CLIENT_WAKE,
-   },
-   {
-   I2C_BOARD_INFO(twl6040, 0x4b),
-   },
-};
-
 #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
 static int twl_set_voltage(void *data, int target_uV)
 {
@@ -79,30 +69,25 @@ void __init omap_pmic_init(int bus, u32 clkrate,
 
 void __init omap4_pmic_init(const char *pmic_type,
struct twl4030_platform_data *pmic_data,
-   struct twl6040_platform_data *twl6040_data, int twl6040_irq)
+   struct i2c_board_info *devices, int nr_devices)
 {
/* PMIC part*/
omap_mux_init_signal(sys_nirq1, OMAP_PIN_INPUT_PULLUP | 
OMAP_PIN_OFF_WAKEUPENABLE);
-   strncpy(omap4_i2c1_board_info[0].type, pmic_type,
-   sizeof(omap4_i2c1_board_info[0].type));
-   omap4_i2c1_board_info[0].irq = 7 + OMAP44XX_IRQ_GIC_START;
-   omap4_i2c1_board_info[0].platform_data = pmic_data;
-
-   /* TWL6040 audio IC part */
-   omap4_i2c1_board_info[1].irq = twl6040_irq

Re: [PATCH v3] ARM: OMAP4: twl-common: Support for additional devices on i2c1 bus

2012-09-25 Thread Peter Ujfalusi
Hi Tony,

On 09/24/2012 08:34 PM, Tony Lindgren wrote:
 * Tony Lindgren t...@atomide.com [120924 08:44]:
 * Peter Ujfalusi peter.ujfal...@ti.com [120924 02:24]:
 On OMAP4 the i2c1 bus is dedicated for the PMIC and audio related devices.
 Manufacturers can opt to use different codec than twl6040 and also can add
 audio related IC to the bus (external amplifier for example on SDP4430).

 Make it possible to add different set of additional devices to i2c1 bus on
 OMAP4 boards.

 Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
 ---
 Hi Tony,

 I have refreshed the patch on top of arm-soc/for-next branch. Would it be
 possible to queue this patch via arm-soc so it will be in 3.7-rc1 already?
 Originally this patch was sent for 3.6...

 Yes sorry the platform code has been been badly ignored
 lately.. Let's see if we can still get it in now that there's
 -rc7 tagged.
 
 I've updated this for the sparse IRQ changes that remove irqs.h.
 Updated patch below.

Looks good to me.

Thank you,
Péter

 
 Tony
 
 
 From: Peter Ujfalusi peter.ujfal...@ti.com
 Date: Mon, 24 Sep 2012 12:24:48 +0300
 Subject: [PATCH] ARM: OMAP4: twl-common: Support for additional devices on
  i2c1 bus
 
 On OMAP4 the i2c1 bus is dedicated for the PMIC and audio related devices.
 Manufacturers can opt to use different codec than twl6040 and also can add
 audio related IC to the bus (external amplifier for example on SDP4430).
 
 Make it possible to add different set of additional devices to i2c1 bus on
 OMAP4 boards.
 
 Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
 [t...@atomide.com: updated for removal of irqs.h]
 Signed-off-by: Tony Lindgren t...@atomide.com
 
 diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
 b/arch/arm/mach-omap2/board-4430sdp.c
 index e82098f..749ce96 100644
 --- a/arch/arm/mach-omap2/board-4430sdp.c
 +++ b/arch/arm/mach-omap2/board-4430sdp.c
 @@ -545,6 +545,14 @@ static struct twl6040_platform_data twl6040_data = {
   .audpwron_gpio  = 127,
  };
  
 +static struct i2c_board_info __initdata sdp4430_i2c_1_boardinfo[] = {
 + {
 + I2C_BOARD_INFO(twl6040, 0x4b),
 + .irq = 119 + OMAP44XX_IRQ_GIC_START,
 + .platform_data = twl6040_data,
 + },
 +};
 +
  static struct twl4030_platform_data sdp4430_twldata = {
   /* Regulators */
   .vusim  = sdp4430_vusim,
 @@ -578,8 +586,8 @@ static int __init omap4_i2c_init(void)
   TWL_COMMON_REGULATOR_CLK32KG |
   TWL_COMMON_REGULATOR_V1V8 |
   TWL_COMMON_REGULATOR_V2V1);
 - omap4_pmic_init(twl6030, sdp4430_twldata,
 - twl6040_data, 119 + OMAP44XX_IRQ_GIC_START);
 + omap4_pmic_init(twl6030, sdp4430_twldata, sdp4430_i2c_1_boardinfo,
 + ARRAY_SIZE(sdp4430_i2c_1_boardinfo));
   omap_register_i2c_bus(2, 400, NULL, 0);
   omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
   ARRAY_SIZE(sdp4430_i2c_3_boardinfo));
 diff --git a/arch/arm/mach-omap2/board-omap4panda.c 
 b/arch/arm/mach-omap2/board-omap4panda.c
 index 45fe2d3..7b592d3 100644
 --- a/arch/arm/mach-omap2/board-omap4panda.c
 +++ b/arch/arm/mach-omap2/board-omap4panda.c
 @@ -264,6 +264,14 @@ static struct twl6040_platform_data twl6040_data = {
   .audpwron_gpio  = 127,
  };
  
 +static struct i2c_board_info __initdata panda_i2c_1_boardinfo[] = {
 + {
 + I2C_BOARD_INFO(twl6040, 0x4b),
 + .irq = 119 + OMAP44XX_IRQ_GIC_START,
 + .platform_data = twl6040_data,
 + },
 +};
 +
  /* Panda board uses the common PMIC configuration */
  static struct twl4030_platform_data omap4_panda_twldata;
  
 @@ -291,8 +299,8 @@ static int __init omap4_panda_i2c_init(void)
   TWL_COMMON_REGULATOR_CLK32KG |
   TWL_COMMON_REGULATOR_V1V8 |
   TWL_COMMON_REGULATOR_V2V1);
 - omap4_pmic_init(twl6030, omap4_panda_twldata,
 - twl6040_data, 119 + OMAP44XX_IRQ_GIC_START);
 + omap4_pmic_init(twl6030, omap4_panda_twldata, panda_i2c_1_boardinfo,
 + ARRAY_SIZE(panda_i2c_1_boardinfo));
   omap_register_i2c_bus(2, 400, NULL, 0);
   /*
* Bus 3 is attached to the DVI port where devices like the pico DLP
 diff --git a/arch/arm/mach-omap2/twl-common.c 
 b/arch/arm/mach-omap2/twl-common.c
 index 99be94e..af93acc 100644
 --- a/arch/arm/mach-omap2/twl-common.c
 +++ b/arch/arm/mach-omap2/twl-common.c
 @@ -40,16 +40,6 @@ static struct i2c_board_info __initdata 
 pmic_i2c_board_info = {
   .flags  = I2C_CLIENT_WAKE,
  };
  
 -static struct i2c_board_info __initdata omap4_i2c1_board_info[] = {
 - {
 - .addr   = 0x48,
 - .flags  = I2C_CLIENT_WAKE,
 - },
 - {
 - I2C_BOARD_INFO(twl6040, 0x4b),
 - },
 -};
 -
  #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
  static int twl_set_voltage(void *data, int target_uV

Re: [PATCHv7 17/21] ARM: OMAP4: TWL: enable high speed mode for PMIC communication

2012-09-26 Thread Peter Ujfalusi
Hi Tero,

On 09/25/2012 07:33 PM, Tero Kristo wrote:
 With the new parameters, I2C can now be put to high speed mode for
 better performance.

We have twl6040 on the same bus. have you tried this with audio enabled?
twl6040 is in standard mode (up to 100 kbps) after power up...

 
 Signed-off-by: Tero Kristo t-kri...@ti.com
 ---
  arch/arm/mach-omap2/omap_twl.c |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c
 index 611cb63..7ff9667 100644
 --- a/arch/arm/mach-omap2/omap_twl.c
 +++ b/arch/arm/mach-omap2/omap_twl.c
 @@ -218,6 +218,7 @@ static struct omap_voltdm_pmic omap4_core_pmic = {
   .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR,
   .volt_reg_addr  = OMAP4_VDD_CORE_SR_VOLT_REG,
   .cmd_reg_addr   = OMAP4_VDD_CORE_SR_CMD_REG,
 + .i2c_high_speed = true,
   .i2c_pad_load   = 3,
   .vsel_to_uv = twl6030_vsel_to_uv,
   .uv_to_vsel = twl6030_uv_to_vsel,
 


-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv7 17/21] ARM: OMAP4: TWL: enable high speed mode for PMIC communication

2012-09-26 Thread Peter Ujfalusi
On 09/26/2012 03:06 PM, Tero Kristo wrote:
 On Wed, 2012-09-26 at 14:39 +0300, Peter Ujfalusi wrote:
 Hi Tero,

 On 09/25/2012 07:33 PM, Tero Kristo wrote:
 With the new parameters, I2C can now be put to high speed mode for
 better performance.

 We have twl6040 on the same bus. have you tried this with audio enabled?
 twl6040 is in standard mode (up to 100 kbps) after power up...
 
 No, I don't have capability to try out audio. Can you give it a shot and
 see what happens? Otherwise we probably just have to drop this patch out
 for now.

Just compiled your mainline-3.6-rc5-omap-auto-ret-v7 branch with audio.
Works fine on my Blaze.

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Help needed with remaining plat headers

2012-09-28 Thread Peter Ujfalusi
On 09/27/2012 12:57 PM, Vutla, Lokesh wrote:
 clkdev_omap.h
 clock.h
 common.h
 cpu.h
 dma-44xx.h
 dma.h
 As a part of clean up I am looking at dma.h and dma-44xx.h files
 ll send you patches once cleanup and testing is done.

One note for the dma.h, dma-44xx.h:
The audio drivers used to include at least dma.h, but after the dmaengine
conversion the are no longer doing it. The dmaengine for OMAP audio is going
for 3.7. You can see them for some time in linux-next laready.

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Help needed with remaining plat headers

2012-10-01 Thread Peter Ujfalusi
Hi,

On 09/28/2012 09:58 AM, Vutla, Lokesh wrote:
 Hi,
 I see a module build failure in linux-next tree.
 Any one else facing this issue or I am missing something.
 Using master branch on
 git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
 Below is the log .
 
 $ make modules -j 10
 ERROR: snd_hwparams_to_dma_slave_config
 [sound/soc/omap/snd-soc-omap.ko] undefined!
 ERROR: snd_dmaengine_pcm_pointer [sound/soc/omap/snd-soc-omap.ko] undefined!
 ERROR: snd_dmaengine_pcm_open [sound/soc/omap/snd-soc-omap.ko] undefined!
 ERROR: snd_dmaengine_pcm_close [sound/soc/omap/snd-soc-omap.ko] undefined!
 ERROR: snd_dmaengine_pcm_get_chan [sound/soc/omap/snd-soc-omap.ko] 
 undefined!
 ERROR: snd_dmaengine_pcm_trigger [sound/soc/omap/snd-soc-omap.ko] undefined!
 make[1]: *** [__modpost] Error 1
 make: *** [modules] Error 2

I have sent a patch fixing this (which also affect other platforms as well):
http://mailman.alsa-project.org/pipermail/alsa-devel/2012-October/055902.html

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3.7-rc1] omap zoom2.c: Fix compile error by including correct header files

2012-10-03 Thread Peter Ujfalusi
On 10/03/2012 05:31 PM, Tim Gardner wrote:
 Cc: Peter Ujfalusi peter.ujfal...@ti.com
 Cc: Jarkko Nikula jarkko.nik...@bitmer.com
 Cc: Liam Girdwood l...@ti.com
 Cc: Mark Brown broo...@opensource.wolfsonmicro.com
 Cc: Jaroslav Kysela pe...@perex.cz
 Cc: Takashi Iwai ti...@suse.de
 Cc: linux-omap@vger.kernel.org
 Cc: alsa-de...@alsa-project.org
 Signed-off-by: Tim Gardner tim.gard...@canonical.com
 ---
  sound/soc/omap/zoom2.c |3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/sound/soc/omap/zoom2.c b/sound/soc/omap/zoom2.c
 index 23de2b2..d0a8c92 100644
 --- a/sound/soc/omap/zoom2.c
 +++ b/sound/soc/omap/zoom2.c
 @@ -27,9 +27,10 @@
  
  #include asm/mach-types.h
  #include mach/hardware.h
 -#include mach/gpio.h
 +#include linux/gpio.h
  #include mach/board-zoom.h
  #include linux/platform_data/asoc-ti-mcbsp.h
 +#include linux/platform_data/gpio-omap.h
  
  /* Register descriptions for twl4030 codec part */
  #include linux/mfd/twl4030-audio.h
 

I have the same patch stashed away for the same issue. Was waiting for rc1 to
send it.

Acked-by: Peter Ujfalusi peter.ujfal...@ti.com
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: ASoC: Fix wrong include for McPDM

2012-10-04 Thread Peter Ujfalusi
Hi Tony,

On 10/03/2012 07:52 PM, Tony Lindgren wrote:
 McPDM needs platt/cpu.h for omap_rev and not omap_hwmod.h.
 Drivers must not include omap_hwmod.h at, it will be
 private to mach-omap2 soon. Fix the problem before other
 drivers will also start including omap_hwmod.h.
 
 Note that also plat/cpu.h will be going away, so the
 omap_rev check needs to be replaced with mcpdm-watchdog
 flag from platform_data or DT.
 
 Signed-off-by: Tony Lindgren t...@atomide.com
 
 ---
 
 Can you guys please queue this as fix for -rc1?
 
 This removes and unnecessary dependency for making
 omap_hwmod.h local to mach-omap2.
 
 Then I'm hoping Peter will remove the plat/cpu.h
 dependency for v3.8 merge window ;)

I can remove it for 3.7 as well since there is no need for the revision check
at all.
Will send the omap-mcpdm update series for 3.7 in couple of minutes (including
this patch).

 
 --- a/sound/soc/omap/omap-mcpdm.c
 +++ b/sound/soc/omap/omap-mcpdm.c
 @@ -40,7 +40,7 @@
  #include sound/pcm_params.h
  #include sound/soc.h
  
 -#include plat/omap_hwmod.h
 +#include plat/cpu.h
  #include omap-mcpdm.h
  #include omap-pcm.h
  
 


-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] ASoC: omap-mcpdm updates for 3.7

2012-10-04 Thread Peter Ujfalusi
Hello Mark, Tony,

The mcpdm driver no longer needs to include any plat/*.h file, clearing the way
for the single kernel image.

Regards,
Peter
---
Peter Ujfalusi (1):
  ASoC: omap-mcpdm: Remove OMAP revision check

Tony Lindgren (1):
  ASoC: Fix wrong include for McPDM

 sound/soc/omap/omap-mcpdm.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] ASoC: Fix wrong include for McPDM

2012-10-04 Thread Peter Ujfalusi
From: Tony Lindgren t...@atomide.com

McPDM needs platt/cpu.h for omap_rev and not omap_hwmod.h.
Drivers must not include omap_hwmod.h at, it will be
private to mach-omap2 soon. Fix the problem before other
drivers will also start including omap_hwmod.h.

Note that also plat/cpu.h will be going away, so the
omap_rev check needs to be replaced with mcpdm-watchdog
flag from platform_data or DT.

Signed-off-by: Tony Lindgren t...@atomide.com
---
 sound/soc/omap/omap-mcpdm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index 7755650..fdf655e 100644
--- a/sound/soc/omap/omap-mcpdm.c
+++ b/sound/soc/omap/omap-mcpdm.c
@@ -40,7 +40,7 @@
 #include sound/pcm_params.h
 #include sound/soc.h
 
-#include plat/omap_hwmod.h
+#include plat/cpu.h
 #include omap-mcpdm.h
 #include omap-pcm.h
 
-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] ASoC: omap-mcpdm: Remove OMAP revision check

2012-10-04 Thread Peter Ujfalusi
The OMAP revision check is not needed since the watchdog bit is not in use
on 4430 ES1.0 and have no effect when we set the bit. The watchdog need to
be enabled on all other revisions.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/omap/omap-mcpdm.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index fdf655e..8f5edc8 100644
--- a/sound/soc/omap/omap-mcpdm.c
+++ b/sound/soc/omap/omap-mcpdm.c
@@ -40,7 +40,6 @@
 #include sound/pcm_params.h
 #include sound/soc.h
 
-#include plat/cpu.h
 #include omap-mcpdm.h
 #include omap-pcm.h
 
@@ -258,14 +257,9 @@ static int omap_mcpdm_dai_startup(struct snd_pcm_substream 
*substream,
mutex_lock(mcpdm-mutex);
 
if (!dai-active) {
-   /* Enable watch dog for ES above ES 1.0 to avoid saturation */
-   if (omap_rev() != OMAP4430_REV_ES1_0) {
-   u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_REG_CTRL);
+   u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_REG_CTRL);
 
-   omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL,
-ctrl | MCPDM_WD_EN);
-   }
-   omap_mcpdm_open_streams(mcpdm);
+   omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, ctrl | MCPDM_WD_EN);
}
mutex_unlock(mcpdm-mutex);
 
-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] ASoC: omap-mcpdm: Remove OMAP revision check

2012-10-04 Thread Peter Ujfalusi
On 10/04/2012 11:15 AM, Peter Ujfalusi wrote:
 The OMAP revision check is not needed since the watchdog bit is not in use
 on 4430 ES1.0 and have no effect when we set the bit. The watchdog need to
 be enabled on all other revisions.
 
 Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
 ---
  sound/soc/omap/omap-mcpdm.c | 10 ++
  1 file changed, 2 insertions(+), 8 deletions(-)
 
 diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
 index fdf655e..8f5edc8 100644
 --- a/sound/soc/omap/omap-mcpdm.c
 +++ b/sound/soc/omap/omap-mcpdm.c
 @@ -40,7 +40,6 @@
  #include sound/pcm_params.h
  #include sound/soc.h
  
 -#include plat/cpu.h
  #include omap-mcpdm.h
  #include omap-pcm.h
  
 @@ -258,14 +257,9 @@ static int omap_mcpdm_dai_startup(struct 
 snd_pcm_substream *substream,
   mutex_lock(mcpdm-mutex);
  
   if (!dai-active) {
 - /* Enable watch dog for ES above ES 1.0 to avoid saturation */
 - if (omap_rev() != OMAP4430_REV_ES1_0) {
 - u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_REG_CTRL);
 + u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_REG_CTRL);
  
 - omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL,
 -  ctrl | MCPDM_WD_EN);
 - }
 - omap_mcpdm_open_streams(mcpdm);
 + omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, ctrl | MCPDM_WD_EN);

Oops. I have removed the omap_mcpdm_open_streams() as well...
Will resend :(

   }
   mutex_unlock(mcpdm-mutex);
  
 


-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 0/2] ASoC: omap-mcpdm updates for 3.7

2012-10-04 Thread Peter Ujfalusi
Hello Mark, Tony,

Change since v1:
- Fixed the second patch to keep the omap_mcpdm_open_stream() - after a coffee

The mcpdm driver no longer needs to include any plat/*.h file, clearing the way
for the single kernel image.

Regards,
Peter
---
Peter Ujfalusi (1):
  ASoC: omap-mcpdm: Remove OMAP revision check

Tony Lindgren (1):
  ASoC: Fix wrong include for McPDM

 sound/soc/omap/omap-mcpdm.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 1/2] ASoC: Fix wrong include for McPDM

2012-10-04 Thread Peter Ujfalusi
From: Tony Lindgren t...@atomide.com

McPDM needs platt/cpu.h for omap_rev and not omap_hwmod.h.
Drivers must not include omap_hwmod.h at, it will be
private to mach-omap2 soon. Fix the problem before other
drivers will also start including omap_hwmod.h.

Note that also plat/cpu.h will be going away, so the
omap_rev check needs to be replaced with mcpdm-watchdog
flag from platform_data or DT.

Signed-off-by: Tony Lindgren t...@atomide.com
---
 sound/soc/omap/omap-mcpdm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index 7755650..fdf655e 100644
--- a/sound/soc/omap/omap-mcpdm.c
+++ b/sound/soc/omap/omap-mcpdm.c
@@ -40,7 +40,7 @@
 #include sound/pcm_params.h
 #include sound/soc.h
 
-#include plat/omap_hwmod.h
+#include plat/cpu.h
 #include omap-mcpdm.h
 #include omap-pcm.h
 
-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 2/2] ASoC: omap-mcpdm: Remove OMAP revision check

2012-10-04 Thread Peter Ujfalusi
The OMAP revision check is not needed since the watchdog bit is not in use
on 4430 ES1.0 and have no effect when we set the bit. The watchdog need to
be enabled on all other revisions.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/omap/omap-mcpdm.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index fdf655e..e134b27 100644
--- a/sound/soc/omap/omap-mcpdm.c
+++ b/sound/soc/omap/omap-mcpdm.c
@@ -40,7 +40,6 @@
 #include sound/pcm_params.h
 #include sound/soc.h
 
-#include plat/cpu.h
 #include omap-mcpdm.h
 #include omap-pcm.h
 
@@ -258,13 +257,9 @@ static int omap_mcpdm_dai_startup(struct snd_pcm_substream 
*substream,
mutex_lock(mcpdm-mutex);
 
if (!dai-active) {
-   /* Enable watch dog for ES above ES 1.0 to avoid saturation */
-   if (omap_rev() != OMAP4430_REV_ES1_0) {
-   u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_REG_CTRL);
+   u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_REG_CTRL);
 
-   omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL,
-ctrl | MCPDM_WD_EN);
-   }
+   omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, ctrl | MCPDM_WD_EN);
omap_mcpdm_open_streams(mcpdm);
}
mutex_unlock(mcpdm-mutex);
-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/9] ARM: dts/OMAP: Pinmux audio configuration for OMAP4+

2012-10-04 Thread Peter Ujfalusi
Hello,

u-boot recently stopped configuring 'non essential' pin mux. This change leaves
the audio essential pins in non configured state which prevents the use of 
audio.
The following series makes sure that the needed pins are configured correctly by
the kernel on OMAP4 and OMAP5.

Tony: can this series queued for 3.7?

Regards,
Peter
---
Peter Ujfalusi (9):
  ARM: OMAP: board-4430-sdp: Pin mux configuration for audio needs
  ARM: OMAP: board-omap4panda: Pin mux configuration for audio needs
  ARM/dts: omap4-panda: Disable unused audio IPs
  ARM/dts: omap4-sdp: Disable unused McBSP3
  ARM/dts: omap5-evm: Disable unused McBSP3
  ARM/dts: omap4-sdp: pinmux configuration for audio
  ARM/dts: omap4-panda: pinmux configuration for audio
  ARM/dts: Add pinctrl driver entries for omap5
  ARM/dts: omap5-evm: pinmux configuration for audio

 arch/arm/boot/dts/omap4-panda.dts  | 47 +++
 arch/arm/boot/dts/omap4-sdp.dts| 57 +
 arch/arm/boot/dts/omap5-evm.dts| 58 ++
 arch/arm/boot/dts/omap5.dtsi   | 17 ++
 arch/arm/mach-omap2/board-4430sdp.c| 26 +++
 arch/arm/mach-omap2/board-omap4panda.c | 15 +
 6 files changed, 220 insertions(+)

-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/9] ARM: OMAP: board-4430-sdp: Pin mux configuration for audio needs

2012-10-04 Thread Peter Ujfalusi
u-boot stopped configuring 'non essential' pins recently. These pins are
essential for audio and need to be done to have working audio on the board.
Pin Mux configuration for: twl6040 audpwron gpio, McPDM, DMIC, McBSP1 and
McBSP2.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-4430sdp.c | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index 09644af..41a9b01 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -753,6 +753,32 @@ static struct omap_board_mux board_mux[] __initdata = {
/* NIRQ2 for twl6040 */
OMAP4_MUX(SYS_NIRQ2, OMAP_MUX_MODE0 |
  OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE),
+   /* GPIO_127 for twl6040 */
+   OMAP4_MUX(HDQ_SIO, OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT),
+   /* McPDM */
+   OMAP4_MUX(ABE_PDM_UL_DATA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
+   OMAP4_MUX(ABE_PDM_DL_DATA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
+   OMAP4_MUX(ABE_PDM_FRAME, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
+   OMAP4_MUX(ABE_PDM_LB_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
+   OMAP4_MUX(ABE_CLKS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
+   /* DMIC */
+   OMAP4_MUX(ABE_DMIC_CLK1, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+   OMAP4_MUX(ABE_DMIC_DIN1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+   OMAP4_MUX(ABE_DMIC_DIN2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+   OMAP4_MUX(ABE_DMIC_DIN3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+   /* McBSP1 */
+   OMAP4_MUX(ABE_MCBSP1_CLKX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+   OMAP4_MUX(ABE_MCBSP1_DR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
+   OMAP4_MUX(ABE_MCBSP1_DX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT |
+ OMAP_PULL_ENA),
+   OMAP4_MUX(ABE_MCBSP1_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+   /* McBSP2 */
+   OMAP4_MUX(ABE_MCBSP2_CLKX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+   OMAP4_MUX(ABE_MCBSP2_DR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
+   OMAP4_MUX(ABE_MCBSP2_DX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT |
+ OMAP_PULL_ENA),
+   OMAP4_MUX(ABE_MCBSP2_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+
{ .reg_offset = OMAP_MUX_TERMINATOR },
 };
 
-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/9] ARM/dts: omap4-panda: Disable unused audio IPs

2012-10-04 Thread Peter Ujfalusi
McBSP2, McBSP3 and DMIC is not usable on PandaBoard (not connected, no
external pins provided for them).

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/boot/dts/omap4-panda.dts | 12 
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/omap4-panda.dts 
b/arch/arm/boot/dts/omap4-panda.dts
index 20b966e..771cefd 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -137,3 +137,15 @@
cs1-used;
device-handle = elpida_ECB240ABACN;
 };
+
+mcbsp2 {
+   status = disabled;
+};
+
+mcbsp3 {
+   status = disabled;
+};
+
+dmic {
+   status = disabled;
+};
-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/9] ARM/dts: omap4-sdp: Disable unused McBSP3

2012-10-04 Thread Peter Ujfalusi
McBSP3 is not usable on OMAP4 SDP/Blaze (the pins used for McPDM).

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/boot/dts/omap4-sdp.dts | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index 94a23b3..cf09875 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -349,3 +349,7 @@
pinctrl-names = default;
pinctrl-0 = uart4_pins;
 };
+
+mcbsp3 {
+   status = disabled;
+};
-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/9] ARM/dts: omap5-evm: Disable unused McBSP3

2012-10-04 Thread Peter Ujfalusi
McBSP3 is not usable on OMAP4 SDP/Blaze (the pins used for McPDM).

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/boot/dts/omap5-evm.dts | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/omap5-evm.dts b/arch/arm/boot/dts/omap5-evm.dts
index 9c41a3f..825e607 100644
--- a/arch/arm/boot/dts/omap5-evm.dts
+++ b/arch/arm/boot/dts/omap5-evm.dts
@@ -82,3 +82,7 @@
0x020700d9;/* SEARCH */
linux,input-no-autorepeat;
 };
+
+mcbsp3 {
+   status = disabled;
+};
-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/9] ARM: OMAP: board-omap4panda: Pin mux configuration for audio needs

2012-10-04 Thread Peter Ujfalusi
u-boot stopped configuring 'non essential' pins recently. These pins are
essential for audio and need to be done to have working audio on the board.
Pin Mux configuration for: twl6040 audpwron gpio, McPDM, and McBSP1.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-omap4panda.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/mach-omap2/board-omap4panda.c 
b/arch/arm/mach-omap2/board-omap4panda.c
index 57d217a..51d08fc 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -380,6 +380,21 @@ static struct omap_board_mux board_mux[] __initdata = {
/* NIRQ2 for twl6040 */
OMAP4_MUX(SYS_NIRQ2, OMAP_MUX_MODE0 |
  OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE),
+   /* GPIO_127 for twl6040 */
+   OMAP4_MUX(HDQ_SIO, OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT),
+   /* McPDM */
+   OMAP4_MUX(ABE_PDM_UL_DATA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
+   OMAP4_MUX(ABE_PDM_DL_DATA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
+   OMAP4_MUX(ABE_PDM_FRAME, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
+   OMAP4_MUX(ABE_PDM_LB_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
+   OMAP4_MUX(ABE_CLKS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
+   /* McBSP1 */
+   OMAP4_MUX(ABE_MCBSP1_CLKX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+   OMAP4_MUX(ABE_MCBSP1_DR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
+   OMAP4_MUX(ABE_MCBSP1_DX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT |
+ OMAP_PULL_ENA),
+   OMAP4_MUX(ABE_MCBSP1_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+
{ .reg_offset = OMAP_MUX_TERMINATOR },
 };
 
-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/9] ARM/dts: omap4-sdp: pinmux configuration for audio

2012-10-04 Thread Peter Ujfalusi
u-boot stopped configuring 'non essential' pins recently. The kernel needs
to configure the mux for audio needs.
Since the pinmux for these IPs are static let pinctrl to handle the mux
configuration for.
Configuring the mux for: twl6040 (audpwron, irq), McPDM, DMIC, McBSP1 and
McBSP2.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/boot/dts/omap4-sdp.dts | 53 +
 1 file changed, 53 insertions(+)

diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index cf09875..5b7e04f 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -117,6 +117,15 @@
 };
 
 omap4_pmx_core {
+   pinctrl-names = default;
+   pinctrl-0 = 
+   twl6040_pins
+   mcpdm_pins
+   dmic_pins
+   mcbsp1_pins
+   mcbsp2_pins
+   ;
+
uart2_pins: pinmux_uart2_pins {
pinctrl-single,pins = 
0xd8 0x118  /* uart2_cts.uart2_cts INPUT_PULLUP | 
MODE0 */
@@ -141,6 +150,50 @@
0x11e 0 /* uart4_tx.uart4_tx OUTPUT | MODE0 */
;
};
+
+   twl6040_pins: pinmux_twl6040_pins {
+   pinctrl-single,pins = 
+   0xe0 0x3/* hdq_sio.gpio_127 OUTPUT | MODE3 */
+   0x160 0x100 /* sys_nirq2.sys_nirq2 INPUT | MODE0 */
+   ;
+   };
+
+   mcpdm_pins: pinmux_mcpdm_pins {
+   pinctrl-single,pins = 
+   0xc6 0x108  /* abe_pdm_ul_data.abe_pdm_ul_data 
INPUT PULLDOWN | MODE0 */
+   0xc8 0x108  /* abe_pdm_dl_data.abe_pdm_dl_data 
INPUT PULLDOWN | MODE0 */
+   0xca 0x118  /* abe_pdm_frame.abe_pdm_frame INPUT 
PULLUP | MODE0 */
+   0xcc 0x108  /* abe_pdm_lb_clk.abe_pdm_lb_clk INPUT 
PULLDOWN | MODE0 */
+   0xce 0x108  /* abe_clks.abe_clks INPUT PULLDOWN | 
MODE0 */
+   ;
+   };
+
+   dmic_pins: pinmux_dmic_pins {
+   pinctrl-single,pins = 
+   0xd0 0  /* abe_dmic_clk1.abe_dmic_clk1 OUTPUT | 
MODE0 */
+   0xd2 0x100  /* abe_dmic_din1.abe_dmic_din1 INPUT | 
MODE0 */
+   0xd4 0x100  /* abe_dmic_din2.abe_dmic_din2 INPUT | 
MODE0 */
+   0xd6 0x100  /* abe_dmic_din3.abe_dmic_din3 INPUT | 
MODE0 */
+   ;
+   };
+
+   mcbsp1_pins: pinmux_mcbsp1_pins {
+   pinctrl-single,pins = 
+   0xbe 0x100  /* abe_mcbsp1_clkx.abe_mcbsp1_clkx 
INPUT | MODE0 */
+   0xc0 0x108  /* abe_mcbsp1_dr.abe_mcbsp1_dr INPUT 
PULLDOWN | MODE0 */
+   0xc2 0x8/* abe_mcbsp1_dx.abe_mcbsp1_dx OUTPUT 
PULLDOWN | MODE0 */
+   0xc4 0x100  /* abe_mcbsp1_fsx.abe_mcbsp1_fsx INPUT 
| MODE0 */
+   ;
+   };
+
+   mcbsp2_pins: pinmux_mcbsp2_pins {
+   pinctrl-single,pins = 
+   0xb6 0x100  /* abe_mcbsp2_clkx.abe_mcbsp2_clkx 
INPUT | MODE0 */
+   0xb8 0x108  /* abe_mcbsp2_dr.abe_mcbsp2_dr INPUT 
PULLDOWN | MODE0 */
+   0xba 0x8/* abe_mcbsp2_dx.abe_mcbsp2_dx OUTPUT 
PULLDOWN | MODE0 */
+   0xbc 0x100  /* abe_mcbsp2_fsx.abe_mcbsp2_fsx INPUT 
| MODE0 */
+   ;
+   };
 };
 
 i2c1 {
-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/9] ARM/dts: omap4-panda: pinmux configuration for audio

2012-10-04 Thread Peter Ujfalusi
u-boot stopped configuring 'non essential' pins recently. The kernel needs
to configure the mux for audio needs.
Since the pinmux for these IPs are static let pinctrl to handle the mux
configuration for.
Configuring the mux for: twl6040 (audpwron, irq), McPDM and McBSP1.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/boot/dts/omap4-panda.dts | 35 +++
 1 file changed, 35 insertions(+)

diff --git a/arch/arm/boot/dts/omap4-panda.dts 
b/arch/arm/boot/dts/omap4-panda.dts
index 771cefd..e8f927c 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -59,6 +59,41 @@
};
 };
 
+omap4_pmx_core {
+   pinctrl-names = default;
+   pinctrl-0 = 
+   twl6040_pins
+   mcpdm_pins
+   mcbsp1_pins
+   ;
+
+   twl6040_pins: pinmux_twl6040_pins {
+   pinctrl-single,pins = 
+   0xe0 0x3/* hdq_sio.gpio_127 OUTPUT | MODE3 */
+   0x160 0x100 /* sys_nirq2.sys_nirq2 INPUT | MODE0 */
+   ;
+   };
+
+   mcpdm_pins: pinmux_mcpdm_pins {
+   pinctrl-single,pins = 
+   0xc6 0x108  /* abe_pdm_ul_data.abe_pdm_ul_data 
INPUT PULLDOWN | MODE0 */
+   0xc8 0x108  /* abe_pdm_dl_data.abe_pdm_dl_data 
INPUT PULLDOWN | MODE0 */
+   0xca 0x118  /* abe_pdm_frame.abe_pdm_frame INPUT 
PULLUP | MODE0 */
+   0xcc 0x108  /* abe_pdm_lb_clk.abe_pdm_lb_clk INPUT 
PULLDOWN | MODE0 */
+   0xce 0x108  /* abe_clks.abe_clks INPUT PULLDOWN | 
MODE0 */
+   ;
+   };
+
+   mcbsp1_pins: pinmux_mcbsp1_pins {
+   pinctrl-single,pins = 
+   0xbe 0x100  /* abe_mcbsp1_clkx.abe_mcbsp1_clkx 
INPUT | MODE0 */
+   0xc0 0x108  /* abe_mcbsp1_dr.abe_mcbsp1_dr INPUT 
PULLDOWN | MODE0 */
+   0xc2 0x8/* abe_mcbsp1_dx.abe_mcbsp1_dx 
OUTPUT PULLDOWN | MODE0 */
+   0xc4 0x100  /* abe_mcbsp1_fsx.abe_mcbsp1_fsx INPUT 
| MODE0 */
+   ;
+   };
+};
+
 i2c1 {
clock-frequency = 40;
 
-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 8/9] ARM/dts: Add pinctrl driver entries for omap5

2012-10-04 Thread Peter Ujfalusi
These all use the generic pinctrl-single driver for the padconf registers.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/boot/dts/omap5.dtsi | 17 +
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 9ac75b3..00ee987 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -65,6 +65,23 @@
ranges;
ti,hwmods = l3_main_1, l3_main_2, l3_main_3;
 
+   omap5_pmx_core: pinmux@4a002840 {
+   compatible = ti,omap4-padconf, pinctrl-single;
+   reg = 0x4a002840 0x01b6;
+   #address-cells = 1;
+   #size-cells = 0;
+   pinctrl-single,register-width = 16;
+   pinctrl-single,function-mask = 0x7fff;
+   };
+   omap5_pmx_wkup: pinmux@4ae0c840 {
+   compatible = ti,omap4-padconf, pinctrl-single;
+   reg = 0x4ae0c840 0x0038;
+   #address-cells = 1;
+   #size-cells = 0;
+   pinctrl-single,register-width = 16;
+   pinctrl-single,function-mask = 0x7fff;
+   };
+
gic: interrupt-controller@48211000 {
compatible = arm,cortex-a15-gic;
interrupt-controller;
-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 9/9] ARM/dts: omap5-evm: pinmux configuration for audio

2012-10-04 Thread Peter Ujfalusi
u-boot stopped configuring 'non essential' pins recently. The kernel needs
to configure the mux for audio needs.
Since the pinmux for these IPs are static let pinctrl to handle the mux
configuration for.
Configuring the mux for: twl6040 (audpwron), McPDM, DMIC, McBSP1 and McBSP2.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/boot/dts/omap5-evm.dts | 54 +
 1 file changed, 54 insertions(+)

diff --git a/arch/arm/boot/dts/omap5-evm.dts b/arch/arm/boot/dts/omap5-evm.dts
index 825e607..c663eba 100644
--- a/arch/arm/boot/dts/omap5-evm.dts
+++ b/arch/arm/boot/dts/omap5-evm.dts
@@ -27,6 +27,60 @@
 
 };
 
+omap5_pmx_core {
+   pinctrl-names = default;
+   pinctrl-0 = 
+   twl6040_pins
+   mcpdm_pins
+   dmic_pins
+   mcbsp1_pins
+   mcbsp2_pins
+   ;
+
+   twl6040_pins: pinmux_twl6040_pins {
+   pinctrl-single,pins = 
+   0x18a 0x6   /* perslimbus2_clock.gpio5_145 OUTPUT | 
MODE6 */
+   ;
+   };
+
+   mcpdm_pins: pinmux_mcpdm_pins {
+   pinctrl-single,pins = 
+   0x142 0x108 /* abe_clks.abe_clks INPUT PULLDOWN | 
MODE0 */
+   0x15c 0x108 /* abemcpdm_ul_data.abemcpdm_ul_data 
INPUT PULLDOWN | MODE0 */
+   0x15e 0x108 /* abemcpdm_dl_data.abemcpdm_dl_data 
INPUT PULLDOWN | MODE0 */
+   0x160 0x118 /* abemcpdm_frame.abemcpdm_frame INPUT 
PULLUP | MODE0 */
+   0x162 0x108 /* abemcpdm_lb_clk.abemcpdm_lb_clk 
INPUT PULLDOWN | MODE0 */
+   ;
+   };
+
+   dmic_pins: pinmux_dmic_pins {
+   pinctrl-single,pins = 
+   0x144 0x100 /* abedmic_din1.abedmic_din1 INPUT | 
MODE0 */
+   0x146 0x100 /* abedmic_din2.abedmic_din2 INPUT | 
MODE0 */
+   0x148 0x100 /* abedmic_din3.abedmic_din3 INPUT | 
MODE0 */
+   0x14a 0 /* abedmic_clk1.abedmic_clk1 OUTPUT | 
MODE0 */
+   ;
+   };
+
+   mcbsp1_pins: pinmux_mcbsp1_pins {
+   pinctrl-single,pins = 
+   0x14c 0x101 /* abedmic_clk2.abemcbsp1_fsx INPUT | 
MODE1 */
+   0x14e 0x9   /* abedmic_clk3.abemcbsp1_dx OUTPUT 
PULLDOWN | MODE1 */
+   0x150 0x101 /* abeslimbus1_clock.abemcbsp1_clkx 
INPUT | MODE0 */
+   0x152 0x109 /* abeslimbus1_data.abemcbsp1_dr INPUT 
PULLDOWN | MODE1 */
+   ;
+   };
+
+   mcbsp2_pins: pinmux_mcbsp2_pins {
+   pinctrl-single,pins = 
+   0x154 0x108 /* abemcbsp2_dr.abemcbsp2_dr INPUT 
PULLDOWN | MODE0 */
+   0x156 0x8   /* abemcbsp2_dx.abemcbsp2_dx OUTPUT 
PULLDOWN | MODE0 */
+   0x158 0x100 /* abemcbsp2_fsx.abemcbsp2_fsx INPUT | 
MODE0 */
+   0x15a 0x100 /* abemcbsp2_clkx.abemcbsp2_clkx INPUT 
| MODE0 */
+   ;
+   };
+};
+
 mmc1 {
vmmc-supply = vmmcsd_fixed;
bus-width = 4;
-- 
1.7.12

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] OMAPDSS: Correct check for the callback pointer in dss_dsi_disable_pads()

2012-10-16 Thread Peter Ujfalusi
Appear to be a copy-paste bug: the code was checking board_data-dsi_enable_pads
while calling board_data-dsi_disable_pads.


Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---

Hi Tomi,

not sure if this need to be included to 3.7

Regards,
Peter

 drivers/video/omap2/dss/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index b2af72d..7afaf61 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -122,7 +122,7 @@ void dss_dsi_disable_pads(int dsi_id, unsigned lane_mask)
 {
struct omap_dss_board_info *board_data = core.pdev-dev.platform_data;
 
-   if (!board_data-dsi_enable_pads)
+   if (!board_data-dsi_disable_pads)
return;
 
return board_data-dsi_disable_pads(dsi_id, lane_mask);
-- 
1.7.12.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ARM/dts: omap3: Fix mcbsp2/3 hwmods to be able to probe the drivers for audio

2012-10-18 Thread Peter Ujfalusi
Fixes the following errors:
[2.318084] omap-mcbsp 49022000.mcbsp: invalid rx DMA channel
[2.324432] omap-mcbsp 49024000.mcbsp: invalid rx DMA channel

Which is because we failed to link the sidetone hwmod for McBSP2/3. The
missing sidetone hwmod link will prevent omap_device_alloc() to append the
DMA resources since we - accidentally - end up having the same number of
resources provided from DT (IO/IRQ) as we have in hwmod for the McBSP ports
without the ST resources.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---

Hi Tony, Benoit,

Can you please take this patch for 3.7 since if we boot with DT audio will not
work on BeagleBoard and on boards which uses McBSP2 or 3 for audio.

Thank you,
Peter

 arch/arm/boot/dts/omap3.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index f38ea87..696e929 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -257,7 +257,7 @@
interrupt-names = common, tx, rx, sidetone;
interrupt-parent = intc;
ti,buffer-size = 1280;
-   ti,hwmods = mcbsp2;
+   ti,hwmods = mcbsp2, mcbsp2_sidetone;
};
 
mcbsp3: mcbsp@49024000 {
@@ -272,7 +272,7 @@
interrupt-names = common, tx, rx, sidetone;
interrupt-parent = intc;
ti,buffer-size = 128;
-   ti,hwmods = mcbsp3;
+   ti,hwmods = mcbsp3, mcbsp3_sidetone;
};
 
mcbsp4: mcbsp@49026000 {
-- 
1.7.12.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] ARM: OMAP: hwmod/omapd_device: Fix for resource handling in DT boot

2012-10-30 Thread Peter Ujfalusi
Hello,

This series resolves the issue we currently have with the resource handling when
booting with DT.
In short: at the moment the omap_device_alloc() decides if it needs to update 
the
OF filled resources based on the number of resources on the device and in the
hwmod database.
This prevents us from removing hwmod data for platforms (OMAP5) which does not
support non DT boot anymore.

With this series we can make sure that the DT provided resources are used and we
only append the DMA resources to the device from hwmod.
I have added extra check to prepare us when the DMA resource can be filled via
OF. In this case we do not update the resources at all.

Tony, Benoit, Paul: Not sure if this qualify for 3.7 inclusion, but for sure
going to help us to clean up the OMAP5 hwmod database.

Regards,
Peter
---
Peter Ujfalusi (2):
  ARM: OMAP: hwmod: Add possibility to count hwmod resources based on
type
  ARM: OMAP: omap_device: Correct resource handling for DT boot

 arch/arm/mach-omap2/omap_hwmod.c | 27 +
 arch/arm/plat-omap/include/plat/omap_hwmod.h |  2 +-
 arch/arm/plat-omap/omap_device.c | 83 +---
 3 files changed, 68 insertions(+), 44 deletions(-)

-- 
1.7.12.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] ARM: OMAP: hwmod: Add possibility to count hwmod resources based on type

2012-10-30 Thread Peter Ujfalusi
Add flags parameter for omap_hwmod_count_resources() so users can tell which
type of resources they are interested when counting them in hwmod database.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod.c | 27 ---
 arch/arm/plat-omap/include/plat/omap_hwmod.h |  2 +-
 arch/arm/plat-omap/omap_device.c | 11 ---
 3 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index b969ab1..a79c941 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -3337,7 +3337,7 @@ int omap_hwmod_reset(struct omap_hwmod *oh)
 /**
  * omap_hwmod_count_resources - count number of struct resources needed by 
hwmod
  * @oh: struct omap_hwmod *
- * @res: pointer to the first element of an array of struct resource to fill
+ * @flags: Type of resources to include when counting (IRQ/DMA/MEM)
  *
  * Count the number of struct resource array elements necessary to
  * contain omap_hwmod @oh resources.  Intended to be called by code
@@ -3350,20 +3350,25 @@ int omap_hwmod_reset(struct omap_hwmod *oh)
  * resource IDs.
  *
  */
-int omap_hwmod_count_resources(struct omap_hwmod *oh)
+int omap_hwmod_count_resources(struct omap_hwmod *oh, unsigned long flags)
 {
-   struct omap_hwmod_ocp_if *os;
-   struct list_head *p;
-   int ret;
-   int i = 0;
+   int ret = 0;
 
-   ret = _count_mpu_irqs(oh) + _count_sdma_reqs(oh);
+   if (flags  IORESOURCE_IRQ)
+   ret += _count_mpu_irqs(oh);
 
-   p = oh-slave_ports.next;
+   if (flags  IORESOURCE_DMA)
+   ret += _count_sdma_reqs(oh);
 
-   while (i  oh-slaves_cnt) {
-   os = _fetch_next_ocp_if(p, i);
-   ret += _count_ocp_if_addr_spaces(os);
+   if (flags  IORESOURCE_MEM) {
+   int i = 0;
+   struct omap_hwmod_ocp_if *os;
+   struct list_head *p = oh-slave_ports.next;
+
+   while (i  oh-slaves_cnt) {
+   os = _fetch_next_ocp_if(p, i);
+   ret += _count_ocp_if_addr_spaces(os);
+   }
}
 
return ret;
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h 
b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index b3349f7..48a6f5d 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -628,7 +628,7 @@ void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 
reg_offs);
 u32 omap_hwmod_read(struct omap_hwmod *oh, u16 reg_offs);
 int omap_hwmod_softreset(struct omap_hwmod *oh);
 
-int omap_hwmod_count_resources(struct omap_hwmod *oh);
+int omap_hwmod_count_resources(struct omap_hwmod *oh, unsigned long flags);
 int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res);
 int omap_hwmod_fill_dma_resources(struct omap_hwmod *oh, struct resource *res);
 int omap_hwmod_get_resource_byname(struct omap_hwmod *oh, unsigned int type,
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index 7a7d1f2..915cf68 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -442,19 +442,21 @@ int omap_device_get_context_loss_count(struct 
platform_device *pdev)
 /**
  * omap_device_count_resources - count number of struct resource entries needed
  * @od: struct omap_device *
+ * @flags: Type of resources to include when counting (IRQ/DMA/MEM)
  *
  * Count the number of struct resource entries needed for this
  * omap_device @od.  Used by omap_device_build_ss() to determine how
  * much memory to allocate before calling
  * omap_device_fill_resources().  Returns the count.
  */
-static int omap_device_count_resources(struct omap_device *od)
+static int omap_device_count_resources(struct omap_device *od,
+  unsigned long flags)
 {
int c = 0;
int i;
 
for (i = 0; i  od-hwmods_cnt; i++)
-   c += omap_hwmod_count_resources(od-hwmods[i]);
+   c += omap_hwmod_count_resources(od-hwmods[i], flags);
 
pr_debug(omap_device: %s: counted %d total resources across %d 
hwmods\n,
 od-pdev-name, c, od-hwmods_cnt);
@@ -558,7 +560,10 @@ struct omap_device *omap_device_alloc(struct 
platform_device *pdev,
od-hwmods = hwmods;
od-pdev = pdev;
 
-   res_count = omap_device_count_resources(od);
+   /* Count all resources for the device */
+   res_count = omap_device_count_resources(od, IORESOURCE_IRQ |
+   IORESOURCE_DMA |
+   IORESOURCE_MEM);
/*
 * DT Boot:
 *   OF framework will construct the resource structure (currently
-- 
1.7.12.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More

[PATCH 2/2] ARM: OMAP: omap_device: Correct resource handling for DT boot

2012-10-30 Thread Peter Ujfalusi
When booting with DT the OF core can fill up the resources provided within
the DT blob.
The current way of handling the DT boot prevents us from removing hwmod data
for platforms only suppose to boot with DT (OMAP5 for example) since we need
to keep the whole hwmod database intact in order to have more resources in
hwmod than in DT (to be able to append the DMA resource from hwmod).

To fix this issue we just examine the OF provided resources:
If we do not have resources we use hwmod to fill them.
If we have resources we check if we already able to recive DMA resource, if
no we only append the DMA resurce from hwmod to the OF provided ones.

In this way we can start removing hwmod data for devices which have their
resources correctly configured in DT without regressions.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/plat-omap/omap_device.c | 80 +++-
 1 file changed, 47 insertions(+), 33 deletions(-)

diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index 915cf68..a8a9d08 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -560,55 +560,69 @@ struct omap_device *omap_device_alloc(struct 
platform_device *pdev,
od-hwmods = hwmods;
od-pdev = pdev;
 
-   /* Count all resources for the device */
-   res_count = omap_device_count_resources(od, IORESOURCE_IRQ |
-   IORESOURCE_DMA |
-   IORESOURCE_MEM);
/*
+* Non-DT Boot:
+*   Here, pdev-num_resources = 0, and we should get all the
+*   resources from hwmod.
+*
 * DT Boot:
 *   OF framework will construct the resource structure (currently
 *   does for MEM  IRQ resource) and we should respect/use these
 *   resources, killing hwmod dependency.
 *   If pdev-num_resources  0, we assume that MEM  IRQ resources
 *   have been allocated by OF layer already (through DTB).
-*
-* Non-DT Boot:
-*   Here, pdev-num_resources = 0, and we should get all the
-*   resources from hwmod.
+*   As preparation for the future we examine the OF provided resources
+*   to see if we have DMA resources provided already. In this case
+*   there is no need to update the resources for the device, we use the
+*   OF provided ones.
 *
 * TODO: Once DMA resource is available from OF layer, we should
 *   kill filling any resources from hwmod.
 */
-   if (res_count  pdev-num_resources) {
-   /* Allocate resources memory to account for new resources */
-   res = kzalloc(sizeof(struct resource) * res_count, GFP_KERNEL);
-   if (!res)
-   goto oda_exit3;
-
-   /*
-* If pdev-num_resources  0, then assume that,
-* MEM and IRQ resources will only come from DT and only
-* fill DMA resource from hwmod layer.
-*/
-   if (pdev-num_resources  pdev-resource) {
-   dev_dbg(pdev-dev, %s(): resources already allocated 
%d\n,
-   __func__, res_count);
-   memcpy(res, pdev-resource,
-  sizeof(struct resource) * pdev-num_resources);
-   _od_fill_dma_resources(od, res[pdev-num_resources]);
-   } else {
-   dev_dbg(pdev-dev, %s(): using resources from hwmod 
%d\n,
-   __func__, res_count);
-   omap_device_fill_resources(od, res);
+   if (!pdev-num_resources) {
+   /* Count all resources for the device */
+   res_count = omap_device_count_resources(od, IORESOURCE_IRQ |
+   IORESOURCE_DMA |
+   IORESOURCE_MEM);
+   } else {
+   /* Take a look if we already have DMA resource via DT */
+   for (i = 0; i  pdev-num_resources; i++) {
+   struct resource *r = pdev-resource[i];
+
+   /* We have it, no need to touch the resources */
+   if (r-flags == IORESOURCE_DMA)
+   goto have_everything;
}
+   /* Count only DMA resources for the device */
+   res_count = omap_device_count_resources(od, IORESOURCE_DMA);
+   res_count += pdev-num_resources;
+   }
 
-   ret = platform_device_add_resources(pdev, res, res_count);
-   kfree(res);
+   /* Allocate resources memory to account for new resources */
+   res = kzalloc(sizeof(struct resource) * res_count, GFP_KERNEL);
+   if (!res)
+   goto oda_exit3

[PATCH v2 1/2] ARM: OMAP: hwmod: Add possibility to count hwmod resources based on type

2012-10-30 Thread Peter Ujfalusi
Add flags parameter for omap_hwmod_count_resources() so users can tell which
type of resources they are interested when counting them in hwmod database.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod.c | 27 ---
 arch/arm/plat-omap/include/plat/omap_hwmod.h |  2 +-
 arch/arm/plat-omap/omap_device.c | 11 ---
 3 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index b969ab1..a79c941 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -3337,7 +3337,7 @@ int omap_hwmod_reset(struct omap_hwmod *oh)
 /**
  * omap_hwmod_count_resources - count number of struct resources needed by 
hwmod
  * @oh: struct omap_hwmod *
- * @res: pointer to the first element of an array of struct resource to fill
+ * @flags: Type of resources to include when counting (IRQ/DMA/MEM)
  *
  * Count the number of struct resource array elements necessary to
  * contain omap_hwmod @oh resources.  Intended to be called by code
@@ -3350,20 +3350,25 @@ int omap_hwmod_reset(struct omap_hwmod *oh)
  * resource IDs.
  *
  */
-int omap_hwmod_count_resources(struct omap_hwmod *oh)
+int omap_hwmod_count_resources(struct omap_hwmod *oh, unsigned long flags)
 {
-   struct omap_hwmod_ocp_if *os;
-   struct list_head *p;
-   int ret;
-   int i = 0;
+   int ret = 0;
 
-   ret = _count_mpu_irqs(oh) + _count_sdma_reqs(oh);
+   if (flags  IORESOURCE_IRQ)
+   ret += _count_mpu_irqs(oh);
 
-   p = oh-slave_ports.next;
+   if (flags  IORESOURCE_DMA)
+   ret += _count_sdma_reqs(oh);
 
-   while (i  oh-slaves_cnt) {
-   os = _fetch_next_ocp_if(p, i);
-   ret += _count_ocp_if_addr_spaces(os);
+   if (flags  IORESOURCE_MEM) {
+   int i = 0;
+   struct omap_hwmod_ocp_if *os;
+   struct list_head *p = oh-slave_ports.next;
+
+   while (i  oh-slaves_cnt) {
+   os = _fetch_next_ocp_if(p, i);
+   ret += _count_ocp_if_addr_spaces(os);
+   }
}
 
return ret;
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h 
b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index b3349f7..48a6f5d 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -628,7 +628,7 @@ void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 
reg_offs);
 u32 omap_hwmod_read(struct omap_hwmod *oh, u16 reg_offs);
 int omap_hwmod_softreset(struct omap_hwmod *oh);
 
-int omap_hwmod_count_resources(struct omap_hwmod *oh);
+int omap_hwmod_count_resources(struct omap_hwmod *oh, unsigned long flags);
 int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res);
 int omap_hwmod_fill_dma_resources(struct omap_hwmod *oh, struct resource *res);
 int omap_hwmod_get_resource_byname(struct omap_hwmod *oh, unsigned int type,
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index 7a7d1f2..915cf68 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -442,19 +442,21 @@ int omap_device_get_context_loss_count(struct 
platform_device *pdev)
 /**
  * omap_device_count_resources - count number of struct resource entries needed
  * @od: struct omap_device *
+ * @flags: Type of resources to include when counting (IRQ/DMA/MEM)
  *
  * Count the number of struct resource entries needed for this
  * omap_device @od.  Used by omap_device_build_ss() to determine how
  * much memory to allocate before calling
  * omap_device_fill_resources().  Returns the count.
  */
-static int omap_device_count_resources(struct omap_device *od)
+static int omap_device_count_resources(struct omap_device *od,
+  unsigned long flags)
 {
int c = 0;
int i;
 
for (i = 0; i  od-hwmods_cnt; i++)
-   c += omap_hwmod_count_resources(od-hwmods[i]);
+   c += omap_hwmod_count_resources(od-hwmods[i], flags);
 
pr_debug(omap_device: %s: counted %d total resources across %d 
hwmods\n,
 od-pdev-name, c, od-hwmods_cnt);
@@ -558,7 +560,10 @@ struct omap_device *omap_device_alloc(struct 
platform_device *pdev,
od-hwmods = hwmods;
od-pdev = pdev;
 
-   res_count = omap_device_count_resources(od);
+   /* Count all resources for the device */
+   res_count = omap_device_count_resources(od, IORESOURCE_IRQ |
+   IORESOURCE_DMA |
+   IORESOURCE_MEM);
/*
 * DT Boot:
 *   OF framework will construct the resource structure (currently
-- 
1.7.12.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More

[PATCH v2 0/2] ARM: OMAP: hwmod/omapd_device: Fix for resource handling in DT boot

2012-10-30 Thread Peter Ujfalusi
Hello,

Changes since v1:
- If the device does not have DMA resource do not try to recreate the resources

Intro mail from v1:

This series resolves the issue we currently have with the resource handling when
booting with DT.
In short: at the moment the omap_device_alloc() decides if it needs to update 
the
OF filled resources based on the number of resources on the device and in the
hwmod database.
This prevents us from removing hwmod data for platforms (OMAP5) which does not
support non DT boot anymore.

With this series we can make sure that the DT provided resources are used and we
only append the DMA resources to the device from hwmod.
I have added extra check to prepare us when the DMA resource can be filled via
OF. In this case we do not update the resources at all.

Tony, Benoit, Paul: Not sure if this qualify for 3.7 inclusion, but for sure
going to help us to clean up the OMAP5 hwmod database.

Regards,
Peter
---
Peter Ujfalusi (2):
  ARM: OMAP: hwmod: Add possibility to count hwmod resources based on
type
  ARM: OMAP: omap_device: Correct resource handling for DT boot

 arch/arm/mach-omap2/omap_hwmod.c | 27 +
 arch/arm/plat-omap/include/plat/omap_hwmod.h |  2 +-
 arch/arm/plat-omap/omap_device.c | 87 ++--
 3 files changed, 72 insertions(+), 44 deletions(-)

-- 
1.7.12.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 2/2] ARM: OMAP: omap_device: Correct resource handling for DT boot

2012-10-30 Thread Peter Ujfalusi
When booting with DT the OF core can fill up the resources provided within
the DT blob.
The current way of handling the DT boot prevents us from removing hwmod data
for platforms only suppose to boot with DT (OMAP5 for example) since we need
to keep the whole hwmod database intact in order to have more resources in
hwmod than in DT (to be able to append the DMA resource from hwmod).

To fix this issue we just examine the OF provided resources:
If we do not have resources we use hwmod to fill them.
If we have resources we check if we already able to recive DMA resource, if
no we only append the DMA resurce from hwmod to the OF provided ones.

In this way we can start removing hwmod data for devices which have their
resources correctly configured in DT without regressions.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/plat-omap/omap_device.c | 84 
 1 file changed, 51 insertions(+), 33 deletions(-)

diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index 915cf68..d35b468 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -560,55 +560,73 @@ struct omap_device *omap_device_alloc(struct 
platform_device *pdev,
od-hwmods = hwmods;
od-pdev = pdev;
 
-   /* Count all resources for the device */
-   res_count = omap_device_count_resources(od, IORESOURCE_IRQ |
-   IORESOURCE_DMA |
-   IORESOURCE_MEM);
/*
+* Non-DT Boot:
+*   Here, pdev-num_resources = 0, and we should get all the
+*   resources from hwmod.
+*
 * DT Boot:
 *   OF framework will construct the resource structure (currently
 *   does for MEM  IRQ resource) and we should respect/use these
 *   resources, killing hwmod dependency.
 *   If pdev-num_resources  0, we assume that MEM  IRQ resources
 *   have been allocated by OF layer already (through DTB).
-*
-* Non-DT Boot:
-*   Here, pdev-num_resources = 0, and we should get all the
-*   resources from hwmod.
+*   As preparation for the future we examine the OF provided resources
+*   to see if we have DMA resources provided already. In this case
+*   there is no need to update the resources for the device, we use the
+*   OF provided ones.
 *
 * TODO: Once DMA resource is available from OF layer, we should
 *   kill filling any resources from hwmod.
 */
-   if (res_count  pdev-num_resources) {
-   /* Allocate resources memory to account for new resources */
-   res = kzalloc(sizeof(struct resource) * res_count, GFP_KERNEL);
-   if (!res)
-   goto oda_exit3;
-
-   /*
-* If pdev-num_resources  0, then assume that,
-* MEM and IRQ resources will only come from DT and only
-* fill DMA resource from hwmod layer.
-*/
-   if (pdev-num_resources  pdev-resource) {
-   dev_dbg(pdev-dev, %s(): resources already allocated 
%d\n,
-   __func__, res_count);
-   memcpy(res, pdev-resource,
-  sizeof(struct resource) * pdev-num_resources);
-   _od_fill_dma_resources(od, res[pdev-num_resources]);
-   } else {
-   dev_dbg(pdev-dev, %s(): using resources from hwmod 
%d\n,
-   __func__, res_count);
-   omap_device_fill_resources(od, res);
+   if (!pdev-num_resources) {
+   /* Count all resources for the device */
+   res_count = omap_device_count_resources(od, IORESOURCE_IRQ |
+   IORESOURCE_DMA |
+   IORESOURCE_MEM);
+   } else {
+   /* Take a look if we already have DMA resource via DT */
+   for (i = 0; i  pdev-num_resources; i++) {
+   struct resource *r = pdev-resource[i];
+
+   /* We have it, no need to touch the resources */
+   if (r-flags == IORESOURCE_DMA)
+   goto have_everything;
}
+   /* Count only DMA resources for the device */
+   res_count = omap_device_count_resources(od, IORESOURCE_DMA);
+   /* The device has no DMA resource, no need for update */
+   if (!res_count)
+   goto have_everything;
+   
+   res_count += pdev-num_resources;
+   }
 
-   ret = platform_device_add_resources(pdev, res, res_count);
-   kfree(res);
+   /* Allocate resources memory to account

[PATCH 0/3] ARM: OMAP4: register V1V8, V2V1 regulators

2012-05-02 Thread Peter Ujfalusi
Hello,

This series adds common configuration for the V1V8, V2V1 regulators from
twl6030. These regulators are commonly used to feed the twl6040 audio IC on
OMAP4 based boards (SDP4430, PandaBoards).

The regulator support for the twl6040 MFD driver will be going via MFD tree to
avoid cross tree issues.

Regards,
Peter
---
Peter Ujfalusi (3):
  OMAP4: twl-common: Add twl6030 V1V8, V2V1 SMPS common configuration
  OMAP: 4430SDP: Use common configuration for V1V8, V2V1 supplies
  OMAP: omap4panda: Use common configuration for V1V8, V2V1 supplies

 arch/arm/mach-omap2/board-4430sdp.c|4 ++-
 arch/arm/mach-omap2/board-omap4panda.c |4 ++-
 arch/arm/mach-omap2/twl-common.c   |   42 
 arch/arm/mach-omap2/twl-common.h   |2 +
 4 files changed, 50 insertions(+), 2 deletions(-)

-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] OMAP: omap4panda: Use common configuration for V1V8, V2V1 supplies

2012-05-02 Thread Peter Ujfalusi
These supplies going to be needed for the twl6040 driver.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-omap4panda.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap4panda.c 
b/arch/arm/mach-omap2/board-omap4panda.c
index 1b782ba..c47feed 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -323,7 +323,9 @@ static int __init omap4_panda_i2c_init(void)
TWL_COMMON_REGULATOR_VANA |
TWL_COMMON_REGULATOR_VCXIO |
TWL_COMMON_REGULATOR_VUSB |
-   TWL_COMMON_REGULATOR_CLK32KG);
+   TWL_COMMON_REGULATOR_CLK32KG |
+   TWL_COMMON_REGULATOR_V1V8 |
+   TWL_COMMON_REGULATOR_V2V1);
omap4_pmic_init(twl6030, omap4_panda_twldata,
twl6040_data, OMAP44XX_IRQ_SYS_2N);
omap_register_i2c_bus(2, 400, NULL, 0);
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] OMAP: 4430SDP: Use common configuration for V1V8, V2V1 supplies

2012-05-02 Thread Peter Ujfalusi
These supplies going to be needed for the twl6040 driver.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-4430sdp.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index 130ab00..c8d38bd 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -615,7 +615,9 @@ static int __init omap4_i2c_init(void)
TWL_COMMON_REGULATOR_VANA |
TWL_COMMON_REGULATOR_VCXIO |
TWL_COMMON_REGULATOR_VUSB |
-   TWL_COMMON_REGULATOR_CLK32KG);
+   TWL_COMMON_REGULATOR_CLK32KG |
+   TWL_COMMON_REGULATOR_V1V8 |
+   TWL_COMMON_REGULATOR_V2V1);
omap4_pmic_init(twl6030, sdp4430_twldata,
twl6040_data, OMAP44XX_IRQ_SYS_2N);
omap_register_i2c_bus(2, 400, NULL, 0);
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] OMAP4: twl-common: Add twl6030 V1V8, V2V1 SMPS common configuration

2012-05-02 Thread Peter Ujfalusi
V1V8 supply from twl6030 commonly used as VIO for the machine.
V2V1 is adviced to supply the twl6040, and also to feed the twl6030's
VCXIO_IN, and VDAC_IN inputs.
Create the common regulator configurations for these regulators:
Make the V2V1 as supply_regulator for VCXIO, VDAC.
Add twl6040 (1-004b) as consumer for V1V8, and V2V1.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/twl-common.c |   42 ++
 arch/arm/mach-omap2/twl-common.h |2 +
 2 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index ee6596b..531a4f9 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -266,6 +266,7 @@ static struct regulator_init_data omap4_vdac_idata = {
.valid_ops_mask = REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS,
},
+   .supply_regulator   = V2V1,
 };
 
 static struct regulator_init_data omap4_vaux2_idata = {
@@ -356,6 +357,7 @@ static struct regulator_init_data omap4_vcxio_idata = {
},
.num_consumer_supplies  = ARRAY_SIZE(omap4_vcxio_supply),
.consumer_supplies  = omap4_vcxio_supply,
+   .supply_regulator   = V2V1,
 };
 
 static struct regulator_init_data omap4_vusb_idata = {
@@ -423,6 +425,40 @@ static struct regulator_init_data omap4_vdd3 = {
.consumer_supplies  = omap4_vdd3_supply,
 };
 
+static struct regulator_consumer_supply omap4_v1v8_supply[] = {
+   REGULATOR_SUPPLY(vio, 1-004b),
+};
+
+static struct regulator_init_data omap4_v1v8_idata = {
+   .constraints = {
+   .min_uV = 180,
+   .max_uV = 180,
+   .valid_modes_mask   = REGULATOR_MODE_NORMAL
+   | REGULATOR_MODE_STANDBY,
+   .valid_ops_mask = REGULATOR_CHANGE_MODE
+   | REGULATOR_CHANGE_STATUS,
+   .always_on  = true,
+   },
+   .num_consumer_supplies  = ARRAY_SIZE(omap4_v1v8_supply),
+   .consumer_supplies  = omap4_v1v8_supply,
+};
+
+static struct regulator_consumer_supply omap4_v2v1_supply[] = {
+   REGULATOR_SUPPLY(v2v1, 1-004b),
+};
+
+static struct regulator_init_data omap4_v2v1_idata = {
+   .constraints = {
+   .min_uV = 210,
+   .max_uV = 210,
+   .valid_modes_mask   = REGULATOR_MODE_NORMAL
+   | REGULATOR_MODE_STANDBY,
+   .valid_ops_mask = REGULATOR_CHANGE_MODE
+   | REGULATOR_CHANGE_STATUS,
+   },
+   .num_consumer_supplies  = ARRAY_SIZE(omap4_v2v1_supply),
+   .consumer_supplies  = omap4_v2v1_supply,
+};
 
 static struct twl_regulator_driver_data omap4_vdd1_drvdata = {
.get_voltage = twl_get_voltage,
@@ -497,5 +533,11 @@ void __init omap4_pmic_get_config(struct 
twl4030_platform_data *pmic_data,
if (regulators_flags  TWL_COMMON_REGULATOR_CLK32KG 
!pmic_data-clk32kg)
pmic_data-clk32kg = omap4_clk32kg_idata;
+
+   if (regulators_flags  TWL_COMMON_REGULATOR_V1V8  !pmic_data-v1v8)
+   pmic_data-v1v8 = omap4_v1v8_idata;
+
+   if (regulators_flags  TWL_COMMON_REGULATOR_V2V1  !pmic_data-v2v1)
+   pmic_data-v2v1 = omap4_v2v1_idata;
 }
 #endif /* CONFIG_ARCH_OMAP4 */
diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h
index 0962748..8fe71cf 100644
--- a/arch/arm/mach-omap2/twl-common.h
+++ b/arch/arm/mach-omap2/twl-common.h
@@ -22,6 +22,8 @@
 #define TWL_COMMON_REGULATOR_VCXIO (1  8)
 #define TWL_COMMON_REGULATOR_VUSB  (1  9)
 #define TWL_COMMON_REGULATOR_CLK32KG   (1  10)
+#define TWL_COMMON_REGULATOR_V1V8  (1  11)
+#define TWL_COMMON_REGULATOR_V2V1  (1  12)
 
 /* TWL4030 LDO regulators */
 #define TWL_COMMON_REGULATOR_VPLL1 (1  4)
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] MFD: twl6040: Add regulator support for VIO, V2V1 supplies

2012-05-02 Thread Peter Ujfalusi
twl6040 has three power supply source:
VBAT needs to be connected to VBAT, VIO, and V2V1.
Add regulator support for the VIO, V2V1 supplies.
Initially handle the two supply together with bulk commands.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
Reviewed-by: Mark Brown broo...@opensource.wolfsonmicro.com
---
 drivers/mfd/twl6040-core.c  |   33 +
 include/linux/mfd/twl6040.h |2 ++
 2 files changed, 31 insertions(+), 4 deletions(-)

Hi Samuel,

The runtime dependencies for this patch has been sent to linux-omap list:
http://marc.info/?l=linux-omapm=133596645010228w=2
http://marc.info/?l=linux-omapm=133596645610232w=2
http://marc.info/?l=linux-omapm=133596644310224w=2
http://marc.info/?l=linux-omapm=133596643310220w=2

Alone this patch does not cause compile time regression but in runtime it needs
the arch/arm/mach-omap2 patches.
I try to avoid cross tree issues as much as I can and I'm happy if these will
come together in linux-next (and finally in 3.5).

Regards,
Peter

diff --git a/drivers/mfd/twl6040-core.c b/drivers/mfd/twl6040-core.c
index 493f4a6..7a92d95 100644
--- a/drivers/mfd/twl6040-core.c
+++ b/drivers/mfd/twl6040-core.c
@@ -27,6 +27,7 @@
 #include linux/types.h
 #include linux/slab.h
 #include linux/kernel.h
+#include linux/err.h
 #include linux/platform_device.h
 #include linux/gpio.h
 #include linux/delay.h
@@ -35,8 +36,10 @@
 #include linux/err.h
 #include linux/mfd/core.h
 #include linux/mfd/twl6040.h
+#include linux/regulator/consumer.h
 
 #define VIBRACTRL_MEMBER(reg) ((reg == TWL6040_REG_VIBCTLL) ? 0 : 1)
+#define TWL6040_NUM_SUPPLIES   (2)
 
 int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg)
 {
@@ -532,6 +535,21 @@ static int __devinit twl6040_probe(struct i2c_client 
*client,
 
i2c_set_clientdata(client, twl6040);
 
+   twl6040-supplies[0].supply = vio;
+   twl6040-supplies[1].supply = v2v1;
+   ret = regulator_bulk_get(client-dev, TWL6040_NUM_SUPPLIES,
+twl6040-supplies);
+   if (ret != 0) {
+   dev_err(client-dev, Failed to get supplies: %d\n, ret);
+   goto regulator_get_err;
+   }
+
+   ret = regulator_bulk_enable(TWL6040_NUM_SUPPLIES, twl6040-supplies);
+   if (ret != 0) {
+   dev_err(client-dev, Failed to enable supplies: %d\n, ret);
+   goto power_err;
+   }
+
twl6040-dev = client-dev;
twl6040-irq = client-irq;
twl6040-irq_base = pdata-irq_base;
@@ -552,13 +570,13 @@ static int __devinit twl6040_probe(struct i2c_client 
*client,
ret = gpio_request_one(twl6040-audpwron, GPIOF_OUT_INIT_LOW,
   audpwron);
if (ret)
-   goto gpio1_err;
+   goto gpio_err;
}
 
/* codec interrupt */
ret = twl6040_irq_init(twl6040);
if (ret)
-   goto gpio2_err;
+   goto irq_init_err;
 
ret = request_threaded_irq(twl6040-irq_base + TWL6040_IRQ_READY,
   NULL, twl6040_naudint_handler, 0,
@@ -618,10 +636,14 @@ mfd_err:
free_irq(twl6040-irq_base + TWL6040_IRQ_READY, twl6040);
 irq_err:
twl6040_irq_exit(twl6040);
-gpio2_err:
+irq_init_err:
if (gpio_is_valid(twl6040-audpwron))
gpio_free(twl6040-audpwron);
-gpio1_err:
+gpio_err:
+   regulator_bulk_disable(TWL6040_NUM_SUPPLIES, twl6040-supplies);
+power_err:
+   regulator_bulk_free(TWL6040_NUM_SUPPLIES, twl6040-supplies);
+regulator_get_err:
i2c_set_clientdata(client, NULL);
 err:
return ret;
@@ -643,6 +665,9 @@ static int __devexit twl6040_remove(struct i2c_client 
*client)
mfd_remove_devices(client-dev);
i2c_set_clientdata(client, NULL);
 
+   regulator_bulk_disable(TWL6040_NUM_SUPPLIES, twl6040-supplies);
+   regulator_bulk_free(TWL6040_NUM_SUPPLIES, twl6040-supplies);
+
return 0;
 }
 
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h
index b15b5f0..6659487 100644
--- a/include/linux/mfd/twl6040.h
+++ b/include/linux/mfd/twl6040.h
@@ -27,6 +27,7 @@
 
 #include linux/interrupt.h
 #include linux/mfd/core.h
+#include linux/regulator/consumer.h
 
 #define TWL6040_REG_ASICID 0x01
 #define TWL6040_REG_ASICREV0x02
@@ -203,6 +204,7 @@ struct regmap;
 struct twl6040 {
struct device *dev;
struct regmap *regmap;
+   struct regulator_bulk_data supplies[2]; /* supplies for vio, v2v1 */
struct mutex mutex;
struct mutex io_mutex;
struct mutex irq_mutex;
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 0/3] ARM: OMAP4: register V1V8, V2V1 regulators

2012-05-09 Thread Peter Ujfalusi
Hello,

Changes since v1:
- rebased on 3.4-rc6

Original intro message:

This series adds common configuration for the V1V8, V2V1 regulators from
twl6030. These regulators are commonly used to feed the twl6040 audio IC on
OMAP4 based boards (SDP4430, PandaBoards).

The regulator support for the twl6040 MFD driver will be going via MFD tree to
avoid cross tree issues.

Regards,
Peter
---
Peter Ujfalusi (3):
  OMAP4: twl-common: Add twl6030 V1V8, V2V1 SMPS common configuration
  OMAP: 4430SDP: Use common configuration for V1V8, V2V1 supplies
  OMAP: omap4panda: Use common configuration for V1V8, V2V1 supplies

 arch/arm/mach-omap2/board-4430sdp.c|4 ++-
 arch/arm/mach-omap2/board-omap4panda.c |4 ++-
 arch/arm/mach-omap2/twl-common.c   |   43 
 arch/arm/mach-omap2/twl-common.h   |2 +
 4 files changed, 51 insertions(+), 2 deletions(-)

-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 1/3] OMAP4: twl-common: Add twl6030 V1V8, V2V1 SMPS common configuration

2012-05-09 Thread Peter Ujfalusi
V1V8 supply from twl6030 commonly used as VIO for the machine.
V2V1 is adviced to supply the twl6040, and also to feed the twl6030's
VCXIO_IN, and VDAC_IN inputs.
Create the common regulator configurations for these regulators:
Make the V2V1 as supply_regulator for VCXIO, VDAC.
Add twl6040 (1-004b) as consumer for V1V8, and V2V1.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/twl-common.c |   43 ++
 arch/arm/mach-omap2/twl-common.h |2 +
 2 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index 7a7b893..342fb2c 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -201,6 +201,7 @@ static struct regulator_init_data omap4_vdac_idata = {
.valid_ops_mask = REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS,
},
+   .supply_regulator   = V2V1,
 };
 
 static struct regulator_init_data omap4_vaux2_idata = {
@@ -291,6 +292,7 @@ static struct regulator_init_data omap4_vcxio_idata = {
},
.num_consumer_supplies  = ARRAY_SIZE(omap4_vcxio_supply),
.consumer_supplies  = omap4_vcxio_supply,
+   .supply_regulator   = V2V1,
 };
 
 static struct regulator_init_data omap4_vusb_idata = {
@@ -310,6 +312,41 @@ static struct regulator_init_data omap4_clk32kg_idata = {
},
 };
 
+static struct regulator_consumer_supply omap4_v1v8_supply[] = {
+   REGULATOR_SUPPLY(vio, 1-004b),
+};
+
+static struct regulator_init_data omap4_v1v8_idata = {
+   .constraints = {
+   .min_uV = 180,
+   .max_uV = 180,
+   .valid_modes_mask   = REGULATOR_MODE_NORMAL
+   | REGULATOR_MODE_STANDBY,
+   .valid_ops_mask = REGULATOR_CHANGE_MODE
+   | REGULATOR_CHANGE_STATUS,
+   .always_on  = true,
+   },
+   .num_consumer_supplies  = ARRAY_SIZE(omap4_v1v8_supply),
+   .consumer_supplies  = omap4_v1v8_supply,
+};
+
+static struct regulator_consumer_supply omap4_v2v1_supply[] = {
+   REGULATOR_SUPPLY(v2v1, 1-004b),
+};
+
+static struct regulator_init_data omap4_v2v1_idata = {
+   .constraints = {
+   .min_uV = 210,
+   .max_uV = 210,
+   .valid_modes_mask   = REGULATOR_MODE_NORMAL
+   | REGULATOR_MODE_STANDBY,
+   .valid_ops_mask = REGULATOR_CHANGE_MODE
+   | REGULATOR_CHANGE_STATUS,
+   },
+   .num_consumer_supplies  = ARRAY_SIZE(omap4_v2v1_supply),
+   .consumer_supplies  = omap4_v2v1_supply,
+};
+
 void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
  u32 pdata_flags, u32 regulators_flags)
 {
@@ -350,5 +387,11 @@ void __init omap4_pmic_get_config(struct 
twl4030_platform_data *pmic_data,
if (regulators_flags  TWL_COMMON_REGULATOR_CLK32KG 
!pmic_data-clk32kg)
pmic_data-clk32kg = omap4_clk32kg_idata;
+
+   if (regulators_flags  TWL_COMMON_REGULATOR_V1V8  !pmic_data-v1v8)
+   pmic_data-v1v8 = omap4_v1v8_idata;
+
+   if (regulators_flags  TWL_COMMON_REGULATOR_V2V1  !pmic_data-v2v1)
+   pmic_data-v2v1 = omap4_v2v1_idata;
 }
 #endif /* CONFIG_ARCH_OMAP4 */
diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h
index 0962748..8fe71cf 100644
--- a/arch/arm/mach-omap2/twl-common.h
+++ b/arch/arm/mach-omap2/twl-common.h
@@ -22,6 +22,8 @@
 #define TWL_COMMON_REGULATOR_VCXIO (1  8)
 #define TWL_COMMON_REGULATOR_VUSB  (1  9)
 #define TWL_COMMON_REGULATOR_CLK32KG   (1  10)
+#define TWL_COMMON_REGULATOR_V1V8  (1  11)
+#define TWL_COMMON_REGULATOR_V2V1  (1  12)
 
 /* TWL4030 LDO regulators */
 #define TWL_COMMON_REGULATOR_VPLL1 (1  4)
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 2/3] OMAP: 4430SDP: Use common configuration for V1V8, V2V1 supplies

2012-05-09 Thread Peter Ujfalusi
These supplies going to be needed for the twl6040 driver.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-4430sdp.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index 130ab00..c8d38bd 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -615,7 +615,9 @@ static int __init omap4_i2c_init(void)
TWL_COMMON_REGULATOR_VANA |
TWL_COMMON_REGULATOR_VCXIO |
TWL_COMMON_REGULATOR_VUSB |
-   TWL_COMMON_REGULATOR_CLK32KG);
+   TWL_COMMON_REGULATOR_CLK32KG |
+   TWL_COMMON_REGULATOR_V1V8 |
+   TWL_COMMON_REGULATOR_V2V1);
omap4_pmic_init(twl6030, sdp4430_twldata,
twl6040_data, OMAP44XX_IRQ_SYS_2N);
omap_register_i2c_bus(2, 400, NULL, 0);
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 3/3] OMAP: omap4panda: Use common configuration for V1V8, V2V1 supplies

2012-05-09 Thread Peter Ujfalusi
These supplies going to be needed for the twl6040 driver.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-omap4panda.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap4panda.c 
b/arch/arm/mach-omap2/board-omap4panda.c
index 1b782ba..c47feed 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -323,7 +323,9 @@ static int __init omap4_panda_i2c_init(void)
TWL_COMMON_REGULATOR_VANA |
TWL_COMMON_REGULATOR_VCXIO |
TWL_COMMON_REGULATOR_VUSB |
-   TWL_COMMON_REGULATOR_CLK32KG);
+   TWL_COMMON_REGULATOR_CLK32KG |
+   TWL_COMMON_REGULATOR_V1V8 |
+   TWL_COMMON_REGULATOR_V2V1);
omap4_pmic_init(twl6030, omap4_panda_twldata,
twl6040_data, OMAP44XX_IRQ_SYS_2N);
omap_register_i2c_bus(2, 400, NULL, 0);
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/7] arm/dts: omap4: Add entry for OMAP McPDM IP

2012-06-08 Thread Peter Ujfalusi
McPDM is used on OMAP4 based boards to communicate with an external audio
codec (twl6040).

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/boot/dts/omap4.dtsi |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 359c497..4c43f3b 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -272,5 +272,14 @@
ti,hwmods = mmc5;
ti,needs-special-reset;
};
+
+   mcpdm: mcpdm@40132000 {
+   compatible = ti,omap4-mcpdm;
+   reg = 0x40132000 0x7f, /* MPU private access */
+ 0x49032000 0x7f; /* L3 Interconnect */
+   interrupts = 0 112 0x4;
+   interrupt-parent = gic;
+   ti,hwmods = mcpdm;
+   };
};
 };
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/7] arm/dts: omap4: Add entry for OMAP DMIC IP

2012-06-08 Thread Peter Ujfalusi
DMIC IP is used to connect up to 6 digital microphones directly to OMAP.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/boot/dts/omap4.dtsi |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 4c43f3b..fb0287d 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -281,5 +281,14 @@
interrupt-parent = gic;
ti,hwmods = mcpdm;
};
+
+   dmic: dmic@4012e000 {
+   compatible = ti,omap4-dmic;
+   reg = 0x4012e000 0x7f, /* MPU private access */
+ 0x4902e000 0x7f; /* L3 Interconnect */
+   interrupts = 0 114 0x4;
+   interrupt-parent = gic;
+   ti,hwmods = dmic;
+   };
};
 };
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/7] arm/dts: omap4-sdp: Enable audio support via device tree

2012-06-08 Thread Peter Ujfalusi
On OMAP4 SDP the audio setup includes the twl6040 codec and digital
microphones.

Since OMAP4 SDP is a reference board it has all possible audio interfaces
connected. This information is passed via the ti,audio-routing
property.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/boot/dts/omap4-sdp.dts |   35 +++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index f09d1f5..964f8ec 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -88,6 +88,41 @@
gpios = gpio5 11 0; /* 139 */
};
};
+
+   sound {
+   compatible = ti,abe-twl6040;
+   ti,model = SDP4430;
+
+   ti,jack-detection = 1;
+   ti,mclk-freq = 3840;
+
+   ti,mcpdm = mcpdm;
+   ti,dmic = dmic;
+
+   ti,twl6040 = twl6040;
+
+   /* Audio routing */
+   ti,audio-routing =
+   Headset Stereophone, HSOL,
+   Headset Stereophone, HSOR,
+   Earphone Spk, EP,
+   Ext Spk, HFL,
+   Ext Spk, HFR,
+   Line Out, AUXL,
+   Line Out, AUXR,
+   Vibrator, VIBRAL,
+   Vibrator, VIBRAR,
+   HSMIC, Headset Mic,
+   Headset Mic, Headset Mic Bias,
+   MAINMIC, Main Handset Mic,
+   Main Handset Mic, Main Mic Bias,
+   SUBMIC, Sub Handset Mic,
+   Sub Handset Mic, Main Mic Bias,
+   AFML, Line In,
+   AFMR, Line In,
+   DMic, Digital Mic,
+   Digital Mic, Digital Mic1 Bias;
+   };
 };
 
 i2c1 {
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/7] arm/dts: omap4-sdp: Add fixed regulator to represent VBAT

2012-06-08 Thread Peter Ujfalusi
There are devices connected to VBAT.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/boot/dts/omap4-sdp.dts |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index e55d42a..4b51611 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -38,6 +38,14 @@
regulator-boot-on;
};
 
+   vbat: fixedregulator@2 {
+   compatible = regulator-fixed;
+   regulator-name = VBAT;
+   regulator-min-microvolt = 375;
+   regulator-max-microvolt = 375;
+   regulator-boot-on;
+   };
+
leds {
compatible = gpio-leds;
debug0 {
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/7] arm/dts: omap4-sdp: Add support for twl6040

2012-06-08 Thread Peter Ujfalusi
The twl6040 provides the audio and vibra support on OMAP4 SDP boards.
It is connected to i2c1 bus with 0x4b address.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/boot/dts/omap4-sdp.dts |   25 +
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index 4b51611..f09d1f5 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -99,6 +99,31 @@
interrupts = 0 7 4; /* IRQ_SYS_1N cascaded to gic */
interrupt-parent = gic;
};
+
+   twl6040: twl@4b {
+   compatible = ti,twl6040;
+   reg = 0x4b;
+   /* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */
+   interrupts = 0 119 4; /* IRQ_SYS_2N cascaded to gic */
+   interrupt-parent = gic;
+   ti,audpwron-gpio = gpio4 31 0;  /* gpio line 127 */
+
+   vio-supply = v1v8;
+   v2v1-supply = v2v1;
+   enable-active-high;
+
+   /* regulators for vibra motor */
+   vddvibl-supply = vbat;
+   vddvibr-supply = vbat;
+
+   vibra {
+   /* Vibra driver, motor resistance parameters */
+   ti,vibldrv-res = 8;
+   ti,vibrdrv-res = 3;
+   ti,viblmotor-res = 10;
+   ti,vibrmotor-res = 10;
+   };
+   };
 };
 
 /include/ twl6030.dtsi
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/7] arm/dts: omap4-panda: Audio support for PandaBoard 4430

2012-06-08 Thread Peter Ujfalusi
PandaBoard uses twl6040 connected via McPDM for audio.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/boot/dts/omap4-panda.dts |   37 +
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap4-panda.dts 
b/arch/arm/boot/dts/omap4-panda.dts
index 1efe0c5..f57f5e8 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -32,6 +32,30 @@
linux,default-trigger = mmc0;
};
};
+
+   sound: sound {
+   compatible = ti,abe-twl6040;
+   ti,model = PandaBoard;
+
+   ti,mclk-freq = 3840;
+
+   ti,mcpdm = mcpdm;
+
+   ti,twl6040 = twl6040;
+
+   /* Audio routing */
+   ti,audio-routing =
+   Headset Stereophone, HSOL,
+   Headset Stereophone, HSOR,
+   Ext Spk, HFL,
+   Ext Spk, HFR,
+   Line Out, AUXL,
+   Line Out, AUXR,
+   HSMIC, Headset Mic,
+   Headset Mic, Headset Mic Bias,
+   AFML, Line In,
+   AFMR, Line In;
+   };
 };
 
 i2c1 {
@@ -43,6 +67,19 @@
interrupts = 0 7 4; /* IRQ_SYS_1N cascaded to gic */
interrupt-parent = gic;
};
+
+   twl6040: twl@4b {
+   compatible = ti,twl6040;
+   reg = 0x4b;
+   /* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */
+   interrupts = 0 119 4; /* IRQ_SYS_2N cascaded to gic */
+   interrupt-parent = gic;
+   ti,audpwron-gpio = gpio4 31 0;  /* gpio line 127 */
+
+   vio-supply = v1v8;
+   v2v1-supply = v2v1;
+   enable-active-high;
+   };
 };
 
 /include/ twl6030.dtsi
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/7] arm/dts: New dts file for PandaBoardES (4460)

2012-06-08 Thread Peter Ujfalusi
The 4430 and 4460 version of PandaBoard mostly the same with
exception at least in audio setup.
Use the omap4-panda.dts file as a base and only override the differences
between the revisions.
For audio it is the name of the sound card and the routing information.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/boot/dts/omap4-pandaES.dts |   24 
 1 files changed, 24 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap4-pandaES.dts

diff --git a/arch/arm/boot/dts/omap4-pandaES.dts 
b/arch/arm/boot/dts/omap4-pandaES.dts
new file mode 100644
index 000..d4ba43a
--- /dev/null
+++ b/arch/arm/boot/dts/omap4-pandaES.dts
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.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.
+ */
+/include/ omap4-panda.dts
+
+/* Audio routing is differnet between PandaBoard4430 and PandaBoardES */
+sound {
+   ti,model = PandaBoardES;
+
+   /* Audio routing */
+   ti,audio-routing =
+   Headset Stereophone, HSOL,
+   Headset Stereophone, HSOR,
+   Ext Spk, HFL,
+   Ext Spk, HFR,
+   Line Out, AUXL,
+   Line Out, AUXR,
+   AFML, Line In,
+   AFMR, Line In;
+};
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/7] arm/dts: Audio support for OMAP4 devices (SDP, PandaBoard)

2012-06-08 Thread Peter Ujfalusi
Hello,

The following series enable the audio functionality on OMAP4 based devices using
twl6040 as audio codec.

The series adds the needed bindings in the dts for the OMAP IPs, twl6040 MFD
device and for the audio connection on the board.

To be able to differentiate between PandaBoard and PandaBoardES (they have a bit
different audio configuration) a new dts file has been created which only
changes the audio properties different between the two boards.

Patches for the drivers involved and the documentation related to dts sections
has been either in 3.5 or heading for 3.6.

Regards,
Peter
---
Peter Ujfalusi (7):
  arm/dts: omap4: Add entry for OMAP McPDM IP
  arm/dts: omap4: Add entry for OMAP DMIC IP
  arm/dts: omap4-sdp: Add fixed regulator to represent VBAT
  arm/dts: omap4-sdp: Add support for twl6040
  arm/dts: omap4-sdp: Enable audio support via device tree
  arm/dts: omap4-panda: Audio support for PandaBoard 4430
  arm/dts: New dts file for PandaBoardES (4460)

 arch/arm/boot/dts/omap4-panda.dts   |   37 +++
 arch/arm/boot/dts/omap4-pandaES.dts |   24 
 arch/arm/boot/dts/omap4-sdp.dts |   68 +++
 arch/arm/boot/dts/omap4.dtsi|   18 +
 4 files changed, 147 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap4-pandaES.dts

-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/3] ARM: OMAP2/3: Move McBSP fck alias to hwmod data

2012-06-14 Thread Peter Ujfalusi
Hello,

To keep the McBSP fck alias handling in sync among OMAP versions.
Change the legacy implementation for OMAP2/3 regarding to McBSP fck alias.
OMAP4 (and OMAP5) uses the hwmod data to specify the aliases for the fcks and
it is also needed for the coming McBSP DT support.

Tested on OMAP3 BeagleBoard, compile tested it for OMAP2.

Regards,
Peter

---
Peter Ujfalusi (3):
  ARM: OMAP2: Move McBSP fck clock alias to hwmod data for OMAP2420
  ARM: OMAP2: Move McBSP fck clock alias to hwmod data for OMAP2430
  ARM: OMAP3: Move McBSP fck clock alias to hwmod data

 arch/arm/mach-omap2/clock2420_data.c   |4 
 arch/arm/mach-omap2/clock2430_data.c   |   10 --
 arch/arm/mach-omap2/clock3xxx_data.c   |   10 --
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |9 +
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |   15 +++
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   21 +
 6 files changed, 45 insertions(+), 24 deletions(-)

-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] ARM: OMAP2: Move McBSP fck clock alias to hwmod data for OMAP2420

2012-06-14 Thread Peter Ujfalusi
Remove the existing alias for pad_fck, prcm_fck from the clock data and
add them as opt_clks to the hwmod data.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/clock2420_data.c   |4 
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |9 +
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/clock2420_data.c 
b/arch/arm/mach-omap2/clock2420_data.c
index bace930..7e39015 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -1774,8 +1774,6 @@ static struct omap_clk omap2420_clks[] = {
CLK(NULL,   osc_ck,   osc_ck,CK_242X),
CLK(NULL,   sys_ck,   sys_ck,CK_242X),
CLK(NULL,   alt_ck,   alt_ck,CK_242X),
-   CLK(omap-mcbsp.1, pad_fck,  mcbsp_clks,CK_242X),
-   CLK(omap-mcbsp.2, pad_fck,  mcbsp_clks,CK_242X),
CLK(NULL,   mcbsp_clks,   mcbsp_clks,CK_242X),
/* internal analog sources */
CLK(NULL,   dpll_ck,  dpll_ck,   CK_242X),
@@ -1784,8 +1782,6 @@ static struct omap_clk omap2420_clks[] = {
/* internal prcm root sources */
CLK(NULL,   func_54m_ck,  func_54m_ck,   CK_242X),
CLK(NULL,   core_ck,  core_ck,   CK_242X),
-   CLK(omap-mcbsp.1, prcm_fck, func_96m_ck,   CK_242X),
-   CLK(omap-mcbsp.2, prcm_fck, func_96m_ck,   CK_242X),
CLK(NULL,   func_96m_ck,  func_96m_ck,   CK_242X),
CLK(NULL,   func_48m_ck,  func_48m_ck,   CK_242X),
CLK(NULL,   func_12m_ck,  func_12m_ck,   CK_242X),
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c 
b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index a7640d1..910d256 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -192,6 +192,11 @@ static struct omap_hwmod_class omap2420_mcbsp_hwmod_class 
= {
.name = mcbsp,
 };
 
+static struct omap_hwmod_opt_clk mcbsp_opt_clks[] = {
+   { .role = pad_fck, .clk = mcbsp_clks },
+   { .role = prcm_fck, .clk = func_96m_ck },
+};
+
 /* mcbsp1 */
 static struct omap_hwmod_irq_info omap2420_mcbsp1_irqs[] = {
{ .name = tx, .irq = 59 },
@@ -214,6 +219,8 @@ static struct omap_hwmod omap2420_mcbsp1_hwmod = {
.idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT,
},
},
+   .opt_clks   = mcbsp_opt_clks,
+   .opt_clks_cnt   = ARRAY_SIZE(mcbsp_opt_clks),
 };
 
 /* mcbsp2 */
@@ -238,6 +245,8 @@ static struct omap_hwmod omap2420_mcbsp2_hwmod = {
.idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT,
},
},
+   .opt_clks   = mcbsp_opt_clks,
+   .opt_clks_cnt   = ARRAY_SIZE(mcbsp_opt_clks),
 };
 
 static struct omap_hwmod_class_sysconfig omap2420_msdi_sysc = {
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] ARM: OMAP2: Move McBSP fck clock alias to hwmod data for OMAP2430

2012-06-14 Thread Peter Ujfalusi
Remove the existing alias for pad_fck, prcm_fck from the clock data and
add them as opt_clks to the hwmod data.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/clock2430_data.c   |   10 --
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |   15 +++
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/clock2430_data.c 
b/arch/arm/mach-omap2/clock2430_data.c
index 3b4d09a..90a08c3 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -1858,11 +1858,6 @@ static struct omap_clk omap2430_clks[] = {
CLK(NULL,   osc_ck,   osc_ck,CK_243X),
CLK(NULL,   sys_ck,   sys_ck,CK_243X),
CLK(NULL,   alt_ck,   alt_ck,CK_243X),
-   CLK(omap-mcbsp.1, pad_fck,  mcbsp_clks,CK_243X),
-   CLK(omap-mcbsp.2, pad_fck,  mcbsp_clks,CK_243X),
-   CLK(omap-mcbsp.3, pad_fck,  mcbsp_clks,CK_243X),
-   CLK(omap-mcbsp.4, pad_fck,  mcbsp_clks,CK_243X),
-   CLK(omap-mcbsp.5, pad_fck,  mcbsp_clks,CK_243X),
CLK(NULL,   mcbsp_clks,   mcbsp_clks,CK_243X),
/* internal analog sources */
CLK(NULL,   dpll_ck,  dpll_ck,   CK_243X),
@@ -1871,11 +1866,6 @@ static struct omap_clk omap2430_clks[] = {
/* internal prcm root sources */
CLK(NULL,   func_54m_ck,  func_54m_ck,   CK_243X),
CLK(NULL,   core_ck,  core_ck,   CK_243X),
-   CLK(omap-mcbsp.1, prcm_fck, func_96m_ck,   CK_243X),
-   CLK(omap-mcbsp.2, prcm_fck, func_96m_ck,   CK_243X),
-   CLK(omap-mcbsp.3, prcm_fck, func_96m_ck,   CK_243X),
-   CLK(omap-mcbsp.4, prcm_fck, func_96m_ck,   CK_243X),
-   CLK(omap-mcbsp.5, prcm_fck, func_96m_ck,   CK_243X),
CLK(NULL,   func_96m_ck,  func_96m_ck,   CK_243X),
CLK(NULL,   func_48m_ck,  func_48m_ck,   CK_243X),
CLK(NULL,   func_12m_ck,  func_12m_ck,   CK_243X),
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c 
b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 4d72649..f105314 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -296,6 +296,11 @@ static struct omap_hwmod_class omap2430_mcbsp_hwmod_class 
= {
.rev  = MCBSP_CONFIG_TYPE2,
 };
 
+static struct omap_hwmod_opt_clk mcbsp_opt_clks[] = {
+   { .role = pad_fck, .clk = mcbsp_clks },
+   { .role = prcm_fck, .clk = func_96m_ck },
+};
+
 /* mcbsp1 */
 static struct omap_hwmod_irq_info omap2430_mcbsp1_irqs[] = {
{ .name = tx, .irq = 59 },
@@ -320,6 +325,8 @@ static struct omap_hwmod omap2430_mcbsp1_hwmod = {
.idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT,
},
},
+   .opt_clks   = mcbsp_opt_clks,
+   .opt_clks_cnt   = ARRAY_SIZE(mcbsp_opt_clks),
 };
 
 /* mcbsp2 */
@@ -345,6 +352,8 @@ static struct omap_hwmod omap2430_mcbsp2_hwmod = {
.idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT,
},
},
+   .opt_clks   = mcbsp_opt_clks,
+   .opt_clks_cnt   = ARRAY_SIZE(mcbsp_opt_clks),
 };
 
 /* mcbsp3 */
@@ -370,6 +379,8 @@ static struct omap_hwmod omap2430_mcbsp3_hwmod = {
.idlest_idle_bit = OMAP2430_ST_MCBSP3_SHIFT,
},
},
+   .opt_clks   = mcbsp_opt_clks,
+   .opt_clks_cnt   = ARRAY_SIZE(mcbsp_opt_clks),
 };
 
 /* mcbsp4 */
@@ -401,6 +412,8 @@ static struct omap_hwmod omap2430_mcbsp4_hwmod = {
.idlest_idle_bit = OMAP2430_ST_MCBSP4_SHIFT,
},
},
+   .opt_clks   = mcbsp_opt_clks,
+   .opt_clks_cnt   = ARRAY_SIZE(mcbsp_opt_clks),
 };
 
 /* mcbsp5 */
@@ -432,6 +445,8 @@ static struct omap_hwmod omap2430_mcbsp5_hwmod = {
.idlest_idle_bit = OMAP2430_ST_MCBSP5_SHIFT,
},
},
+   .opt_clks   = mcbsp_opt_clks,
+   .opt_clks_cnt   = ARRAY_SIZE(mcbsp_opt_clks),
 };
 
 /* MMC/SD/SDIO common */
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] ARM: OMAP3: Move McBSP fck clock alias to hwmod data

2012-06-14 Thread Peter Ujfalusi
Remove the existing alias for pad_fck, prcm_fck from the clock data and
add them as opt_clks to the hwmod data.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/clock3xxx_data.c   |   10 --
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   21 +
 2 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 4e1a3b0..d6889b5 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3236,11 +3236,6 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL,   osc_sys_ck,   osc_sys_ck,CK_3XXX),
CLK(NULL,   sys_ck,   sys_ck,CK_3XXX),
CLK(NULL,   sys_altclk,   sys_altclk,CK_3XXX),
-   CLK(omap-mcbsp.1, pad_fck,  mcbsp_clks,CK_3XXX),
-   CLK(omap-mcbsp.2, pad_fck,  mcbsp_clks,CK_3XXX),
-   CLK(omap-mcbsp.3, pad_fck,  mcbsp_clks,CK_3XXX),
-   CLK(omap-mcbsp.4, pad_fck,  mcbsp_clks,CK_3XXX),
-   CLK(omap-mcbsp.5, pad_fck,  mcbsp_clks,CK_3XXX),
CLK(NULL,   mcbsp_clks,   mcbsp_clks,CK_3XXX),
CLK(NULL,   sys_clkout1,  sys_clkout1,   CK_3XXX),
CLK(NULL,   dpll1_ck, dpll1_ck,  CK_3XXX),
@@ -3307,8 +3302,6 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL,   ts_fck,   ts_fck,CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
CLK(NULL,   usbtll_fck,   usbtll_fck,CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
CLK(usbhs_omap,   usbtll_fck,   usbtll_fck,CK_3430ES2PLUS 
| CK_AM35XX | CK_36XX),
-   CLK(omap-mcbsp.1, prcm_fck, core_96m_fck,  CK_3XXX),
-   CLK(omap-mcbsp.5, prcm_fck, core_96m_fck,  CK_3XXX),
CLK(NULL,   core_96m_fck, core_96m_fck,  CK_3XXX),
CLK(NULL,   mmchs3_fck,   mmchs3_fck,CK_3430ES2PLUS | 
CK_AM35XX | CK_36XX),
CLK(NULL,   mmchs2_fck,   mmchs2_fck,CK_3XXX),
@@ -3413,9 +3406,6 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL,   omap_32ksync_ick, omap_32ksync_ick, CK_3XXX),
CLK(NULL,   gpt12_ick,gpt12_ick, CK_3XXX),
CLK(NULL,   gpt1_ick, gpt1_ick,  CK_3XXX),
-   CLK(omap-mcbsp.2, prcm_fck, per_96m_fck,   CK_3XXX),
-   CLK(omap-mcbsp.3, prcm_fck, per_96m_fck,   CK_3XXX),
-   CLK(omap-mcbsp.4, prcm_fck, per_96m_fck,   CK_3XXX),
CLK(NULL,   per_96m_fck,  per_96m_fck,   CK_3XXX),
CLK(NULL,   per_48m_fck,  per_48m_fck,   CK_3XXX),
CLK(NULL,   uart3_fck,uart3_fck, CK_3XXX),
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index b26d3c9..7ac0511 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -1074,6 +1074,17 @@ static struct omap_hwmod_class 
omap3xxx_mcbsp_hwmod_class = {
.rev  = MCBSP_CONFIG_TYPE3,
 };
 
+/* McBSP functional clock mapping */
+static struct omap_hwmod_opt_clk mcbsp15_opt_clks[] = {
+   { .role = pad_fck, .clk = mcbsp_clks },
+   { .role = prcm_fck, .clk = core_96m_fck },
+};
+
+static struct omap_hwmod_opt_clk mcbsp234_opt_clks[] = {
+   { .role = pad_fck, .clk = mcbsp_clks },
+   { .role = prcm_fck, .clk = per_96m_fck },
+};
+
 /* mcbsp1 */
 static struct omap_hwmod_irq_info omap3xxx_mcbsp1_irqs[] = {
{ .name = common, .irq = 16 },
@@ -1097,6 +1108,8 @@ static struct omap_hwmod omap3xxx_mcbsp1_hwmod = {
.idlest_idle_bit = OMAP3430_ST_MCBSP1_SHIFT,
},
},
+   .opt_clks   = mcbsp15_opt_clks,
+   .opt_clks_cnt   = ARRAY_SIZE(mcbsp15_opt_clks),
 };
 
 /* mcbsp2 */
@@ -1126,6 +1139,8 @@ static struct omap_hwmod omap3xxx_mcbsp2_hwmod = {
.idlest_idle_bit = OMAP3430_ST_MCBSP2_SHIFT,
},
},
+   .opt_clks   = mcbsp234_opt_clks,
+   .opt_clks_cnt   = ARRAY_SIZE(mcbsp234_opt_clks),
.dev_attr   = omap34xx_mcbsp2_dev_attr,
 };
 
@@ -1156,6 +1171,8 @@ static struct omap_hwmod omap3xxx_mcbsp3_hwmod = {
.idlest_idle_bit = OMAP3430_ST_MCBSP3_SHIFT,
},
},
+   .opt_clks   = mcbsp234_opt_clks,
+   .opt_clks_cnt   = ARRAY_SIZE(mcbsp234_opt_clks),
.dev_attr   = omap34xx_mcbsp3_dev_attr,
 };
 
@@ -1188,6 +1205,8 @@ static struct omap_hwmod omap3xxx_mcbsp4_hwmod = {
.idlest_idle_bit = OMAP3430_ST_MCBSP4_SHIFT,
},
},
+   .opt_clks   = mcbsp234_opt_clks,
+   .opt_clks_cnt   = ARRAY_SIZE(mcbsp234_opt_clks),
 };
 
 /* mcbsp5 */
@@ -1219,6 +1238,8 @@ static struct omap_hwmod omap3xxx_mcbsp5_hwmod = {
.idlest_idle_bit = OMAP3430_ST_MCBSP5_SHIFT,
},
},
+   .opt_clks

[PATCH] ARM: OMAP2: twl-common: Fix compiler warning

2012-06-15 Thread Peter Ujfalusi
If the kernel is built only for OMAP2 the following warning will show up:

arch/arm/mach-omap2/twl-common.c:52: warning: ‘twl_set_voltage’ defined but not 
used
arch/arm/mach-omap2/twl-common.c:58: warning: ‘twl_get_voltage’ defined but not 
used

The twl_set/get_voltage callbacks only used when OMAP3/4 is selected.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/twl-common.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index 119d5a9..5447c13 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -48,6 +48,7 @@ static struct i2c_board_info __initdata 
omap4_i2c1_board_info[] = {
},
 };
 
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
 static int twl_set_voltage(void *data, int target_uV)
 {
struct voltagedomain *voltdm = (struct voltagedomain *)data;
@@ -59,6 +60,7 @@ static int twl_get_voltage(void *data)
struct voltagedomain *voltdm = (struct voltagedomain *)data;
return voltdm_get_voltage(voltdm);
 }
+#endif
 
 void __init omap_pmic_init(int bus, u32 clkrate,
   const char *pmic_type, int pmic_irq,
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] MFD: twl4030-codec: Update e-mail address

2011-05-09 Thread Peter Ujfalusi
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 drivers/mfd/twl4030-codec.c   |3 ++-
 include/linux/mfd/twl4030-codec.h |1 +
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/twl4030-codec.c b/drivers/mfd/twl4030-codec.c
index c02fded..3641a6f 100644
--- a/drivers/mfd/twl4030-codec.c
+++ b/drivers/mfd/twl4030-codec.c
@@ -2,6 +2,7 @@
  * MFD driver for twl4030 codec submodule
  *
  * Author: Peter Ujfalusi peter.ujfal...@nokia.com
+ * Contact:Peter Ujfalusi peter.ujfal...@ti.com
  *
  * Copyright:   (C) 2009 Nokia Corporation
  *
@@ -270,6 +271,6 @@ static void __devexit twl4030_codec_exit(void)
 }
 module_exit(twl4030_codec_exit);
 
-MODULE_AUTHOR(Peter Ujfalusi peter.ujfal...@nokia.com);
+MODULE_AUTHOR(Peter Ujfalusi peter.ujfal...@ti.com);
 MODULE_LICENSE(GPL);
 
diff --git a/include/linux/mfd/twl4030-codec.h 
b/include/linux/mfd/twl4030-codec.h
index 2ec317c..89a6820 100644
--- a/include/linux/mfd/twl4030-codec.h
+++ b/include/linux/mfd/twl4030-codec.h
@@ -2,6 +2,7 @@
  * MFD driver for twl4030 codec submodule
  *
  * Author: Peter Ujfalusi peter.ujfal...@nokia.com
+ * Contact:Peter Ujfalusi peter.ujfal...@ti.com
  *
  * Copyright:   (C) 2009 Nokia Corporation
  *
-- 
1.7.5.rc3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] MFD: twl4030-codec: Update e-mail address

2011-05-09 Thread Peter Ujfalusi
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---

Hello,

Instead of keeping the old Nokia mail address, just change it to my new
email address in the author line.

 drivers/mfd/twl4030-codec.c   |4 ++--
 include/linux/mfd/twl4030-codec.h |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/twl4030-codec.c b/drivers/mfd/twl4030-codec.c
index c02fded..534cc2e 100644
--- a/drivers/mfd/twl4030-codec.c
+++ b/drivers/mfd/twl4030-codec.c
@@ -1,7 +1,7 @@
 /*
  * MFD driver for twl4030 codec submodule
  *
- * Author: Peter Ujfalusi peter.ujfal...@nokia.com
+ * Author: Peter Ujfalusi peter.ujfal...@ti.com
  *
  * Copyright:   (C) 2009 Nokia Corporation
  *
@@ -270,6 +270,6 @@ static void __devexit twl4030_codec_exit(void)
 }
 module_exit(twl4030_codec_exit);
 
-MODULE_AUTHOR(Peter Ujfalusi peter.ujfal...@nokia.com);
+MODULE_AUTHOR(Peter Ujfalusi peter.ujfal...@ti.com);
 MODULE_LICENSE(GPL);
 
diff --git a/include/linux/mfd/twl4030-codec.h 
b/include/linux/mfd/twl4030-codec.h
index 2ec317c..5cc16bb 100644
--- a/include/linux/mfd/twl4030-codec.h
+++ b/include/linux/mfd/twl4030-codec.h
@@ -1,7 +1,7 @@
 /*
  * MFD driver for twl4030 codec submodule
  *
- * Author: Peter Ujfalusi peter.ujfal...@nokia.com
+ * Author: Peter Ujfalusi peter.ujfal...@ti.com
  *
  * Copyright:   (C) 2009 Nokia Corporation
  *
-- 
1.7.5.rc3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [alsa-devel] [PATCH] ASoC: omap-mcbsp: Remove restrictive checks for cpu type

2011-05-11 Thread Peter Ujfalusi
On Wednesday 11 May 2011 16:55:35 Premi, Sanjeev wrote:
 Current checks for cpu type were too restrictive leading
 to failures for other silicons in same family.
 
 The problem was found while testing audio playback on
 AM37x and AM35x processors. But should exist on OMAP36xx
 as well.
 
 Signed-off-by: Sanjeev Premi pr...@ti.com
 cc: Mark Brown broo...@opensource.wolfsonmicro.com
 cc: Liam Girdwood l...@ti.com
 cc: Jarkko Nikula jhnik...@gmail.com
 ---

Acked-by: Peter Ujfalusi peter.ujfal...@ti.com
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: beagleboardxm 2.6.39rc4 mcbsp problems.

2011-05-16 Thread Peter Ujfalusi
On Saturday 14 May 2011 05:47:33 Steve Calfee wrote:
 I put in a few debug statements. It appears that my DMA never gets
 started. I know it can work with a different machine and codec driver,
 but not mine. I don't see any explicit DMA init, but that must be the
 problem.  Any more ideas?

You mean neither omap_pcm_hw_params nor omap_pcm_trigger got called?
Could you post the output of dmesg related to ASoC? Does the connection 
between the CPU and codec DAI correct?
Does McBSP part got initialized (for example does omap_mcbsp_dai_hw_params, 
omap_mcbsp_dai_trigger got called)?

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] OMAP4: McBSP: Clear rx_irq at probe time

2011-05-17 Thread Peter Ujfalusi
On OMAP4 we have one interrupt line per McBSP port.
At proble time tx, and rx irq value will be -ENXIO,
and only the tx irq will get corrected.
In omap_mcbsp_request if the rx_irq is not 0 we proceed,
and try to request the interrupt, which will fail on
OMAP4 (rx_irq == -6).
To avoid this error, clear the rx_irq at probe time
on OMAP4.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/plat-omap/mcbsp.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index 5587acf..1e4e32e 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -1867,8 +1867,10 @@ static int __devinit omap_mcbsp_probe(struct 
platform_device *pdev)
mcbsp-rx_irq = platform_get_irq_byname(pdev, rx);
 
/* From OMAP4 there will be a single irq line */
-   if (mcbsp-tx_irq == -ENXIO)
+   if (mcbsp-tx_irq == -ENXIO) {
mcbsp-tx_irq = platform_get_irq(pdev, 0);
+   mcbsp-rx_irq = 0;
+   }
 
res = platform_get_resource_byname(pdev, IORESOURCE_DMA, rx);
if (!res) {
-- 
1.7.5.rc3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: beagleboardxm 2.6.39rc4 mcbsp problems.

2011-05-17 Thread Peter Ujfalusi
Hi,

On Monday 16 May 2011 21:07:40 Steve Calfee wrote:
 No, they get called. I just don't get the clock on the bclk pin.

OK.
Could you try to disconnect the CLKX, and FSX lines from OMAP, and see that 
you have the clocks on the codec side?
If in this way you still can not see the clocks, than your codec (max98095 ?) 
is not generating the clocks.
Could you also post from your machine driver how you configure the formats for 
cpu/codec DAI (snd_soc_dai_set_fmt call)?

While the clock lines are not physically connected, you can try to configure 
either side to generate the correct clocks on the lines. When you see that, 
you can connect them together, and see (hear) if it works.

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] OMAP4: HDMI: Add OMAP device for HDMI audio CPU DAI

2011-05-17 Thread Peter Ujfalusi
On Tuesday 17 May 2011 22:35:09 Steve Calfee wrote:
 I think the generally accepted method of doing stuff like this is to
 have the ifdeffery in a header file where a inline code segment is
 defined if it applies to the processor being built. If the code does not
 apply to the model being built, a null #define is used, which does not
 take any space.

We have for example omap2plus_defconfig, which include support for wide range 
of OMAP based devices, with different CPUs (OMAP2/3/4).
So we need to have runtime distinction of the CPU we are running (since we run 
the same kernel binary on OMAP2/3/4).

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] OMAP4: McBSP: Clear rx_irq at probe time

2011-05-17 Thread Peter Ujfalusi
On Tuesday 17 May 2011 15:57:00 Tony Lindgren wrote:
 This file should be under drivers/ somewhere, can you
 guys please take care of that?

Yeah, this has been discussed several times, and we have not reached agreement 
where to move this very OMAP specific code.
One option was to move it under sound/soc/omap/ , since currently the only 
user for mcbsp is audio.
But McBSP is really versatile beast, it can be used for other things (for 
example it can handle SPI bus as well), so if we move it under ASoC, we are 
going to limit/block other use of these pins.
We can not just cp arc/arm/plat-omap/mcbsp.c drivers/wherever...
If we do that, we need to move it under some framework, or create a new one 
(bus driver?), which might be a bit tricky since we have special use of McBSP 
from audio side, this does not really fit the bus mode. Other uses of McBSP 
might be happy with the bus driver conversion, but we just do not have those.

IMHO the only place we can move this is under sound/soc/omap/ , but who can 
decide, that the McBSP can only be used for audio??

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] OMAP4: McBSP: Clear rx_irq at probe time

2011-05-18 Thread Peter Ujfalusi
Hi Tony,

On Tuesday 17 May 2011 15:57:00 Tony Lindgren wrote:
 This file should be under drivers/ somewhere, can you
 guys please take care of that?

Do you have a place in mind?
We have several things under arch/arm/plat-omap, like i2c, dma, fb, gpio, 
mcbsp, usb...
Should we create a directory for omap specific drivers under drivers?
For example drivers/omap/ and move the mcbsp there first, without any API 
change?
If needed we can think of changing the interface within McBSP if it is needed 
for other use later.
IMHO invention a common framework (as Jarkko was suggesting) for similar 
interfaces need more work, and synchronization between other platforms.

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: beagleboardxm 2.6.39rc4 mcbsp problems.

2011-05-19 Thread Peter Ujfalusi
Hi,

On Thursday 19 May 2011 03:30:51 Steve Calfee wrote:
 On 05/17/11 03:42, Peter Ujfalusi wrote:
 Good suggestion. After switching to my codec as master, I could see the
 clocks. But one problem was the beagleboardxm trainer has level
 shifters, but they are one directional, and not correct for my use. So I
 reconnected to the expansion port pins (and re-did the voltage
 requirement of the codec to 1.8 volts). Now I get some sound.

Great, we are getting closer.

...

 My codec cannot be set to use only 16 bits per phase. Is there a way to
 setup the omap so that data is sent to both channels? As you can see
 above the xphase bit is one saying dual channels. Is this a dma setup
 problem?

I can not find datasheet for the max98095...
So you can not configure the codec to use 2x16 number of bit clocks. when it 
is configured to receive/send 16bit stereo samples?
Is this the case (that the codec all the time have 32 clock cycles per 
channel)? 

If this is the case, than it is kind of tricky to get around this, but you can 
try the following (warning: hack):

In the codec driver:
create/add a startup callback function for the dais (snd_soc_dai_ops):

static int max98095_startup(struct snd_pcm_substream *substream,
   struct snd_soc_dai *dai)
{
snd_pcm_hw_constraint_msbits(substream-runtime, 0, 32, 16);

return 0;
}

Modify the MAX98095_FORMATS to only support S32_LE (remove the other formats 
for now)

In the hw_params calls handle the S32_LE in a same way as you handle the 
S16_LE.

To explain what we are doing:
Configure the codec to support only S32_LE format, but tell ALSA, that out of 
the 32 bit only the first 16bit is valid.
So the driver will be opened with S32_LE mode, but only the first 16 bits will 
have audio data:
0-15: Left audio
16-31: zero (padding on left channel)
32-47: Right audio
48-63: zero (padding on right channel)

Use aplay -Dplughw:0,0 -v some sample to play audio, and see, if the HW has 
been opened with S32_LE.

You should have full stereo sound now.

I have CC-d the author of the wm98095 codec driver, hi might be able to help 
you with the codec setup...

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: beagleboardxm 2.6.39rc4 mcbsp problems.

2011-05-20 Thread Peter Ujfalusi
On Friday 20 May 2011 02:58:30 Steve Calfee wrote:
 On 05/19/11 04:28, Peter Ujfalusi wrote:
 Correct, I can set bit clock to 64*lrclk, 48*lrclk, 128*lrclk, 17*lrclk,
 and 18*lrclk.

Strange, that there is no option for 32*lrclk.

 The audio folks here think that it is normal to send more
 than required bit clocks, data is sent first so just ignore the rest.

Yes, it is allowed. The rest should be ignored.
But I'm afraid, OMAP McBSP can not handle this in a way you (and me) wanted 
to.

 It would appear that the mcbsp doesn't really use the lrclk (I think
 called FSX), it just uses a positive transition to start the bit
 shifting for all the requested bits. The falling edge does not start the
 right channel, the shifter keeps going until all requested l/r counts
 have been sent.

Yeah, McBSP only cares about the start condition, it does not care about the 
right channel FSX transition.
This is the reason it is not possible to handle the scenario you are aiming 
for.
At start condition, it just start to send the data stream (frame1 followed by 
frame2 in dual-phase mode - in single phase mode it can send up to 128 
frames).
Having said that, there might be a way to actually work this around with 
McBSP's multichannel mode. Configuring it for 4 slots, and only shift data for 
slot 0, and 2 in case of your setup (16bit data within 32 bitclocks).
It is a long shot, I can not promise that I can take a look right away, but if 
you have time ;)

  You should have full stereo sound now.
 
 I do, thanks.

Cool :D

 I am truly amazed that I was able to follow your
 instructions and get it to work first time. You must really know your
 alsa machine implementation.

Thanks, I try.

 The problem is that now I cannot run 44.1Khz audio, I get underruns. I
 am guessing that software is expanding the samples from 16 bits to 32?
 Without your hack 44.1Khz audio works fine (but only audible in the
 first channel).

Hmm. I have used similar mode with twl4030, and tlv320dac33 (S32_LE with 
24msbits) without issues with underrun. Let's see.
Can you check /sys/devices/platform/omap-mcbsp.X/dma_op_mode, max_tx_thres for 
your McBSP port?
I would suggest to switch the dma_op_mode to threshold mode in any port.

When you play audio try to use bigger periods, something like 10ms:
aplay -Dplughw:0,0 --period-time=1 -v your sample

Replace the -Dplughw:0,0 to point to the wm98095 PCM.

Could you post the output of aplay?

 I talk to Peter every day. He brought up the codec, I am trying to use
 the Beagleboardxm as a generic Linux platform for new codec bringups and
 for following kernel and alsa cutting edge software.

Make sense..

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: beagleboardxm 2.6.39rc4 mcbsp problems.

2011-05-20 Thread Peter Ujfalusi
Hi,

On Friday 20 May 2011 09:29:11 Jarkko Nikula wrote:
 This very likely sounds that in master mode the master clock to McBSP is
 missing if there is no DMA running.

If the clock setup is correct for McBSP, than it runs the clocks, and shifts 
out data.

 Did you try to use internal 96 MHz
 from my example or did you try to use external CLKS what Pandora is
 using? That CLKS setup in Pandora requires that there is a clock coming
 to McBSP CLKS pin.

Really good point. PRCM/CORE (depending on the McBSP port) 96M_FCLK must be 
used here.

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/8] MFD/ASoC: TWL4030/TWL6040 changes

2011-06-01 Thread Peter Ujfalusi
Hello,

The series will do three major things, and they are in one series, because they
pretty much depending on each other, so it is easier to handle them together.

1. Rename the twl4030-codec MFD driver to twl4030-audio
Since the ASoC multicomponent introduction (2.6.37) the twl4030-codec MFD dirver
had been using twl4030-audio to register (twl4030-codec is the ASoC codec
driver). The documentation refers to this part of twl as audio block, so it is
better to rename the driver as well to avoid confusion.

2. Introduction of MFD driver for twl6040.
The TWL6040 audio IC has codec and vibra functionality.
Convert the existing ASoC codec driver to use the new MFD driver's interface.

3. Vibrator driver for TWL6040 (Input/ForceFeedback driver)
The driver itself, and support for the vibrators in SDP4430 board.

The series has been tested on top of merged omap-next, asoc-next, and mfd-next.
It applies on top of linux-next as well.

Regards,
Peter

---
Misael Lopez Cruz (3):
  mfd: twl6040: Add initial support
  ASoC: twl6040: Convert into TWL6040 MFD child
  input: Add initial support for TWL6040 vibrator

Peter Ujfalusi (5):
  MFD: twl4030-codec: Rename internals from codec to audio
  MFD: twl4030-codec - twl4030-audio: Rename the driver
  MFD: twl4030-audio: Rename platform data
  MFD: twl6040: Change platform data for soc codec driver
  OMAP4: SDP4430: Add twl6040 vibrator platform support

 arch/arm/mach-omap2/board-3430sdp.c  |8 +-
 arch/arm/mach-omap2/board-4430sdp.c  |   50 +++-
 arch/arm/mach-omap2/board-devkit8000.c   |8 +-
 arch/arm/mach-omap2/board-igep0020.c |8 +-
 arch/arm/mach-omap2/board-omap3beagle.c  |8 +-
 arch/arm/mach-omap2/board-omap3evm.c |8 +-
 arch/arm/mach-omap2/board-omap3pandora.c |8 +-
 arch/arm/mach-omap2/board-omap3stalker.c |8 +-
 arch/arm/mach-omap2/board-omap3touchbook.c   |8 +-
 arch/arm/mach-omap2/board-overo.c|8 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c |6 +-
 arch/arm/mach-omap2/board-zoom-peripherals.c |   14 +-
 arch/arm/plat-omap/include/plat/irqs.h   |   12 +-
 drivers/input/misc/Kconfig   |   13 +-
 drivers/input/misc/Makefile  |1 +
 drivers/input/misc/twl4030-vibra.c   |   12 +-
 drivers/input/misc/twl6040-vibra.c   |  428 +++
 drivers/mfd/Kconfig  |8 +-
 drivers/mfd/Makefile |3 +-
 drivers/mfd/twl-core.c   |   13 +-
 drivers/mfd/twl4030-audio.c  |  278 
 drivers/mfd/twl4030-codec.c  |  277 
 drivers/mfd/twl6040-core.c   |  588 ++
 drivers/mfd/twl6040-irq.c|  205 +
 include/linux/i2c/twl.h  |   21 +-
 include/linux/mfd/twl4030-audio.h|  272 
 include/linux/mfd/twl4030-codec.h|  272 
 include/linux/mfd/twl6040.h  |  260 
 sound/soc/codecs/Kconfig |3 +-
 sound/soc/codecs/twl4030.c   |   22 +-
 sound/soc/codecs/twl6040.c   |  426 ---
 sound/soc/codecs/twl6040.h   |  118 -
 sound/soc/omap/sdp3430.c |2 +-
 sound/soc/omap/sdp4430.c |2 +
 sound/soc/omap/zoom2.c   |2 +-
 35 files changed, 2290 insertions(+), 1090 deletions(-)
 create mode 100644 drivers/input/misc/twl6040-vibra.c
 create mode 100644 drivers/mfd/twl4030-audio.c
 delete mode 100644 drivers/mfd/twl4030-codec.c
 create mode 100644 drivers/mfd/twl6040-core.c
 create mode 100644 drivers/mfd/twl6040-irq.c
 create mode 100644 include/linux/mfd/twl4030-audio.h
 delete mode 100644 include/linux/mfd/twl4030-codec.h
 create mode 100644 include/linux/mfd/twl6040.h

-- 
1.7.5.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/8] MFD: twl4030-audio: Rename platform data

2011-06-01 Thread Peter Ujfalusi
Allign the platform data names for twl4030 audio submodule:
twl4030_audio_data: for the core MFD driver
twl4030_codec_data: for ASoC codec driver
twl4030_vibra_data: for the input/ForceFeedback driver

To avoid breakage, change all depending drivers, files
to use the new types.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-3430sdp.c  |8 
 arch/arm/mach-omap2/board-devkit8000.c   |8 
 arch/arm/mach-omap2/board-igep0020.c |8 
 arch/arm/mach-omap2/board-omap3beagle.c  |8 
 arch/arm/mach-omap2/board-omap3evm.c |8 
 arch/arm/mach-omap2/board-omap3pandora.c |8 
 arch/arm/mach-omap2/board-omap3stalker.c |8 
 arch/arm/mach-omap2/board-omap3touchbook.c   |8 
 arch/arm/mach-omap2/board-overo.c|8 
 arch/arm/mach-omap2/board-rx51-peripherals.c |6 +++---
 arch/arm/mach-omap2/board-zoom-peripherals.c |   14 +++---
 drivers/input/misc/twl4030-vibra.c   |2 +-
 drivers/mfd/twl-core.c   |8 
 drivers/mfd/twl4030-audio.c  |8 
 include/linux/i2c/twl.h  |   12 ++--
 sound/soc/codecs/twl4030.c   |6 +++---
 sound/soc/codecs/twl6040.c   |2 +-
 17 files changed, 65 insertions(+), 65 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index ae2963a..36fb018 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -463,11 +463,11 @@ static struct regulator_init_data sdp3430_vpll2 = {
.consumer_supplies  = sdp3430_vpll2_supplies,
 };
 
-static struct twl4030_codec_audio_data sdp3430_audio;
+static struct twl4030_codec_data sdp3430_codec;
 
-static struct twl4030_codec_data sdp3430_codec = {
+static struct twl4030_audio_data sdp3430_audio = {
.audio_mclk = 2600,
-   .audio = sdp3430_audio,
+   .codec = sdp3430_codec,
 };
 
 static struct twl4030_platform_data sdp3430_twldata = {
@@ -480,7 +480,7 @@ static struct twl4030_platform_data sdp3430_twldata = {
.madc   = sdp3430_madc_data,
.keypad = sdp3430_kp_data,
.usb= sdp3430_usb_data,
-   .codec  = sdp3430_codec,
+   .audio  = sdp3430_audio,
 
.vaux1  = sdp3430_vaux1,
.vaux2  = sdp3430_vaux2,
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index cf520d7..3a83bc4 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -337,11 +337,11 @@ static struct twl4030_usb_data devkit8000_usb_data = {
.usb_mode   = T2_USB_MODE_ULPI,
 };
 
-static struct twl4030_codec_audio_data devkit8000_audio_data;
+static struct twl4030_codec_data devkit8000_codec_data;
 
-static struct twl4030_codec_data devkit8000_codec_data = {
+static struct twl4030_audio_data devkit8000_audio_data = {
.audio_mclk = 2600,
-   .audio = devkit8000_audio_data,
+   .codec = devkit8000_codec_data,
 };
 
 static struct twl4030_platform_data devkit8000_twldata = {
@@ -351,7 +351,7 @@ static struct twl4030_platform_data devkit8000_twldata = {
/* platform_data for children goes here */
.usb= devkit8000_usb_data,
.gpio   = devkit8000_gpio_data,
-   .codec  = devkit8000_codec_data,
+   .audio  = devkit8000_audio_data,
.vmmc1  = devkit8000_vmmc1,
.vdac   = devkit8000_vdac,
.vpll1  = devkit8000_vpll1,
diff --git a/arch/arm/mach-omap2/board-igep0020.c 
b/arch/arm/mach-omap2/board-igep0020.c
index 0c1bfca..89d3999 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -519,11 +519,11 @@ static void __init igep_init_early(void)
  m65kam_sdrc_params);
 }
 
-static struct twl4030_codec_audio_data igep2_audio_data;
+static struct twl4030_codec_data igep2_codec_data;
 
-static struct twl4030_codec_data igep2_codec_data = {
+static struct twl4030_audio_data igep2_audio_data = {
.audio_mclk = 2600,
-   .audio = igep2_audio_data,
+   .codec = igep2_codec_data,
 };
 
 static int igep2_keymap[] = {
@@ -588,7 +588,7 @@ static void __init igep_i2c_init(void)
if (ret)
pr_warning(IGEP2: Could not register I2C3 bus (%d)\n, 
ret);
 
-   igep_twldata.codec  = igep2_codec_data;
+   igep_twldata.audio  = igep2_audio_data;
igep_twldata.keypad = igep2_keypad_pdata;
igep_twldata.vpll2  = igep2_vpll2;
}
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index be71426..d8ff23b 100644
--- a/arch/arm/mach

[PATCH 8/8] OMAP4: SDP4430: Add twl6040 vibrator platform support

2011-06-01 Thread Peter Ujfalusi
Add twl4030_vibra platform data, and the needed regulators
for twl6040 vibrator.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-4430sdp.c |   50 ++-
 1 files changed, 49 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index b324605..6c4c1a3 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -22,6 +22,7 @@
 #include linux/i2c/twl.h
 #include linux/gpio_keys.h
 #include linux/regulator/machine.h
+#include linux/regulator/fixed.h
 #include linux/leds.h
 #include linux/leds_pwm.h
 
@@ -276,11 +277,40 @@ static struct platform_device sdp4430_lcd_device = {
.id = -1,
 };
 
+static struct regulator_consumer_supply sdp4430_vbat_supply[] = {
+   REGULATOR_SUPPLY(vddvibl, twl6040-vibra),
+   REGULATOR_SUPPLY(vddvibr, twl6040-vibra),
+};
+
+static struct regulator_init_data sdp4430_vbat_data = {
+   .constraints = {
+   .always_on  = 1,
+   },
+   .num_consumer_supplies  = ARRAY_SIZE(sdp4430_vbat_supply),
+   .consumer_supplies  = sdp4430_vbat_supply,
+};
+
+static struct fixed_voltage_config sdp4430_vbat_pdata = {
+   .supply_name= VBAT,
+   .microvolts = 375,
+   .init_data  = sdp4430_vbat_data,
+   .gpio   = -EINVAL,
+};
+
+static struct platform_device sdp4430_vbat = {
+   .name   = reg-fixed-voltage,
+   .id = -1,
+   .dev = {
+   .platform_data = sdp4430_vbat_pdata,
+   },
+};
+
 static struct platform_device *sdp4430_devices[] __initdata = {
sdp4430_lcd_device,
sdp4430_gpio_keys_device,
sdp4430_leds_gpio,
sdp4430_leds_pwm,
+   sdp4430_vbat,
 };
 
 static struct omap_lcd_config sdp4430_lcd_config __initdata = {
@@ -522,6 +552,23 @@ static struct regulator_init_data sdp4430_clk32kg = {
},
 };
 
+static struct twl4030_vibra_data twl6040_vibra = {
+   .vibldrv_res = 8,
+   .vibrdrv_res = 3,
+   .viblmotor_res = 10,
+   .vibrmotor_res = 10,
+   .vddvibl_uV = 0,/* fixed volt supply - VBAT */
+   .vddvibr_uV = 0,/* fixed volt supply - VBAT */
+};
+
+static struct twl4030_audio_data twl6040_audio = {
+   .codec  = NULL,
+   .vibra  = twl6040_vibra,
+   .audpwron_gpio  = 127,
+   .naudint_irq= OMAP44XX_IRQ_SYS_2N,
+   .irq_base   = TWL6040_CODEC_IRQ_BASE,
+};
+
 static struct twl4030_platform_data sdp4430_twldata = {
.irq_base   = TWL6030_IRQ_BASE,
.irq_end= TWL6030_IRQ_END,
@@ -538,7 +585,8 @@ static struct twl4030_platform_data sdp4430_twldata = {
.vaux2  = sdp4430_vaux2,
.vaux3  = sdp4430_vaux3,
.clk32kg= sdp4430_clk32kg,
-   .usb= omap4_usbphy_data
+   .usb= omap4_usbphy_data,
+   .audio  = twl6040_audio,
 };
 
 static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = {
-- 
1.7.5.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/8] input: Add initial support for TWL6040 vibrator

2011-06-01 Thread Peter Ujfalusi
From: Misael Lopez Cruz misael.lo...@ti.com

Add twl6040_vibra as a child of MFD device twl6040_codec. This
implementation covers the PCM-to-PWM mode of TWL6040 vibrator
module.

Signed-off-by: Jorge Eduardo Candelaria jorge.candela...@ti.com
Signed-off-by: Misael Lopez Cruz misael.lo...@ti.com
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 drivers/input/misc/Kconfig |   11 +
 drivers/input/misc/Makefile|1 +
 drivers/input/misc/twl6040-vibra.c |  428 
 include/linux/i2c/twl.h|8 +
 4 files changed, 448 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/misc/twl6040-vibra.c

diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 077309a..d1bf872 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -275,6 +275,17 @@ config INPUT_TWL4030_VIBRA
  To compile this driver as a module, choose M here. The module will
  be called twl4030_vibra.
 
+config INPUT_TWL6040_VIBRA
+   tristate Support for TWL6040 Vibrator
+   depends on TWL4030_CORE
+   select TWL6040_CORE
+   select INPUT_FF_MEMLESS
+   help
+ This option enables support for TWL6040 Vibrator Driver.
+
+ To compile this driver as a module, choose M here. The module will
+ be called twl6040_vibra.
+
 config INPUT_UINPUT
tristate User level driver support
help
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index 38efb2c..4da7c3a 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -40,6 +40,7 @@ obj-$(CONFIG_INPUT_SGI_BTNS)  += sgi_btns.o
 obj-$(CONFIG_INPUT_SPARCSPKR)  += sparcspkr.o
 obj-$(CONFIG_INPUT_TWL4030_PWRBUTTON)  += twl4030-pwrbutton.o
 obj-$(CONFIG_INPUT_TWL4030_VIBRA)  += twl4030-vibra.o
+obj-$(CONFIG_INPUT_TWL6040_VIBRA)  += twl6040-vibra.o
 obj-$(CONFIG_INPUT_UINPUT) += uinput.o
 obj-$(CONFIG_INPUT_WISTRON_BTNS)   += wistron_btns.o
 obj-$(CONFIG_INPUT_WM831X_ON)  += wm831x-on.o
diff --git a/drivers/input/misc/twl6040-vibra.c 
b/drivers/input/misc/twl6040-vibra.c
new file mode 100644
index 000..5a54515
--- /dev/null
+++ b/drivers/input/misc/twl6040-vibra.c
@@ -0,0 +1,428 @@
+/*
+ * twl6040-vibra.c - TWL6040 Vibrator driver
+ *
+ * Author:  Jorge Eduardo Candelaria jorge.candela...@ti.com
+ * Author:  Misael Lopez Cruz misael.lo...@ti.com
+ *
+ * Copyright:   (C) 2011 Texas Instruments, Inc.
+ *
+ * Based on twl4030-vibra.c by Henrik Saari henrik.sa...@nokia.com
+ * Felipe Balbi felipe.ba...@nokia.com
+ * Jari Vanhala ext-javi.vanh...@nokia.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/module.h
+#include linux/platform_device.h
+#include linux/workqueue.h
+#include linux/i2c/twl.h
+#include linux/mfd/twl6040.h
+#include linux/slab.h
+#include linux/delay.h
+#include linux/regulator/consumer.h
+
+#define EFFECT_DIR_180_DEG 0x8000
+
+/* Recommended modulation index 85% */
+#define TWL6040_VIBRA_MOD  85
+
+#define TWL6040_NUM_SUPPLIES 2
+
+struct vibra_info {
+   struct device *dev;
+   struct input_dev *input_dev;
+   struct workqueue_struct *workqueue;
+   struct work_struct play_work;
+   struct mutex mutex;
+
+   bool enabled;
+   int weak_speed;
+   int strong_speed;
+   int direction;
+
+   unsigned int vibldrv_res;
+   unsigned int vibrdrv_res;
+   unsigned int viblmotor_res;
+   unsigned int vibrmotor_res;
+
+   struct regulator_bulk_data supplies[TWL6040_NUM_SUPPLIES];
+
+   struct twl6040 *twl6040;
+};
+
+static irqreturn_t twl6040_vib_irq_handler(int irq, void *data)
+{
+   struct vibra_info *info = data;
+   struct twl6040 *twl6040 = info-twl6040;
+   u8 status;
+
+   status = twl6040_reg_read(twl6040, TWL6040_REG_STATUS);
+   if (status  TWL6040_VIBLOCDET) {
+   dev_warn(info-dev, Left Vibrator overcurrent detected\n);
+   twl6040_clear_bits(twl6040, TWL6040_REG_VIBCTLL,
+  TWL6040_VIBENAL);
+   }
+   if (status  TWL6040_VIBROCDET) {
+   dev_warn(info-dev, Right Vibrator overcurrent detected\n);
+   twl6040_clear_bits(twl6040, TWL6040_REG_VIBCTLR

[PATCH 6/8] MFD: twl6040: Change platform data for soc codec driver

2011-06-01 Thread Peter Ujfalusi
Pass twl4030_codec_data instead of the twl4030_audio_data
for the ASoC codec driver.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 drivers/mfd/twl6040-core.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/twl6040-core.c b/drivers/mfd/twl6040-core.c
index bb36862..bc0ee41 100644
--- a/drivers/mfd/twl6040-core.c
+++ b/drivers/mfd/twl6040-core.c
@@ -494,9 +494,8 @@ static int __devinit twl6040_probe(struct platform_device 
*pdev)
if (pdata-codec) {
cell = twl6040-cells[children];
cell-name = twl6040-codec;
-   /* The codec expects the twl4030_audio_data as platform data */
-   cell-platform_data = pdata;
-   cell-pdata_size = sizeof(*pdata);
+   cell-platform_data = pdata-codec;
+   cell-pdata_size = sizeof(*pdata-codec);
children++;
}
 
-- 
1.7.5.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/8] ASoC: twl6040: Convert into TWL6040 MFD child

2011-06-01 Thread Peter Ujfalusi
From: Misael Lopez Cruz misael.lo...@ti.com

Convert TWL6040 CODEC driver into a TWL6040 MFD child, it implies
that MFD-level operations like register accesses, clock setting
and power management are done through MFD APIs, not directly by
CODEC driver anymore. To avoid conflicts with the other MFD child,
vibrator registers are skipped in CODEC driver.

Signed-off-by: Misael Lopez Cruz misael.lo...@ti.com
Signed-off-by: Jorge Eduardo Candelaria jorge.candela...@ti.com
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/codecs/Kconfig   |1 +
 sound/soc/codecs/twl6040.c |  426 +---
 sound/soc/codecs/twl6040.h |  118 
 sound/soc/omap/sdp4430.c   |2 +
 4 files changed, 91 insertions(+), 456 deletions(-)

diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 0002220..922f59f 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -240,6 +240,7 @@ config SND_SOC_TWL4030
tristate
 
 config SND_SOC_TWL6040
+   select TWL6040_CORE
tristate
 
 config SND_SOC_UDA134X
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index ade6616..209089c 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -24,11 +24,10 @@
 #include linux/init.h
 #include linux/delay.h
 #include linux/pm.h
-#include linux/i2c.h
-#include linux/gpio.h
 #include linux/platform_device.h
 #include linux/slab.h
 #include linux/i2c/twl.h
+#include linux/mfd/twl6040.h
 
 #include sound/core.h
 #include sound/pcm.h
@@ -77,14 +76,12 @@ struct twl6040_jack_data {
 
 /* codec private data */
 struct twl6040_data {
-   int audpwron;
-   int naudint;
int codec_powered;
int pll;
int non_lp;
+   unsigned int clk_in;
unsigned int sysclk;
struct snd_pcm_hw_constraint_list *sysclk_constraints;
-   struct completion ready;
struct twl6040_jack_data hs_jack;
struct snd_soc_codec *codec;
struct workqueue_struct *workqueue;
@@ -239,12 +236,13 @@ static inline void twl6040_write_reg_cache(struct 
snd_soc_codec *codec,
 static int twl6040_read_reg_volatile(struct snd_soc_codec *codec,
unsigned int reg)
 {
+   struct twl6040 *twl6040 = codec-control_data;
u8 value;
 
if (reg = TWL6040_CACHEREGNUM)
return -EIO;
 
-   twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, value, reg);
+   value = twl6040_reg_read(twl6040, reg);
twl6040_write_reg_cache(codec, reg, value);
 
return value;
@@ -256,11 +254,13 @@ static int twl6040_read_reg_volatile(struct snd_soc_codec 
*codec,
 static int twl6040_write(struct snd_soc_codec *codec,
unsigned int reg, unsigned int value)
 {
+   struct twl6040 *twl6040 = codec-control_data;
+
if (reg = TWL6040_CACHEREGNUM)
return -EIO;
 
twl6040_write_reg_cache(codec, reg, value);
-   return twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, value, reg);
+   return twl6040_reg_write(twl6040, reg, value);
 }
 
 static void twl6040_init_vio_regs(struct snd_soc_codec *codec)
@@ -268,15 +268,21 @@ static void twl6040_init_vio_regs(struct snd_soc_codec 
*codec)
u8 *cache = codec-reg_cache;
int reg, i;
 
-   /* allow registers to be accessed by i2c */
-   twl6040_write(codec, TWL6040_REG_ACCCTL, cache[TWL6040_REG_ACCCTL]);
-
for (i = 0; i  TWL6040_VIOREGNUM; i++) {
reg = twl6040_vio_reg[i];
-   /* skip read-only registers (ASICID, ASICREV, STATUS) */
+   /*
+* skip read-only registers (ASICID, ASICREV, STATUS)
+* and registers shared among MFD children
+*/
switch (reg) {
case TWL6040_REG_ASICID:
case TWL6040_REG_ASICREV:
+   case TWL6040_REG_INTID:
+   case TWL6040_REG_INTMR:
+   case TWL6040_REG_NCPCTL:
+   case TWL6040_REG_LDOCTL:
+   case TWL6040_REG_GPOCTL:
+   case TWL6040_REG_ACCCTL:
case TWL6040_REG_STATUS:
continue;
default:
@@ -293,6 +299,20 @@ static void twl6040_init_vdd_regs(struct snd_soc_codec 
*codec)
 
for (i = 0; i  TWL6040_VDDREGNUM; i++) {
reg = twl6040_vdd_reg[i];
+   /* skip vibra and PLL registers */
+   switch (reg) {
+   case TWL6040_REG_VIBCTLL:
+   case TWL6040_REG_VIBDATL:
+   case TWL6040_REG_VIBCTLR:
+   case TWL6040_REG_VIBDATR:
+   case TWL6040_REG_HPPLLCTL:
+   case TWL6040_REG_LPPLLCTL:
+   case TWL6040_REG_LPPLLDIV:
+   continue;
+   default:
+   break;
+   }
+
twl6040_write(codec, reg, cache[reg]);
}
 }
@@ -596,88 +616,6 @@ static int pga_event

[PATCH 1/8] MFD: twl4030-codec: Rename internals from codec to audio

2011-06-01 Thread Peter Ujfalusi
In preparation of renaming the driver from twl4030-codec
to twl4030-audio, first do some clean ups in the driver,
which does not cause any problems outside.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 drivers/mfd/twl4030-codec.c |  135 ++-
 1 files changed, 68 insertions(+), 67 deletions(-)

diff --git a/drivers/mfd/twl4030-codec.c b/drivers/mfd/twl4030-codec.c
index 2bf4136..e1782b3 100644
--- a/drivers/mfd/twl4030-codec.c
+++ b/drivers/mfd/twl4030-codec.c
@@ -1,5 +1,6 @@
 /*
- * MFD driver for twl4030 codec submodule
+ * MFD driver for twl4030 audio submodule, which contains an audio codec, and
+ * the vibra control.
  *
  * Author: Peter Ujfalusi peter.ujfal...@ti.com
  *
@@ -31,53 +32,53 @@
 #include linux/mfd/core.h
 #include linux/mfd/twl4030-codec.h
 
-#define TWL4030_CODEC_CELLS2
+#define TWL4030_AUDIO_CELLS2
 
-static struct platform_device *twl4030_codec_dev;
+static struct platform_device *twl4030_audio_dev;
 
-struct twl4030_codec_resource {
+struct twl4030_audio_resource {
int request_count;
u8 reg;
u8 mask;
 };
 
-struct twl4030_codec {
+struct twl4030_audio {
unsigned int audio_mclk;
struct mutex mutex;
-   struct twl4030_codec_resource resource[TWL4030_CODEC_RES_MAX];
-   struct mfd_cell cells[TWL4030_CODEC_CELLS];
+   struct twl4030_audio_resource resource[TWL4030_CODEC_RES_MAX];
+   struct mfd_cell cells[TWL4030_AUDIO_CELLS];
 };
 
 /*
  * Modify the resource, the function returns the content of the register
  * after the modification.
  */
-static int twl4030_codec_set_resource(enum twl4030_codec_res id, int enable)
+static int twl4030_audio_set_resource(enum twl4030_codec_res id, int enable)
 {
-   struct twl4030_codec *codec = platform_get_drvdata(twl4030_codec_dev);
+   struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
u8 val;
 
twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, val,
-   codec-resource[id].reg);
+   audio-resource[id].reg);
 
if (enable)
-   val |= codec-resource[id].mask;
+   val |= audio-resource[id].mask;
else
-   val = ~codec-resource[id].mask;
+   val = ~audio-resource[id].mask;
 
twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
-   val, codec-resource[id].reg);
+   val, audio-resource[id].reg);
 
return val;
 }
 
-static inline int twl4030_codec_get_resource(enum twl4030_codec_res id)
+static inline int twl4030_audio_get_resource(enum twl4030_codec_res id)
 {
-   struct twl4030_codec *codec = platform_get_drvdata(twl4030_codec_dev);
+   struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
u8 val;
 
twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, val,
-   codec-resource[id].reg);
+   audio-resource[id].reg);
 
return val;
 }
@@ -88,24 +89,24 @@ static inline int twl4030_codec_get_resource(enum 
twl4030_codec_res id)
  */
 int twl4030_codec_enable_resource(enum twl4030_codec_res id)
 {
-   struct twl4030_codec *codec = platform_get_drvdata(twl4030_codec_dev);
+   struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
int val;
 
if (id = TWL4030_CODEC_RES_MAX) {
-   dev_err(twl4030_codec_dev-dev,
+   dev_err(twl4030_audio_dev-dev,
Invalid resource ID (%u)\n, id);
return -EINVAL;
}
 
-   mutex_lock(codec-mutex);
-   if (!codec-resource[id].request_count)
+   mutex_lock(audio-mutex);
+   if (!audio-resource[id].request_count)
/* Resource was disabled, enable it */
-   val = twl4030_codec_set_resource(id, 1);
+   val = twl4030_audio_set_resource(id, 1);
else
-   val = twl4030_codec_get_resource(id);
+   val = twl4030_audio_get_resource(id);
 
-   codec-resource[id].request_count++;
-   mutex_unlock(codec-mutex);
+   audio-resource[id].request_count++;
+   mutex_unlock(audio-mutex);
 
return val;
 }
@@ -117,31 +118,31 @@ EXPORT_SYMBOL_GPL(twl4030_codec_enable_resource);
  */
 int twl4030_codec_disable_resource(unsigned id)
 {
-   struct twl4030_codec *codec = platform_get_drvdata(twl4030_codec_dev);
+   struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
int val;
 
if (id = TWL4030_CODEC_RES_MAX) {
-   dev_err(twl4030_codec_dev-dev,
+   dev_err(twl4030_audio_dev-dev,
Invalid resource ID (%u)\n, id);
return -EINVAL;
}
 
-   mutex_lock(codec-mutex);
-   if (!codec-resource[id].request_count) {
-   dev_err(twl4030_codec_dev-dev,
+   mutex_lock(audio-mutex);
+   if (!audio

[PATCH 4/8] mfd: twl6040: Add initial support

2011-06-01 Thread Peter Ujfalusi
From: Misael Lopez Cruz misael.lo...@ti.com

TWL6040 IC provides analog high-end audio codec functions for
handset applications. It contains several audio analog inputs
and outputs as well as vibrator support. It's connected to the
host processor via PDM interface for audio data communication.
The audio modules are controlled by internal registers that
can be accessed by I2C and PDM interface.

TWL6040 MFD will be registered as a child of TWL-CORE, and will
have two children of its own: twl6040-codec and twl6040-vibra.

This driver is based on TWL4030 and WM8350 MFD drivers.

Signed-off-by: Misael Lopez Cruz misael.lo...@ti.com
Signed-off-by: Jorge Eduardo Candelaria jorge.candela...@ti.com
Signed-off-by: Margarita Olaya Cabrera magi.ol...@ti.com
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/plat-omap/include/plat/irqs.h |   12 +-
 drivers/mfd/Kconfig|6 +
 drivers/mfd/Makefile   |1 +
 drivers/mfd/twl-core.c |5 +-
 drivers/mfd/twl6040-core.c |  589 
 drivers/mfd/twl6040-irq.c  |  205 +++
 include/linux/i2c/twl.h|1 +
 include/linux/mfd/twl6040.h|  260 ++
 8 files changed, 1074 insertions(+), 5 deletions(-)
 create mode 100644 drivers/mfd/twl6040-core.c
 create mode 100644 drivers/mfd/twl6040-irq.c
 create mode 100644 include/linux/mfd/twl6040.h

diff --git a/arch/arm/plat-omap/include/plat/irqs.h 
b/arch/arm/plat-omap/include/plat/irqs.h
index 5a25098..2cfba51 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -407,11 +407,19 @@
 #endif
 #define TWL6030_IRQ_END(TWL6030_IRQ_BASE + 
TWL6030_BASE_NR_IRQS)
 
+#define TWL6040_CODEC_IRQ_BASE TWL6030_IRQ_END
+#ifdef CONFIG_TWL6040_CODEC
+#define TWL6040_CODEC_NR_IRQS  6
+#else
+#define TWL6040_CODEC_NR_IRQS  0
+#endif
+#define TWL6040_CODEC_IRQ_END  (TWL6040_CODEC_IRQ_BASE + TWL6040_CODEC_NR_IRQS)
+
 /* Total number of interrupts depends on the enabled blocks above */
-#if (TWL4030_GPIO_IRQ_END  TWL6030_IRQ_END)
+#if (TWL4030_GPIO_IRQ_END  TWL6040_CODEC_IRQ_END)
 #define TWL_IRQ_ENDTWL4030_GPIO_IRQ_END
 #else
-#define TWL_IRQ_ENDTWL6030_IRQ_END
+#define TWL_IRQ_ENDTWL6040_CODEC_IRQ_END
 #endif
 
 /* GPMC related */
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 3a6f76a..ac6b4ae 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -233,6 +233,12 @@ config TWL6030_PWM
  Say yes here if you want support for TWL6030 PWM.
  This is used to control charging LED brightness.
 
+config TWL6040_CORE
+   bool
+   depends on TWL4030_CORE  GENERIC_HARDIRQS
+   select MFD_CORE
+   default n
+
 config MFD_STMPE
bool Support STMicroelectronics STMPE
depends on I2C=y  GENERIC_HARDIRQS
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 4cf9465..41f3b61 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -42,6 +42,7 @@ obj-$(CONFIG_TWL4030_MADC)  += twl4030-madc.o
 obj-$(CONFIG_TWL4030_POWER)+= twl4030-power.o
 obj-$(CONFIG_MFD_TWL4030_AUDIO)+= twl4030-audio.o
 obj-$(CONFIG_TWL6030_PWM)  += twl6030-pwm.o
+obj-$(CONFIG_TWL6040_CORE) += twl6040-core.o twl6040-irq.o
 
 obj-$(CONFIG_MFD_MC13XXX)  += mc13xxx-core.o
 
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index f9d7880..a2eddc7 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -110,7 +110,7 @@
 #endif
 
 #if defined(CONFIG_TWL4030_CODEC) || defined(CONFIG_TWL4030_CODEC_MODULE) ||\
-   defined(CONFIG_SND_SOC_TWL6040) || 
defined(CONFIG_SND_SOC_TWL6040_MODULE)
+   defined(CONFIG_TWL6040_CORE) || defined(CONFIG_TWL6040_CORE_MODULE)
 #define twl_has_codec()true
 #else
 #define twl_has_codec()false
@@ -824,10 +824,9 @@ add_children(struct twl4030_platform_data *pdata, unsigned 
long features)
return PTR_ERR(child);
}
 
-   /* Phoenix codec driver is probed directly atm */
if (twl_has_codec()  pdata-audio  twl_class_is_6030()) {
sub_chip_id = twl_map[TWL_MODULE_AUDIO_VOICE].sid;
-   child = add_child(sub_chip_id, twl6040-codec,
+   child = add_child(sub_chip_id, twl6040,
pdata-audio, sizeof(*pdata-audio),
false, 0, 0);
if (IS_ERR(child))
diff --git a/drivers/mfd/twl6040-core.c b/drivers/mfd/twl6040-core.c
new file mode 100644
index 000..bb36862
--- /dev/null
+++ b/drivers/mfd/twl6040-core.c
@@ -0,0 +1,589 @@
+/*
+ * MFD driver for TWL6040 audio device
+ *
+ * Authors:Misael Lopez Cruz misael.lo...@ti.com
+ * Jorge Eduardo Candelaria jorge.candela...@ti.com
+ * Peter Ujfalusi peter.ujfal...@ti.com
+ *
+ * Copyright:  (C) 2011 Texas Instruments, Inc.
+ *
+ * This program is free

[PATCH 2/8] MFD: twl4030-codec - twl4030-audio: Rename the driver

2011-06-01 Thread Peter Ujfalusi
Rename the driver, and header file from twl4030-codec to
twl4030-audio.
To avoid breakage change depending drivers at the same time.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
CC: Misael Lopez Cruz misael.lo...@ti.com
---
 drivers/input/misc/Kconfig |2 +-
 drivers/input/misc/twl4030-vibra.c |   10 +-
 drivers/mfd/Kconfig|2 +-
 drivers/mfd/Makefile   |2 +-
 drivers/mfd/twl4030-audio.c|  278 
 drivers/mfd/twl4030-codec.c|  278 
 include/linux/mfd/twl4030-audio.h  |  272 +++
 include/linux/mfd/twl4030-codec.h  |  272 ---
 sound/soc/codecs/Kconfig   |2 +-
 sound/soc/codecs/twl4030.c |   16 +-
 sound/soc/omap/sdp3430.c   |2 +-
 sound/soc/omap/zoom2.c |2 +-
 12 files changed, 569 insertions(+), 569 deletions(-)
 create mode 100644 drivers/mfd/twl4030-audio.c
 delete mode 100644 drivers/mfd/twl4030-codec.c
 create mode 100644 include/linux/mfd/twl4030-audio.h
 delete mode 100644 include/linux/mfd/twl4030-codec.h

diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 45dc6aa..077309a 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -267,7 +267,7 @@ config INPUT_TWL4030_PWRBUTTON
 config INPUT_TWL4030_VIBRA
tristate Support for TWL4030 Vibrator
depends on TWL4030_CORE
-   select TWL4030_CODEC
+   select MFD_TWL4030_AUDIO
select INPUT_FF_MEMLESS
help
  This option enables support for TWL4030 Vibrator Driver.
diff --git a/drivers/input/misc/twl4030-vibra.c 
b/drivers/input/misc/twl4030-vibra.c
index 014dd4a..7abca85 100644
--- a/drivers/input/misc/twl4030-vibra.c
+++ b/drivers/input/misc/twl4030-vibra.c
@@ -28,7 +28,7 @@
 #include linux/platform_device.h
 #include linux/workqueue.h
 #include linux/i2c/twl.h
-#include linux/mfd/twl4030-codec.h
+#include linux/mfd/twl4030-audio.h
 #include linux/input.h
 #include linux/slab.h
 
@@ -67,7 +67,7 @@ static void vibra_enable(struct vibra_info *info)
 {
u8 reg;
 
-   twl4030_codec_enable_resource(TWL4030_CODEC_RES_POWER);
+   twl4030_audio_enable_resource(TWL4030_AUDIO_RES_POWER);
 
/* turn H-Bridge on */
twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE,
@@ -75,7 +75,7 @@ static void vibra_enable(struct vibra_info *info)
twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
 (reg | TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL);
 
-   twl4030_codec_enable_resource(TWL4030_CODEC_RES_APLL);
+   twl4030_audio_enable_resource(TWL4030_AUDIO_RES_APLL);
 
info-enabled = true;
 }
@@ -90,8 +90,8 @@ static void vibra_disable(struct vibra_info *info)
twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
 (reg  ~TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL);
 
-   twl4030_codec_disable_resource(TWL4030_CODEC_RES_APLL);
-   twl4030_codec_disable_resource(TWL4030_CODEC_RES_POWER);
+   twl4030_audio_disable_resource(TWL4030_AUDIO_RES_APLL);
+   twl4030_audio_disable_resource(TWL4030_AUDIO_RES_POWER);
 
info-enabled = false;
 }
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 0f09c05..3a6f76a 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -218,7 +218,7 @@ config TWL4030_POWER
  and load scripts controlling which resources are switched off/on
  or reset when a sleep, wakeup or warm reset event occurs.
 
-config TWL4030_CODEC
+config MFD_TWL4030_AUDIO
bool
depends on TWL4030_CORE
select MFD_CORE
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index efe3cc3..4cf9465 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -40,7 +40,7 @@ obj-$(CONFIG_MENELAUS)+= menelaus.o
 obj-$(CONFIG_TWL4030_CORE) += twl-core.o twl4030-irq.o twl6030-irq.o
 obj-$(CONFIG_TWL4030_MADC)  += twl4030-madc.o
 obj-$(CONFIG_TWL4030_POWER)+= twl4030-power.o
-obj-$(CONFIG_TWL4030_CODEC)+= twl4030-codec.o
+obj-$(CONFIG_MFD_TWL4030_AUDIO)+= twl4030-audio.o
 obj-$(CONFIG_TWL6030_PWM)  += twl6030-pwm.o
 
 obj-$(CONFIG_MFD_MC13XXX)  += mc13xxx-core.o
diff --git a/drivers/mfd/twl4030-audio.c b/drivers/mfd/twl4030-audio.c
new file mode 100644
index 000..467ddb8
--- /dev/null
+++ b/drivers/mfd/twl4030-audio.c
@@ -0,0 +1,278 @@
+/*
+ * MFD driver for twl4030 audio submodule, which contains an audio codec, and
+ * the vibra control.
+ *
+ * Author: Peter Ujfalusi peter.ujfal...@ti.com
+ *
+ * Copyright:   (C) 2009 Nokia Corporation
+ *
+ * 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

Re: [PATCH 3/8] MFD: twl4030-audio: Rename platform data

2011-06-01 Thread Peter Ujfalusi
On Wednesday 01 June 2011 15:07:54 Tony Lindgren wrote:
 
 Can you please take a look at creating arch/arm/mach-omap2/i2c-twl.c or
 something in common-board-devices.c to get rid of the cut and paste
 duplication in every board-*.c file?

Yes, it would make sense, since most of the board has similar configuration, 
and we have lots of duplicated code around.
 
 Maybe you could have a generic twl_init function that allows overriding
 things like keypad with board specific configuration?

We might need also support for overriding other configurations 
(audio/codec/vibra for sure needs that).

I'll take a look, but I think it is not going to be part of v2 of this series.

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/8] MFD: twl4030-audio: Rename platform data

2011-06-01 Thread Peter Ujfalusi
On Wednesday 01 June 2011 16:00:34 Tony Lindgren wrote:
 Yeah, most of it might be possible to describe with just a flags
 like TWL_HAS_VIBRA etc.

Or TWL_BOARD_HAS_VIBRA, TWL_BOARD_HAS_CODEC...

For the audio part it is a bit complicated than that:
different base frequencies, for twl6040 we have parameters for Vibra (twl4030 
class only have the coexistence). The soc codec has a list of misc parameters 
for board specific configurations as well (not all board using them).
I was thinking to switch the MFD driver(s) to use flags to specify the needed 
child, and change the child drivers to deal with the missing platform data 
themselves.
In that way, board files can pass the vibra/codec platform data to the new 
i2c_twl file for example, and provide flags to enable functionality.

  I'll take a look, but I think it is not going to be part of v2 of this
  series.
 
 We should not do renaming before the clean-up though, it gets
 classified as unnecesary churn.

The changes in board files are minimal. The biggest part is the code move, and 
that will remain the same now or later...

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/8] MFD: twl4030-audio: Rename platform data

2011-06-02 Thread Peter Ujfalusi
On Wednesday 01 June 2011 16:38:23 Tony Lindgren wrote:
 But you could easily remove all the board specific struct
 twl4030_codec_data and struct twl4030_codec_audio_data entries by adding a
 default audio init option to omap_pmic_init for the common configuration.

Yeah, I can grep in the board files, and see what is the most common 
configuration

 How about something like:
 
 void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int
 pmic_irq, struct twl4030_platform_data *pmic_data, u32 flags);

common-board-devices.c has omap_pmic_init, but without the flags.

 Where flags would be TWL_BOARD_HAS_DEFAULT_CODEC etc, and if the entry in
 pmic_data is NULL, just use the default configuration. I think you already
 have the clkrate there?

I'll take a look, should we have new file specifically for twl, or should I 
extend the common-board-devices.c with the twl related things? IMHO a new file 
might be better, since the full twl config might be quite big.

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/8] MFD: twl4030-audio: Rename platform data

2011-06-03 Thread Peter Ujfalusi
On Friday 03 June 2011 11:08:22 Tony Lindgren wrote:
 Yeah if it gets big then a separate file is better. Also, if we have
 a common init function for twl, then it's easy to add the board specific
 device tree initialization to that too and just leave out the calls to
 omap_pmic_init from board-*.c files.

I have parsed the board files for a pattern.
There are some, but I have my doubts as well:
We have eight platform data members in twl4030_platform_data for child 
devices.
USB, and audio/codec configuration might worth to move out (since most of the 
board does not have fine tuned parameters for codec).

The majority of the code related to pmic is coming from regulator setups, I 
can see similarities, but there are differences here and there, which makes 
the common configuration mostly useless (different peripherals, boot loader 
diffs, etc).

Having said that, I try to create a wrapper for omap_pmic_init, which can 
replace the current omap2/3/4_pmic_init, with that we can use common config 
for USB, audio, and some selected few regulators initially.
Later other parts might be possible to consolidate as well.
I'm going to call this new wrapper for now omap2/3/4_pmic_config.

Is this a good way to approach this issue?

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/8] mfd: twl6040: Add initial support

2011-06-03 Thread Peter Ujfalusi
On Wednesday 01 June 2011 16:47:21 Krishnamoorthy, Balaji T wrote:
  +int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg)
  +{
  +   int ret;
  +   u8 val = 0;
  +
  +   mutex_lock(twl6040-io_mutex);
  +   ret = twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, val, reg);
 
 Can this dependency on twl_i2c_[read/write] be removed,
 Since TWL6040 is a separate IC which can get its own i2c_client in
 twl6040-core.c and
 create its own mfd devices like vibra, audio-codec ... while creating
 twl6040-core.c

You are right, twl6040 is separate IC.
I'll take a look how it can be separated from the twl-core (twl6030).

Thanks for noticing this, 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 01/12] OMAP: New pmic-common for common TWL configuration

2011-06-07 Thread Peter Ujfalusi
Introduce a new file, which will be used to configure
common pmic (TWL) devices, regulators.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/Makefile   |2 +-
 arch/arm/mach-omap2/common-board-devices.c |   21 -
 arch/arm/mach-omap2/common-board-devices.h |   26 +--
 arch/arm/mach-omap2/pmic-common.c  |   46 
 arch/arm/mach-omap2/pmic-common.h  |   28 +
 5 files changed, 77 insertions(+), 46 deletions(-)
 create mode 100644 arch/arm/mach-omap2/pmic-common.c
 create mode 100644 arch/arm/mach-omap2/pmic-common.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index b148077..005a6aa 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -269,4 +269,4 @@ obj-$(CONFIG_ARCH_OMAP4)+= hwspinlock.o
 disp-$(CONFIG_OMAP2_DSS)   := display.o
 obj-y  += $(disp-m) $(disp-y)
 
-obj-y  += common-board-devices.o
+obj-y  += common-board-devices.o pmic-common.o
diff --git a/arch/arm/mach-omap2/common-board-devices.c 
b/arch/arm/mach-omap2/common-board-devices.c
index e94903b..7c4430c 100644
--- a/arch/arm/mach-omap2/common-board-devices.c
+++ b/arch/arm/mach-omap2/common-board-devices.c
@@ -20,36 +20,15 @@
  *
  */
 
-#include linux/i2c.h
-#include linux/i2c/twl.h
-
 #include linux/gpio.h
 #include linux/spi/spi.h
 #include linux/spi/ads7846.h
 
-#include plat/i2c.h
 #include plat/mcspi.h
 #include plat/nand.h
 
 #include common-board-devices.h
 
-static struct i2c_board_info __initdata pmic_i2c_board_info = {
-   .addr   = 0x48,
-   .flags  = I2C_CLIENT_WAKE,
-};
-
-void __init omap_pmic_init(int bus, u32 clkrate,
-  const char *pmic_type, int pmic_irq,
-  struct twl4030_platform_data *pmic_data)
-{
-   strncpy(pmic_i2c_board_info.type, pmic_type,
-   sizeof(pmic_i2c_board_info.type));
-   pmic_i2c_board_info.irq = pmic_irq;
-   pmic_i2c_board_info.platform_data = pmic_data;
-
-   omap_register_i2c_bus(bus, clkrate, pmic_i2c_board_info, 1);
-}
-
 #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
 static struct omap2_mcspi_device_config ads7846_mcspi_config = {
diff --git a/arch/arm/mach-omap2/common-board-devices.h 
b/arch/arm/mach-omap2/common-board-devices.h
index eb80b3b..2f7705b 100644
--- a/arch/arm/mach-omap2/common-board-devices.h
+++ b/arch/arm/mach-omap2/common-board-devices.h
@@ -1,31 +1,9 @@
 #ifndef __OMAP_COMMON_BOARD_DEVICES__
 #define __OMAP_COMMON_BOARD_DEVICES__
 
-struct twl4030_platform_data;
-struct mtd_partition;
-
-void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq,
-   struct twl4030_platform_data *pmic_data);
-
-static inline void omap2_pmic_init(const char *pmic_type,
-  struct twl4030_platform_data *pmic_data)
-{
-   omap_pmic_init(2, 2600, pmic_type, INT_24XX_SYS_NIRQ, pmic_data);
-}
-
-static inline void omap3_pmic_init(const char *pmic_type,
-  struct twl4030_platform_data *pmic_data)
-{
-   omap_pmic_init(1, 2600, pmic_type, INT_34XX_SYS_NIRQ, pmic_data);
-}
-
-static inline void omap4_pmic_init(const char *pmic_type,
-  struct twl4030_platform_data *pmic_data)
-{
-   /* Phoenix Audio IC needs I2C1 to start with 400 KHz or less */
-   omap_pmic_init(1, 400, pmic_type, OMAP44XX_IRQ_SYS_1N, pmic_data);
-}
+#include pmic-common.h
 
+struct mtd_partition;
 struct ads7846_platform_data;
 
 void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
diff --git a/arch/arm/mach-omap2/pmic-common.c 
b/arch/arm/mach-omap2/pmic-common.c
new file mode 100644
index 000..d0b563e
--- /dev/null
+++ b/arch/arm/mach-omap2/pmic-common.c
@@ -0,0 +1,46 @@
+/*
+ * pmic-common.c
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc..
+ * Author: Peter Ujfalusi peter.ujfal...@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/i2c.h
+#include linux/i2c/twl.h
+#include linux/gpio.h
+
+#include plat/i2c.h
+
+#include pmic-common.h
+
+static struct i2c_board_info __initdata

[PATCH v2 04/12] OMAP3: Move common regulator configuration to pmic-common

2011-06-07 Thread Peter Ujfalusi
Some regulator config can be moved out from board files,
since they are close to identical.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-3430sdp.c  |   51 --
 arch/arm/mach-omap2/board-cm-t35.c   |   41 +++--
 arch/arm/mach-omap2/board-devkit8000.c   |   21 +--
 arch/arm/mach-omap2/board-igep0020.c |   28 +++
 arch/arm/mach-omap2/board-omap3beagle.c  |   44 ++
 arch/arm/mach-omap2/board-omap3evm.c |   47 +++-
 arch/arm/mach-omap2/board-omap3pandora.c |   44 --
 arch/arm/mach-omap2/board-omap3stalker.c |   48 +++-
 arch/arm/mach-omap2/board-omap3touchbook.c   |   40 
 arch/arm/mach-omap2/board-overo.c|   44 ++
 arch/arm/mach-omap2/board-rx51-peripherals.c |   25 ++---
 arch/arm/mach-omap2/board-zoom-peripherals.c |   41 ++---
 arch/arm/mach-omap2/pmic-common.c|   42 +
 arch/arm/mach-omap2/pmic-common.h|5 +++
 14 files changed, 109 insertions(+), 412 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index e9dbf5d..87cf2b7 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -283,16 +283,6 @@ static struct regulator_consumer_supply 
sdp3430_vaux3_supplies[] = {
REGULATOR_SUPPLY(vcc, spi1.0),
 };
 
-static struct regulator_consumer_supply sdp3430_vdda_dac_supplies[] = {
-   REGULATOR_SUPPLY(vdda_dac, omapdss_venc),
-};
-
-/* VPLL2 for digital video outputs */
-static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
-   REGULATOR_SUPPLY(vdds_dsi, omapdss),
-   REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi1),
-};
-
 static struct regulator_consumer_supply sdp3430_vmmc1_supplies[] = {
REGULATOR_SUPPLY(vmmc, omap_hsmmc.0),
 };
@@ -409,36 +399,6 @@ static struct regulator_init_data sdp3430_vsim = {
.consumer_supplies  = sdp3430_vsim_supplies,
 };
 
-/* VDAC for DSS driving S-Video */
-static struct regulator_init_data sdp3430_vdac = {
-   .constraints = {
-   .min_uV = 180,
-   .max_uV = 180,
-   .apply_uV   = true,
-   .valid_modes_mask   = REGULATOR_MODE_NORMAL
-   | REGULATOR_MODE_STANDBY,
-   .valid_ops_mask = REGULATOR_CHANGE_MODE
-   | REGULATOR_CHANGE_STATUS,
-   },
-   .num_consumer_supplies  = ARRAY_SIZE(sdp3430_vdda_dac_supplies),
-   .consumer_supplies  = sdp3430_vdda_dac_supplies,
-};
-
-static struct regulator_init_data sdp3430_vpll2 = {
-   .constraints = {
-   .name   = VDVI,
-   .min_uV = 180,
-   .max_uV = 180,
-   .apply_uV   = true,
-   .valid_modes_mask   = REGULATOR_MODE_NORMAL
-   | REGULATOR_MODE_STANDBY,
-   .valid_ops_mask = REGULATOR_CHANGE_MODE
-   | REGULATOR_CHANGE_STATUS,
-   },
-   .num_consumer_supplies  = ARRAY_SIZE(sdp3430_vpll2_supplies),
-   .consumer_supplies  = sdp3430_vpll2_supplies,
-};
-
 static struct twl4030_platform_data sdp3430_twldata = {
/* platform_data for children goes here */
.gpio   = sdp3430_gpio_data,
@@ -451,16 +411,19 @@ static struct twl4030_platform_data sdp3430_twldata = {
.vmmc1  = sdp3430_vmmc1,
.vmmc2  = sdp3430_vmmc2,
.vsim   = sdp3430_vsim,
-   .vdac   = sdp3430_vdac,
-   .vpll2  = sdp3430_vpll2,
 };
 
 static int __init omap3430_i2c_init(void)
 {
/* i2c1 for PMIC only */
omap3_pmic_get_config(sdp3430_twldata,
- TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_BCI |
- TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_CODEC, 0);
+   TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_BCI |
+   TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_CODEC,
+   TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
+   sdp3430_twldata.vdac-constraints.apply_uV = true;
+   sdp3430_twldata.vpll2-constraints.apply_uV = true;
+   sdp3430_twldata.vpll2-constraints.name = VDVI;
+
omap3_pmic_init(twl4030, sdp3430_twldata);
 
/* i2c2 on camera connector (for sensor control) and optional isp1301 */
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index dcde1df..aeeea9a 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -347,9 +347,6 @@ static struct

[PATCH v2 09/12] ASoC: twl6040: Convert into TWL6040 MFD child

2011-06-07 Thread Peter Ujfalusi
From: Misael Lopez Cruz misael.lo...@ti.com

Convert TWL6040 CODEC driver into a TWL6040 MFD child, it implies
that MFD-level operations like register accesses, clock setting
and power management are done through MFD APIs, not directly by
CODEC driver anymore. To avoid conflicts with the other MFD child,
vibrator registers are skipped in CODEC driver.

Signed-off-by: Misael Lopez Cruz misael.lo...@ti.com
Signed-off-by: Jorge Eduardo Candelaria jorge.candela...@ti.com
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com
---
 sound/soc/codecs/Kconfig   |1 +
 sound/soc/codecs/twl6040.c |  426 +---
 sound/soc/codecs/twl6040.h |  118 
 sound/soc/omap/sdp4430.c   |2 +
 4 files changed, 91 insertions(+), 456 deletions(-)

diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 0002220..922f59f 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -240,6 +240,7 @@ config SND_SOC_TWL4030
tristate
 
 config SND_SOC_TWL6040
+   select TWL6040_CORE
tristate
 
 config SND_SOC_UDA134X
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index ade6616..209089c 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -24,11 +24,10 @@
 #include linux/init.h
 #include linux/delay.h
 #include linux/pm.h
-#include linux/i2c.h
-#include linux/gpio.h
 #include linux/platform_device.h
 #include linux/slab.h
 #include linux/i2c/twl.h
+#include linux/mfd/twl6040.h
 
 #include sound/core.h
 #include sound/pcm.h
@@ -77,14 +76,12 @@ struct twl6040_jack_data {
 
 /* codec private data */
 struct twl6040_data {
-   int audpwron;
-   int naudint;
int codec_powered;
int pll;
int non_lp;
+   unsigned int clk_in;
unsigned int sysclk;
struct snd_pcm_hw_constraint_list *sysclk_constraints;
-   struct completion ready;
struct twl6040_jack_data hs_jack;
struct snd_soc_codec *codec;
struct workqueue_struct *workqueue;
@@ -239,12 +236,13 @@ static inline void twl6040_write_reg_cache(struct 
snd_soc_codec *codec,
 static int twl6040_read_reg_volatile(struct snd_soc_codec *codec,
unsigned int reg)
 {
+   struct twl6040 *twl6040 = codec-control_data;
u8 value;
 
if (reg = TWL6040_CACHEREGNUM)
return -EIO;
 
-   twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, value, reg);
+   value = twl6040_reg_read(twl6040, reg);
twl6040_write_reg_cache(codec, reg, value);
 
return value;
@@ -256,11 +254,13 @@ static int twl6040_read_reg_volatile(struct snd_soc_codec 
*codec,
 static int twl6040_write(struct snd_soc_codec *codec,
unsigned int reg, unsigned int value)
 {
+   struct twl6040 *twl6040 = codec-control_data;
+
if (reg = TWL6040_CACHEREGNUM)
return -EIO;
 
twl6040_write_reg_cache(codec, reg, value);
-   return twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, value, reg);
+   return twl6040_reg_write(twl6040, reg, value);
 }
 
 static void twl6040_init_vio_regs(struct snd_soc_codec *codec)
@@ -268,15 +268,21 @@ static void twl6040_init_vio_regs(struct snd_soc_codec 
*codec)
u8 *cache = codec-reg_cache;
int reg, i;
 
-   /* allow registers to be accessed by i2c */
-   twl6040_write(codec, TWL6040_REG_ACCCTL, cache[TWL6040_REG_ACCCTL]);
-
for (i = 0; i  TWL6040_VIOREGNUM; i++) {
reg = twl6040_vio_reg[i];
-   /* skip read-only registers (ASICID, ASICREV, STATUS) */
+   /*
+* skip read-only registers (ASICID, ASICREV, STATUS)
+* and registers shared among MFD children
+*/
switch (reg) {
case TWL6040_REG_ASICID:
case TWL6040_REG_ASICREV:
+   case TWL6040_REG_INTID:
+   case TWL6040_REG_INTMR:
+   case TWL6040_REG_NCPCTL:
+   case TWL6040_REG_LDOCTL:
+   case TWL6040_REG_GPOCTL:
+   case TWL6040_REG_ACCCTL:
case TWL6040_REG_STATUS:
continue;
default:
@@ -293,6 +299,20 @@ static void twl6040_init_vdd_regs(struct snd_soc_codec 
*codec)
 
for (i = 0; i  TWL6040_VDDREGNUM; i++) {
reg = twl6040_vdd_reg[i];
+   /* skip vibra and PLL registers */
+   switch (reg) {
+   case TWL6040_REG_VIBCTLL:
+   case TWL6040_REG_VIBDATL:
+   case TWL6040_REG_VIBCTLR:
+   case TWL6040_REG_VIBDATR:
+   case TWL6040_REG_HPPLLCTL:
+   case TWL6040_REG_LPPLLCTL:
+   case TWL6040_REG_LPPLLDIV:
+   continue;
+   default:
+   break;
+   }
+
twl6040_write(codec, reg, cache[reg

[PATCH v2 11/12] input: Add initial support for TWL6040 vibrator

2011-06-07 Thread Peter Ujfalusi
From: Misael Lopez Cruz misael.lo...@ti.com

Add twl6040_vibra as a child of MFD device twl6040_codec. This
implementation covers the PCM-to-PWM mode of TWL6040 vibrator
module.

Signed-off-by: Jorge Eduardo Candelaria jorge.candela...@ti.com
Signed-off-by: Misael Lopez Cruz misael.lo...@ti.com
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 drivers/input/misc/Kconfig |   11 +
 drivers/input/misc/Makefile|1 +
 drivers/input/misc/twl6040-vibra.c |  428 
 include/linux/i2c/twl.h|8 +
 4 files changed, 448 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/misc/twl6040-vibra.c

diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 077309a..d1bf872 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -275,6 +275,17 @@ config INPUT_TWL4030_VIBRA
  To compile this driver as a module, choose M here. The module will
  be called twl4030_vibra.
 
+config INPUT_TWL6040_VIBRA
+   tristate Support for TWL6040 Vibrator
+   depends on TWL4030_CORE
+   select TWL6040_CORE
+   select INPUT_FF_MEMLESS
+   help
+ This option enables support for TWL6040 Vibrator Driver.
+
+ To compile this driver as a module, choose M here. The module will
+ be called twl6040_vibra.
+
 config INPUT_UINPUT
tristate User level driver support
help
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index 38efb2c..4da7c3a 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -40,6 +40,7 @@ obj-$(CONFIG_INPUT_SGI_BTNS)  += sgi_btns.o
 obj-$(CONFIG_INPUT_SPARCSPKR)  += sparcspkr.o
 obj-$(CONFIG_INPUT_TWL4030_PWRBUTTON)  += twl4030-pwrbutton.o
 obj-$(CONFIG_INPUT_TWL4030_VIBRA)  += twl4030-vibra.o
+obj-$(CONFIG_INPUT_TWL6040_VIBRA)  += twl6040-vibra.o
 obj-$(CONFIG_INPUT_UINPUT) += uinput.o
 obj-$(CONFIG_INPUT_WISTRON_BTNS)   += wistron_btns.o
 obj-$(CONFIG_INPUT_WM831X_ON)  += wm831x-on.o
diff --git a/drivers/input/misc/twl6040-vibra.c 
b/drivers/input/misc/twl6040-vibra.c
new file mode 100644
index 000..5a54515
--- /dev/null
+++ b/drivers/input/misc/twl6040-vibra.c
@@ -0,0 +1,428 @@
+/*
+ * twl6040-vibra.c - TWL6040 Vibrator driver
+ *
+ * Author:  Jorge Eduardo Candelaria jorge.candela...@ti.com
+ * Author:  Misael Lopez Cruz misael.lo...@ti.com
+ *
+ * Copyright:   (C) 2011 Texas Instruments, Inc.
+ *
+ * Based on twl4030-vibra.c by Henrik Saari henrik.sa...@nokia.com
+ * Felipe Balbi felipe.ba...@nokia.com
+ * Jari Vanhala ext-javi.vanh...@nokia.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/module.h
+#include linux/platform_device.h
+#include linux/workqueue.h
+#include linux/i2c/twl.h
+#include linux/mfd/twl6040.h
+#include linux/slab.h
+#include linux/delay.h
+#include linux/regulator/consumer.h
+
+#define EFFECT_DIR_180_DEG 0x8000
+
+/* Recommended modulation index 85% */
+#define TWL6040_VIBRA_MOD  85
+
+#define TWL6040_NUM_SUPPLIES 2
+
+struct vibra_info {
+   struct device *dev;
+   struct input_dev *input_dev;
+   struct workqueue_struct *workqueue;
+   struct work_struct play_work;
+   struct mutex mutex;
+
+   bool enabled;
+   int weak_speed;
+   int strong_speed;
+   int direction;
+
+   unsigned int vibldrv_res;
+   unsigned int vibrdrv_res;
+   unsigned int viblmotor_res;
+   unsigned int vibrmotor_res;
+
+   struct regulator_bulk_data supplies[TWL6040_NUM_SUPPLIES];
+
+   struct twl6040 *twl6040;
+};
+
+static irqreturn_t twl6040_vib_irq_handler(int irq, void *data)
+{
+   struct vibra_info *info = data;
+   struct twl6040 *twl6040 = info-twl6040;
+   u8 status;
+
+   status = twl6040_reg_read(twl6040, TWL6040_REG_STATUS);
+   if (status  TWL6040_VIBLOCDET) {
+   dev_warn(info-dev, Left Vibrator overcurrent detected\n);
+   twl6040_clear_bits(twl6040, TWL6040_REG_VIBCTLL,
+  TWL6040_VIBENAL);
+   }
+   if (status  TWL6040_VIBROCDET) {
+   dev_warn(info-dev, Right Vibrator overcurrent detected\n);
+   twl6040_clear_bits(twl6040, TWL6040_REG_VIBCTLR

[PATCH v2 12/12] OMAP4: SDP4430: Add twl6040 vibrator platform support

2011-06-07 Thread Peter Ujfalusi
Add twl4030_vibra platform data, and the needed regulators
for twl6040 vibrator.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-4430sdp.c |   48 +++
 1 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index 88d9ae5..174528a 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -22,6 +22,7 @@
 #include linux/i2c/twl.h
 #include linux/gpio_keys.h
 #include linux/regulator/machine.h
+#include linux/regulator/fixed.h
 #include linux/leds.h
 #include linux/leds_pwm.h
 
@@ -276,11 +277,40 @@ static struct platform_device sdp4430_lcd_device = {
.id = -1,
 };
 
+static struct regulator_consumer_supply sdp4430_vbat_supply[] = {
+   REGULATOR_SUPPLY(vddvibl, twl6040-vibra),
+   REGULATOR_SUPPLY(vddvibr, twl6040-vibra),
+};
+
+static struct regulator_init_data sdp4430_vbat_data = {
+   .constraints = {
+   .always_on  = 1,
+   },
+   .num_consumer_supplies  = ARRAY_SIZE(sdp4430_vbat_supply),
+   .consumer_supplies  = sdp4430_vbat_supply,
+};
+
+static struct fixed_voltage_config sdp4430_vbat_pdata = {
+   .supply_name= VBAT,
+   .microvolts = 375,
+   .init_data  = sdp4430_vbat_data,
+   .gpio   = -EINVAL,
+};
+
+static struct platform_device sdp4430_vbat = {
+   .name   = reg-fixed-voltage,
+   .id = -1,
+   .dev = {
+   .platform_data = sdp4430_vbat_pdata,
+   },
+};
+
 static struct platform_device *sdp4430_devices[] __initdata = {
sdp4430_lcd_device,
sdp4430_gpio_keys_device,
sdp4430_leds_gpio,
sdp4430_leds_pwm,
+   sdp4430_vbat,
 };
 
 static struct omap_lcd_config sdp4430_lcd_config __initdata = {
@@ -402,7 +432,25 @@ static struct regulator_init_data sdp4430_vusim = {
},
 };
 
+static struct twl4030_vibra_data twl6040_vibra = {
+   .vibldrv_res = 8,
+   .vibrdrv_res = 3,
+   .viblmotor_res = 10,
+   .vibrmotor_res = 10,
+   .vddvibl_uV = 0,/* fixed volt supply - VBAT */
+   .vddvibr_uV = 0,/* fixed volt supply - VBAT */
+};
+
+static struct twl4030_audio_data twl6040_audio = {
+   .codec  = NULL,
+   .vibra  = twl6040_vibra,
+   .audpwron_gpio  = 127,
+   .naudint_irq= OMAP44XX_IRQ_SYS_2N,
+   .irq_base   = TWL6040_CODEC_IRQ_BASE,
+};
+
 static struct twl4030_platform_data sdp4430_twldata = {
+   .audio  = twl6040_audio,
/* Regulators */
.vusim  = sdp4430_vusim,
.vaux1  = sdp4430_vaux1,
-- 
1.7.5.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 00/12] MFD/ASoC/Input: TWL4030/TWL60X0 changes

2011-06-07 Thread Peter Ujfalusi
Hello,

The second version gowned a bit since v1...

Changes since v1:
- Common pmic related configuration moved out from board files
- Rest of the series has been rebased on top of this change

Not changed since v1:
- TWL6040 MFD driver has not been converted to i2c driver
I have looked at this, and while it can be done, I feel that the changes needed
in twl-core will be not accepted, since IMHO the twl-core need to be cleaned
first. The solution, which can be done with the current code might look a bit
hackish.

Updated intro message from the v1 series:
The series will do four major things, and they are in one series, because they
pretty much depending on each other, so it is easier to handle them together.

0. Move the common pmic related configurations out from the board files.
New pmic-common.c/h file has been created for this purpose.
OMAP3 board files received two patches (pdata, and regualtor changes), OMAP4
board files has been changed with one patch.

1. Rename the twl4030-codec MFD driver to twl4030-audio
Since the ASoC multicomponent introduction (2.6.37) the twl4030-codec MFD dirver
had been using twl4030-audio to register (twl4030-codec is the ASoC codec
driver). The documentation refers to this part of twl as audio block, so it is
better to rename the driver as well to avoid confusion.

2. Introduction of MFD driver for twl6040.
The TWL6040 audio IC has codec and vibra functionality.
Convert the existing ASoC codec driver to use the new MFD driver's interface.

3. Vibrator driver for TWL6040 (Input/ForceFeedback driver)
The driver itself, and support for the vibrators in SDP4430 board.

The series has been tested on top of merged omap-next, asoc-next, and mfd-next.
It applies on top of linux-next as well.

Regards,
Peter

---
Misael Lopez Cruz (3):
  mfd: twl6040: Add initial support
  ASoC: twl6040: Convert into TWL6040 MFD child
  input: Add initial support for TWL6040 vibrator

Peter Ujfalusi (9):
  OMAP: New pmic-common for common TWL configuration
  OMAP4: Move common twl6030 configuration to pmic-common
  OMAP3: Move common pmic configuration to pmic-common
  OMAP3: Move common regulator configuration to pmic-common
  MFD: twl4030-codec: Rename internals from codec to audio
  MFD: twl4030-codec - twl4030-audio: Rename the driver
  MFD: twl4030-audio: Rename platform data
  MFD: twl6040: Change platform data for soc codec driver
  OMAP4: SDP4430: Add twl6040 vibrator platform support

 arch/arm/mach-omap2/Makefile |2 +-
 arch/arm/mach-omap2/board-3430sdp.c  |   89 +
 arch/arm/mach-omap2/board-4430sdp.c  |  183 +++--
 arch/arm/mach-omap2/board-cm-t35.c   |   48 +--
 arch/arm/mach-omap2/board-devkit8000.c   |   37 +--
 arch/arm/mach-omap2/board-igep0020.c |   44 +--
 arch/arm/mach-omap2/board-ldp.c  |   15 +-
 arch/arm/mach-omap2/board-omap3beagle.c  |   60 +---
 arch/arm/mach-omap2/board-omap3evm.c |   67 +---
 arch/arm/mach-omap2/board-omap3pandora.c |   59 +---
 arch/arm/mach-omap2/board-omap3stalker.c |   70 +---
 arch/arm/mach-omap2/board-omap3touchbook.c   |   57 +---
 arch/arm/mach-omap2/board-omap4panda.c   |  149 +--
 arch/arm/mach-omap2/board-overo.c|   59 +---
 arch/arm/mach-omap2/board-rm680.c|8 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c |   44 +--
 arch/arm/mach-omap2/board-zoom-peripherals.c |   88 +
 arch/arm/mach-omap2/common-board-devices.c   |   21 -
 arch/arm/mach-omap2/common-board-devices.h   |   26 +-
 arch/arm/mach-omap2/pmic-common.c|  304 +
 arch/arm/mach-omap2/pmic-common.h|   59 +++
 arch/arm/plat-omap/include/plat/irqs.h   |   12 +-
 drivers/input/misc/Kconfig   |   13 +-
 drivers/input/misc/Makefile  |1 +
 drivers/input/misc/twl4030-vibra.c   |   12 +-
 drivers/input/misc/twl6040-vibra.c   |  428 +++
 drivers/mfd/Kconfig  |8 +-
 drivers/mfd/Makefile |3 +-
 drivers/mfd/twl-core.c   |   13 +-
 drivers/mfd/twl4030-audio.c  |  278 
 drivers/mfd/twl4030-codec.c  |  277 
 drivers/mfd/twl6040-core.c   |  588 ++
 drivers/mfd/twl6040-irq.c|  205 +
 include/linux/i2c/twl.h  |   21 +-
 include/linux/mfd/twl4030-audio.h|  272 
 include/linux/mfd/twl4030-codec.h|  272 
 include/linux/mfd/twl6040.h  |  260 
 sound/soc/codecs/Kconfig |3 +-
 sound/soc/codecs/twl4030.c   |   22 +-
 sound/soc/codecs/twl6040.c   |  426 ---
 sound/soc/codecs/twl6040.h   |  118 -
 sound/soc/omap/sdp3430.c |2 +-
 sound/soc/omap/sdp4430.c

[PATCH v2 02/12] OMAP4: Move common twl6030 configuration to pmic-common

2011-06-07 Thread Peter Ujfalusi
Reduce the amount of duplicated code by moving the common
configuration for TWL6030 (on OMAP4 platform) to the
pmic-common file.
Use the omap4_pmic_config function from board files to
properly configure the PMIC with the common fields.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-4430sdp.c|  143 ++--
 arch/arm/mach-omap2/board-omap4panda.c |  149 +++---
 arch/arm/mach-omap2/pmic-common.c  |  163 
 arch/arm/mach-omap2/pmic-common.h  |   20 
 4 files changed, 205 insertions(+), 270 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index b324605..88d9ae5 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -306,14 +306,6 @@ static struct omap_musb_board_data musb_board_data = {
.power  = 100,
 };
 
-static struct twl4030_usb_data omap4_usbphy_data = {
-   .phy_init   = omap4430_phy_init,
-   .phy_exit   = omap4430_phy_exit,
-   .phy_power  = omap4430_phy_power,
-   .phy_set_clock  = omap4430_phy_set_clk,
-   .phy_suspend= omap4430_phy_suspend,
-};
-
 static struct omap2_hsmmc_info mmc[] = {
{
.mmc= 2,
@@ -338,12 +330,6 @@ static struct regulator_consumer_supply 
sdp4430_vaux_supply[] = {
.dev_name = omap_hsmmc.1,
},
 };
-static struct regulator_consumer_supply sdp4430_vmmc_supply[] = {
-   {
-   .supply = vmmc,
-   .dev_name = omap_hsmmc.0,
-   },
-};
 
 static int omap4_twl6030_hsmmc_late_init(struct device *dev)
 {
@@ -403,61 +389,6 @@ static struct regulator_init_data sdp4430_vaux1 = {
.consumer_supplies  = sdp4430_vaux_supply,
 };
 
-static struct regulator_init_data sdp4430_vaux2 = {
-   .constraints = {
-   .min_uV = 120,
-   .max_uV = 280,
-   .apply_uV   = true,
-   .valid_modes_mask   = REGULATOR_MODE_NORMAL
-   | REGULATOR_MODE_STANDBY,
-   .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
-   | REGULATOR_CHANGE_MODE
-   | REGULATOR_CHANGE_STATUS,
-   },
-};
-
-static struct regulator_init_data sdp4430_vaux3 = {
-   .constraints = {
-   .min_uV = 100,
-   .max_uV = 300,
-   .apply_uV   = true,
-   .valid_modes_mask   = REGULATOR_MODE_NORMAL
-   | REGULATOR_MODE_STANDBY,
-   .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
-   | REGULATOR_CHANGE_MODE
-   | REGULATOR_CHANGE_STATUS,
-   },
-};
-
-/* VMMC1 for MMC1 card */
-static struct regulator_init_data sdp4430_vmmc = {
-   .constraints = {
-   .min_uV = 120,
-   .max_uV = 300,
-   .apply_uV   = true,
-   .valid_modes_mask   = REGULATOR_MODE_NORMAL
-   | REGULATOR_MODE_STANDBY,
-   .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
-   | REGULATOR_CHANGE_MODE
-   | REGULATOR_CHANGE_STATUS,
-   },
-   .num_consumer_supplies  = 1,
-   .consumer_supplies  = sdp4430_vmmc_supply,
-};
-
-static struct regulator_init_data sdp4430_vpp = {
-   .constraints = {
-   .min_uV = 180,
-   .max_uV = 250,
-   .apply_uV   = true,
-   .valid_modes_mask   = REGULATOR_MODE_NORMAL
-   | REGULATOR_MODE_STANDBY,
-   .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
-   | REGULATOR_CHANGE_MODE
-   | REGULATOR_CHANGE_STATUS,
-   },
-};
-
 static struct regulator_init_data sdp4430_vusim = {
.constraints = {
.min_uV = 120,
@@ -471,74 +402,10 @@ static struct regulator_init_data sdp4430_vusim = {
},
 };
 
-static struct regulator_init_data sdp4430_vana = {
-   .constraints = {
-   .min_uV = 210,
-   .max_uV = 210,
-   .valid_modes_mask   = REGULATOR_MODE_NORMAL
-   | REGULATOR_MODE_STANDBY,
-   .valid_ops_mask  = REGULATOR_CHANGE_MODE
-   | REGULATOR_CHANGE_STATUS,
-   },
-};
-
-static struct regulator_init_data sdp4430_vcxio = {
-   .constraints

[PATCH v2 05/12] MFD: twl4030-codec: Rename internals from codec to audio

2011-06-07 Thread Peter Ujfalusi
In preparation of renaming the driver from twl4030-codec
to twl4030-audio, first do some clean ups in the driver,
which does not cause any problems outside.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 drivers/mfd/twl4030-codec.c |  135 ++-
 1 files changed, 68 insertions(+), 67 deletions(-)

diff --git a/drivers/mfd/twl4030-codec.c b/drivers/mfd/twl4030-codec.c
index 2bf4136..e1782b3 100644
--- a/drivers/mfd/twl4030-codec.c
+++ b/drivers/mfd/twl4030-codec.c
@@ -1,5 +1,6 @@
 /*
- * MFD driver for twl4030 codec submodule
+ * MFD driver for twl4030 audio submodule, which contains an audio codec, and
+ * the vibra control.
  *
  * Author: Peter Ujfalusi peter.ujfal...@ti.com
  *
@@ -31,53 +32,53 @@
 #include linux/mfd/core.h
 #include linux/mfd/twl4030-codec.h
 
-#define TWL4030_CODEC_CELLS2
+#define TWL4030_AUDIO_CELLS2
 
-static struct platform_device *twl4030_codec_dev;
+static struct platform_device *twl4030_audio_dev;
 
-struct twl4030_codec_resource {
+struct twl4030_audio_resource {
int request_count;
u8 reg;
u8 mask;
 };
 
-struct twl4030_codec {
+struct twl4030_audio {
unsigned int audio_mclk;
struct mutex mutex;
-   struct twl4030_codec_resource resource[TWL4030_CODEC_RES_MAX];
-   struct mfd_cell cells[TWL4030_CODEC_CELLS];
+   struct twl4030_audio_resource resource[TWL4030_CODEC_RES_MAX];
+   struct mfd_cell cells[TWL4030_AUDIO_CELLS];
 };
 
 /*
  * Modify the resource, the function returns the content of the register
  * after the modification.
  */
-static int twl4030_codec_set_resource(enum twl4030_codec_res id, int enable)
+static int twl4030_audio_set_resource(enum twl4030_codec_res id, int enable)
 {
-   struct twl4030_codec *codec = platform_get_drvdata(twl4030_codec_dev);
+   struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
u8 val;
 
twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, val,
-   codec-resource[id].reg);
+   audio-resource[id].reg);
 
if (enable)
-   val |= codec-resource[id].mask;
+   val |= audio-resource[id].mask;
else
-   val = ~codec-resource[id].mask;
+   val = ~audio-resource[id].mask;
 
twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
-   val, codec-resource[id].reg);
+   val, audio-resource[id].reg);
 
return val;
 }
 
-static inline int twl4030_codec_get_resource(enum twl4030_codec_res id)
+static inline int twl4030_audio_get_resource(enum twl4030_codec_res id)
 {
-   struct twl4030_codec *codec = platform_get_drvdata(twl4030_codec_dev);
+   struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
u8 val;
 
twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, val,
-   codec-resource[id].reg);
+   audio-resource[id].reg);
 
return val;
 }
@@ -88,24 +89,24 @@ static inline int twl4030_codec_get_resource(enum 
twl4030_codec_res id)
  */
 int twl4030_codec_enable_resource(enum twl4030_codec_res id)
 {
-   struct twl4030_codec *codec = platform_get_drvdata(twl4030_codec_dev);
+   struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
int val;
 
if (id = TWL4030_CODEC_RES_MAX) {
-   dev_err(twl4030_codec_dev-dev,
+   dev_err(twl4030_audio_dev-dev,
Invalid resource ID (%u)\n, id);
return -EINVAL;
}
 
-   mutex_lock(codec-mutex);
-   if (!codec-resource[id].request_count)
+   mutex_lock(audio-mutex);
+   if (!audio-resource[id].request_count)
/* Resource was disabled, enable it */
-   val = twl4030_codec_set_resource(id, 1);
+   val = twl4030_audio_set_resource(id, 1);
else
-   val = twl4030_codec_get_resource(id);
+   val = twl4030_audio_get_resource(id);
 
-   codec-resource[id].request_count++;
-   mutex_unlock(codec-mutex);
+   audio-resource[id].request_count++;
+   mutex_unlock(audio-mutex);
 
return val;
 }
@@ -117,31 +118,31 @@ EXPORT_SYMBOL_GPL(twl4030_codec_enable_resource);
  */
 int twl4030_codec_disable_resource(unsigned id)
 {
-   struct twl4030_codec *codec = platform_get_drvdata(twl4030_codec_dev);
+   struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
int val;
 
if (id = TWL4030_CODEC_RES_MAX) {
-   dev_err(twl4030_codec_dev-dev,
+   dev_err(twl4030_audio_dev-dev,
Invalid resource ID (%u)\n, id);
return -EINVAL;
}
 
-   mutex_lock(codec-mutex);
-   if (!codec-resource[id].request_count) {
-   dev_err(twl4030_codec_dev-dev,
+   mutex_lock(audio-mutex);
+   if (!audio

[PATCH v2 06/12] MFD: twl4030-codec - twl4030-audio: Rename the driver

2011-06-07 Thread Peter Ujfalusi
Rename the driver, and header file from twl4030-codec to
twl4030-audio.
To avoid breakage change depending drivers at the same time.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
CC: Misael Lopez Cruz misael.lo...@ti.com
---
 drivers/input/misc/Kconfig |2 +-
 drivers/input/misc/twl4030-vibra.c |   10 +-
 drivers/mfd/Kconfig|2 +-
 drivers/mfd/Makefile   |2 +-
 drivers/mfd/twl4030-audio.c|  278 
 drivers/mfd/twl4030-codec.c|  278 
 include/linux/mfd/twl4030-audio.h  |  272 +++
 include/linux/mfd/twl4030-codec.h  |  272 ---
 sound/soc/codecs/Kconfig   |2 +-
 sound/soc/codecs/twl4030.c |   16 +-
 sound/soc/omap/sdp3430.c   |2 +-
 sound/soc/omap/zoom2.c |2 +-
 12 files changed, 569 insertions(+), 569 deletions(-)
 create mode 100644 drivers/mfd/twl4030-audio.c
 delete mode 100644 drivers/mfd/twl4030-codec.c
 create mode 100644 include/linux/mfd/twl4030-audio.h
 delete mode 100644 include/linux/mfd/twl4030-codec.h

diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 45dc6aa..077309a 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -267,7 +267,7 @@ config INPUT_TWL4030_PWRBUTTON
 config INPUT_TWL4030_VIBRA
tristate Support for TWL4030 Vibrator
depends on TWL4030_CORE
-   select TWL4030_CODEC
+   select MFD_TWL4030_AUDIO
select INPUT_FF_MEMLESS
help
  This option enables support for TWL4030 Vibrator Driver.
diff --git a/drivers/input/misc/twl4030-vibra.c 
b/drivers/input/misc/twl4030-vibra.c
index 014dd4a..7abca85 100644
--- a/drivers/input/misc/twl4030-vibra.c
+++ b/drivers/input/misc/twl4030-vibra.c
@@ -28,7 +28,7 @@
 #include linux/platform_device.h
 #include linux/workqueue.h
 #include linux/i2c/twl.h
-#include linux/mfd/twl4030-codec.h
+#include linux/mfd/twl4030-audio.h
 #include linux/input.h
 #include linux/slab.h
 
@@ -67,7 +67,7 @@ static void vibra_enable(struct vibra_info *info)
 {
u8 reg;
 
-   twl4030_codec_enable_resource(TWL4030_CODEC_RES_POWER);
+   twl4030_audio_enable_resource(TWL4030_AUDIO_RES_POWER);
 
/* turn H-Bridge on */
twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE,
@@ -75,7 +75,7 @@ static void vibra_enable(struct vibra_info *info)
twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
 (reg | TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL);
 
-   twl4030_codec_enable_resource(TWL4030_CODEC_RES_APLL);
+   twl4030_audio_enable_resource(TWL4030_AUDIO_RES_APLL);
 
info-enabled = true;
 }
@@ -90,8 +90,8 @@ static void vibra_disable(struct vibra_info *info)
twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
 (reg  ~TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL);
 
-   twl4030_codec_disable_resource(TWL4030_CODEC_RES_APLL);
-   twl4030_codec_disable_resource(TWL4030_CODEC_RES_POWER);
+   twl4030_audio_disable_resource(TWL4030_AUDIO_RES_APLL);
+   twl4030_audio_disable_resource(TWL4030_AUDIO_RES_POWER);
 
info-enabled = false;
 }
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 0f09c05..3a6f76a 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -218,7 +218,7 @@ config TWL4030_POWER
  and load scripts controlling which resources are switched off/on
  or reset when a sleep, wakeup or warm reset event occurs.
 
-config TWL4030_CODEC
+config MFD_TWL4030_AUDIO
bool
depends on TWL4030_CORE
select MFD_CORE
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index efe3cc3..4cf9465 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -40,7 +40,7 @@ obj-$(CONFIG_MENELAUS)+= menelaus.o
 obj-$(CONFIG_TWL4030_CORE) += twl-core.o twl4030-irq.o twl6030-irq.o
 obj-$(CONFIG_TWL4030_MADC)  += twl4030-madc.o
 obj-$(CONFIG_TWL4030_POWER)+= twl4030-power.o
-obj-$(CONFIG_TWL4030_CODEC)+= twl4030-codec.o
+obj-$(CONFIG_MFD_TWL4030_AUDIO)+= twl4030-audio.o
 obj-$(CONFIG_TWL6030_PWM)  += twl6030-pwm.o
 
 obj-$(CONFIG_MFD_MC13XXX)  += mc13xxx-core.o
diff --git a/drivers/mfd/twl4030-audio.c b/drivers/mfd/twl4030-audio.c
new file mode 100644
index 000..467ddb8
--- /dev/null
+++ b/drivers/mfd/twl4030-audio.c
@@ -0,0 +1,278 @@
+/*
+ * MFD driver for twl4030 audio submodule, which contains an audio codec, and
+ * the vibra control.
+ *
+ * Author: Peter Ujfalusi peter.ujfal...@ti.com
+ *
+ * Copyright:   (C) 2009 Nokia Corporation
+ *
+ * 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

[PATCH v2 03/12] OMAP3: Move common pmic configuration to pmic-common

2011-06-07 Thread Peter Ujfalusi
Reduce the amount of duplicated code by moving the common
configuration for twl4030/5030/tpsxx to the pmic-common file.
Use the omap3_pmic_config function from board files to
properly configure the PMIC with the common fields.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-3430sdp.c  |   42 ++--
 arch/arm/mach-omap2/board-cm-t35.c   |9 +
 arch/arm/mach-omap2/board-devkit8000.c   |   18 +
 arch/arm/mach-omap2/board-igep0020.c |   20 ++
 arch/arm/mach-omap2/board-ldp.c  |   15 +--
 arch/arm/mach-omap2/board-omap3beagle.c  |   18 +
 arch/arm/mach-omap2/board-omap3evm.c |   24 +--
 arch/arm/mach-omap2/board-omap3pandora.c |   17 +---
 arch/arm/mach-omap2/board-omap3stalker.c |   24 +--
 arch/arm/mach-omap2/board-omap3touchbook.c   |   19 +
 arch/arm/mach-omap2/board-overo.c|   17 +---
 arch/arm/mach-omap2/board-rm680.c|8 +---
 arch/arm/mach-omap2/board-rx51-peripherals.c |   15 +--
 arch/arm/mach-omap2/board-zoom-peripherals.c |   51 +
 arch/arm/mach-omap2/pmic-common.c|   53 ++
 arch/arm/mach-omap2/pmic-common.h|6 +++
 16 files changed, 99 insertions(+), 257 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index ae2963a..e9dbf5d 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -231,22 +231,6 @@ static void __init omap_3430sdp_init_early(void)
omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL);
 }
 
-static int sdp3430_batt_table[] = {
-/* 0 C*/
-30800, 29500, 28300, 27100,
-26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
-17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
-11600, 11200, 10800, 10400, 1, 9630,   9280,   8950,   8620,   8310,
-8020,   7730,   7460,   7200,   6950,   6710,   6470,   6250,   6040,   5830,
-5640,   5450,   5260,   5090,   4920,   4760,   4600,   4450,   4310,   4170,
-4040,   3910,   3790,   3670,   3550
-};
-
-static struct twl4030_bci_platform_data sdp3430_bci_data = {
-   .battery_tmp_tbl= sdp3430_batt_table,
-   .tblsize= ARRAY_SIZE(sdp3430_batt_table),
-};
-
 static struct omap2_hsmmc_info mmc[] = {
{
.mmc= 1,
@@ -292,14 +276,6 @@ static struct twl4030_gpio_platform_data sdp3430_gpio_data 
= {
.setup  = sdp3430_twl_gpio_setup,
 };
 
-static struct twl4030_usb_data sdp3430_usb_data = {
-   .usb_mode   = T2_USB_MODE_ULPI,
-};
-
-static struct twl4030_madc_platform_data sdp3430_madc_data = {
-   .irq_line   = 1,
-};
-
 /* regulator consumer mappings */
 
 /* ads7846 on SPI */
@@ -463,24 +439,10 @@ static struct regulator_init_data sdp3430_vpll2 = {
.consumer_supplies  = sdp3430_vpll2_supplies,
 };
 
-static struct twl4030_codec_audio_data sdp3430_audio;
-
-static struct twl4030_codec_data sdp3430_codec = {
-   .audio_mclk = 2600,
-   .audio = sdp3430_audio,
-};
-
 static struct twl4030_platform_data sdp3430_twldata = {
-   .irq_base   = TWL4030_IRQ_BASE,
-   .irq_end= TWL4030_IRQ_END,
-
/* platform_data for children goes here */
-   .bci= sdp3430_bci_data,
.gpio   = sdp3430_gpio_data,
-   .madc   = sdp3430_madc_data,
.keypad = sdp3430_kp_data,
-   .usb= sdp3430_usb_data,
-   .codec  = sdp3430_codec,
 
.vaux1  = sdp3430_vaux1,
.vaux2  = sdp3430_vaux2,
@@ -496,7 +458,11 @@ static struct twl4030_platform_data sdp3430_twldata = {
 static int __init omap3430_i2c_init(void)
 {
/* i2c1 for PMIC only */
+   omap3_pmic_get_config(sdp3430_twldata,
+ TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_BCI |
+ TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_CODEC, 0);
omap3_pmic_init(twl4030, sdp3430_twldata);
+
/* i2c2 on camera connector (for sensor control) and optional isp1301 */
omap_register_i2c_bus(2, 400, NULL, 0);
/* i2c3 on display connector (for DVI, tfp410) */
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index c63115b..dcde1df 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -412,10 +412,6 @@ static struct regulator_init_data cm_t35_vpll2 = {
.consumer_supplies  = cm_t35_vdvi_supply,
 };
 
-static struct twl4030_usb_data cm_t35_usb_data = {
-   .usb_mode   = T2_USB_MODE_ULPI,
-};
-
 static uint32_t cm_t35_keymap[] = {
KEY(0, 0, KEY_A),   KEY(0, 1, KEY_B),   KEY(0, 2, KEY_LEFT),
KEY(1, 0, KEY_UP),  KEY(1, 1, KEY_ENTER),   KEY(1, 2, KEY_DOWN),
@@ -498,12 +494,8 @@ static

[PATCH v2 07/12] MFD: twl4030-audio: Rename platform data

2011-06-07 Thread Peter Ujfalusi
Allign the platform data names for twl4030 audio submodule:
twl4030_audio_data: for the core MFD driver
twl4030_codec_data: for ASoC codec driver
twl4030_vibra_data: for the input/ForceFeedback driver

To avoid breakage, change all depending drivers, files
to use the new types.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-3430sdp.c  |2 +-
 arch/arm/mach-omap2/board-devkit8000.c   |2 +-
 arch/arm/mach-omap2/board-igep0020.c |2 +-
 arch/arm/mach-omap2/board-omap3beagle.c  |2 +-
 arch/arm/mach-omap2/board-omap3evm.c |2 +-
 arch/arm/mach-omap2/board-omap3pandora.c |2 +-
 arch/arm/mach-omap2/board-omap3stalker.c |2 +-
 arch/arm/mach-omap2/board-omap3touchbook.c   |2 +-
 arch/arm/mach-omap2/board-overo.c|2 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c |6 +++---
 arch/arm/mach-omap2/board-zoom-peripherals.c |   12 ++--
 arch/arm/mach-omap2/pmic-common.c|   10 +-
 arch/arm/mach-omap2/pmic-common.h|2 +-
 drivers/input/misc/twl4030-vibra.c   |2 +-
 drivers/mfd/twl-core.c   |8 
 drivers/mfd/twl4030-audio.c  |8 
 include/linux/i2c/twl.h  |   12 ++--
 sound/soc/codecs/twl4030.c   |6 +++---
 sound/soc/codecs/twl6040.c   |2 +-
 19 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 87cf2b7..a4b4691 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -418,7 +418,7 @@ static int __init omap3430_i2c_init(void)
/* i2c1 for PMIC only */
omap3_pmic_get_config(sdp3430_twldata,
TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_BCI |
-   TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_CODEC,
+   TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO,
TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
sdp3430_twldata.vdac-constraints.apply_uV = true;
sdp3430_twldata.vpll2-constraints.apply_uV = true;
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index 3a0d90c..b61ab68 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -328,7 +328,7 @@ static struct twl4030_platform_data devkit8000_twldata = {
 static int __init devkit8000_i2c_init(void)
 {
omap3_pmic_get_config(devkit8000_twldata,
- TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_CODEC,
+ TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO,
  TWL_COMMON_REGULATOR_VDAC);
omap3_pmic_init(tps65930, devkit8000_twldata);
/* Bus 3 is attached to the DVI port where devices like the pico DLP
diff --git a/arch/arm/mach-omap2/board-igep0020.c 
b/arch/arm/mach-omap2/board-igep0020.c
index 109bbeb..48f86e1 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -557,7 +557,7 @@ static void __init igep_i2c_init(void)
 
igep_twldata.keypad = igep2_keypad_pdata;
/* Get common pmic data */
-   omap3_pmic_get_config(igep_twldata, TWL_COMMON_PDATA_CODEC,
+   omap3_pmic_get_config(igep_twldata, TWL_COMMON_PDATA_AUDIO,
  TWL_COMMON_REGULATOR_VPLL2);
igep_twldata.vpll2-constraints.apply_uV = true;
igep_twldata.vpll2-constraints.name = VDVI;
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index 6e092f0..bc79cfb 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -362,7 +362,7 @@ static struct i2c_board_info __initdata beagle_i2c_eeprom[] 
= {
 static int __init omap3_beagle_i2c_init(void)
 {
omap3_pmic_get_config(beagle_twldata,
-   TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_CODEC,
+   TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO,
TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
beagle_twldata.vpll2-constraints.name = VDVI;
 
diff --git a/arch/arm/mach-omap2/board-omap3evm.c 
b/arch/arm/mach-omap2/board-omap3evm.c
index 38d4075..e6fa723 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -507,7 +507,7 @@ static int __init omap3_evm_i2c_init(void)
 {
omap3_pmic_get_config(omap3evm_twldata,
TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC |
-   TWL_COMMON_PDATA_CODEC,
+   TWL_COMMON_PDATA_AUDIO,
TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
omap3evm_twldata.vdac-constraints.apply_uV

[PATCH v2 08/12] mfd: twl6040: Add initial support

2011-06-07 Thread Peter Ujfalusi
From: Misael Lopez Cruz misael.lo...@ti.com

TWL6040 IC provides analog high-end audio codec functions for
handset applications. It contains several audio analog inputs
and outputs as well as vibrator support. It's connected to the
host processor via PDM interface for audio data communication.
The audio modules are controlled by internal registers that
can be accessed by I2C and PDM interface.

TWL6040 MFD will be registered as a child of TWL-CORE, and will
have two children of its own: twl6040-codec and twl6040-vibra.

This driver is based on TWL4030 and WM8350 MFD drivers.

Signed-off-by: Misael Lopez Cruz misael.lo...@ti.com
Signed-off-by: Jorge Eduardo Candelaria jorge.candela...@ti.com
Signed-off-by: Margarita Olaya Cabrera magi.ol...@ti.com
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/plat-omap/include/plat/irqs.h |   12 +-
 drivers/mfd/Kconfig|6 +
 drivers/mfd/Makefile   |1 +
 drivers/mfd/twl-core.c |5 +-
 drivers/mfd/twl6040-core.c |  589 
 drivers/mfd/twl6040-irq.c  |  205 +++
 include/linux/i2c/twl.h|1 +
 include/linux/mfd/twl6040.h|  260 ++
 8 files changed, 1074 insertions(+), 5 deletions(-)
 create mode 100644 drivers/mfd/twl6040-core.c
 create mode 100644 drivers/mfd/twl6040-irq.c
 create mode 100644 include/linux/mfd/twl6040.h

diff --git a/arch/arm/plat-omap/include/plat/irqs.h 
b/arch/arm/plat-omap/include/plat/irqs.h
index 5a25098..2cfba51 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -407,11 +407,19 @@
 #endif
 #define TWL6030_IRQ_END(TWL6030_IRQ_BASE + 
TWL6030_BASE_NR_IRQS)
 
+#define TWL6040_CODEC_IRQ_BASE TWL6030_IRQ_END
+#ifdef CONFIG_TWL6040_CODEC
+#define TWL6040_CODEC_NR_IRQS  6
+#else
+#define TWL6040_CODEC_NR_IRQS  0
+#endif
+#define TWL6040_CODEC_IRQ_END  (TWL6040_CODEC_IRQ_BASE + TWL6040_CODEC_NR_IRQS)
+
 /* Total number of interrupts depends on the enabled blocks above */
-#if (TWL4030_GPIO_IRQ_END  TWL6030_IRQ_END)
+#if (TWL4030_GPIO_IRQ_END  TWL6040_CODEC_IRQ_END)
 #define TWL_IRQ_ENDTWL4030_GPIO_IRQ_END
 #else
-#define TWL_IRQ_ENDTWL6030_IRQ_END
+#define TWL_IRQ_ENDTWL6040_CODEC_IRQ_END
 #endif
 
 /* GPMC related */
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 3a6f76a..ac6b4ae 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -233,6 +233,12 @@ config TWL6030_PWM
  Say yes here if you want support for TWL6030 PWM.
  This is used to control charging LED brightness.
 
+config TWL6040_CORE
+   bool
+   depends on TWL4030_CORE  GENERIC_HARDIRQS
+   select MFD_CORE
+   default n
+
 config MFD_STMPE
bool Support STMicroelectronics STMPE
depends on I2C=y  GENERIC_HARDIRQS
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 4cf9465..41f3b61 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -42,6 +42,7 @@ obj-$(CONFIG_TWL4030_MADC)  += twl4030-madc.o
 obj-$(CONFIG_TWL4030_POWER)+= twl4030-power.o
 obj-$(CONFIG_MFD_TWL4030_AUDIO)+= twl4030-audio.o
 obj-$(CONFIG_TWL6030_PWM)  += twl6030-pwm.o
+obj-$(CONFIG_TWL6040_CORE) += twl6040-core.o twl6040-irq.o
 
 obj-$(CONFIG_MFD_MC13XXX)  += mc13xxx-core.o
 
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index f9d7880..a2eddc7 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -110,7 +110,7 @@
 #endif
 
 #if defined(CONFIG_TWL4030_CODEC) || defined(CONFIG_TWL4030_CODEC_MODULE) ||\
-   defined(CONFIG_SND_SOC_TWL6040) || 
defined(CONFIG_SND_SOC_TWL6040_MODULE)
+   defined(CONFIG_TWL6040_CORE) || defined(CONFIG_TWL6040_CORE_MODULE)
 #define twl_has_codec()true
 #else
 #define twl_has_codec()false
@@ -824,10 +824,9 @@ add_children(struct twl4030_platform_data *pdata, unsigned 
long features)
return PTR_ERR(child);
}
 
-   /* Phoenix codec driver is probed directly atm */
if (twl_has_codec()  pdata-audio  twl_class_is_6030()) {
sub_chip_id = twl_map[TWL_MODULE_AUDIO_VOICE].sid;
-   child = add_child(sub_chip_id, twl6040-codec,
+   child = add_child(sub_chip_id, twl6040,
pdata-audio, sizeof(*pdata-audio),
false, 0, 0);
if (IS_ERR(child))
diff --git a/drivers/mfd/twl6040-core.c b/drivers/mfd/twl6040-core.c
new file mode 100644
index 000..5abdcb2
--- /dev/null
+++ b/drivers/mfd/twl6040-core.c
@@ -0,0 +1,589 @@
+/*
+ * MFD driver for TWL6040 audio device
+ *
+ * Authors:Misael Lopez Cruz misael.lo...@ti.com
+ * Jorge Eduardo Candelaria jorge.candela...@ti.com
+ * Peter Ujfalusi peter.ujfal...@ti.com
+ *
+ * Copyright:  (C) 2011 Texas Instruments, Inc.
+ *
+ * This program is free

<    1   2   3   4   5   6   7   8   9   10   >