RE: [PATCHv6 2/2][RESEND] ASoC: TWL6040: Add twl6040 codec driver

2010-03-18 Thread Olaya, Margarita
On Thursday, March 18, 2010 12:28 PM  Kevin Hilman wrote: 

> 
> [...]
> 
>> Looks like MUA trouble.  From the message headers it looks like you
>> might be using Outlook or something, I'm not sure what to suggest
>> for that - enough folks at TI are submitting patches that
>> something must've been worked out for your mail system.
> 
> Indeed, You need to get outlook out of the picture for
> sending patches.
> 
> Using git-format-patch + git-send-email directly to your SMTP
> servers seems to be working well for others inside TI.
> 
> Kevin

Yeah, I'm using Outlook because I had some issues with my server
and git-send-email. I'll review my configurations to avoid this
kind of problems in futures post.

Thanks & Regards,
Margarita --
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: [PATCHv6 2/2][RESEND] ASoC: TWL6040: Add twl6040 codec driver

2010-03-18 Thread Olaya, Margarita
On Thursday, March 18, 2010 12:16 PM  Mark Brown wrote: 

> 
> The quoted printable encoding should be fine but note that
> the 'aic26.o'
> has been word wrapped onto a new line, which is why patch
> says the diff
> is corrupted.  The same word wrapping issue is occurring in
> other places
> in the diff such as:
> 
> +   /* allow registers to be accessed by i2c */
> +   twl6040_write(codec, TWL6040_REG_ACCCTL,
> cache[TWL6040_REG_ACCCTL])=
> ;
> 
> Looks like MUA trouble.  From the message headers it looks like you
> might be using Outlook or something, I'm not sure what to suggest
> for that - enough folks at TI are submitting patches that
> something must've
> been worked out for your mail system.
> 
> If you can't work out a solution for sending things in-line0 then
> sending the patch as an attachment should resolve the issue.

Mark,

Please find attached the patch. I'm working to fix the issues with the
MUA.

Regards,
Margarita

0002-ASoC-TWL6040-Add-twl6040-codec-driver.patch
Description: 0002-ASoC-TWL6040-Add-twl6040-codec-driver.patch


[PATCHv6 2/2][RESEND] ASoC: TWL6040: Add twl6040 codec driver

2010-03-18 Thread Olaya, Margarita
From: Misael Lopez Cruz 

Initial version of TWL6040 codec driver.

The TWL6040 codec uses a proprietary PDM-based digital audio interface.
Audio paths supported are:

- Input: Main Mic, Sub Mic, Headset Mic, Auxiliary-FM Left/Right
- Output: Headset Left/Right, Handsfree Left/Right

TWL6040 codec supports power-up/down manual and automatic sequence.
Manual sequence is done through a specific register writes sequence.
Automatic sequence is done when the codec is powered-up through the
external AUDPWRON line. The completion of the sequence is signaled
through the audio interrupt.

TWL6040 codec sysclk can be provided by: low-power or high
performance PLL:

- The low-power PLL takes a low-frequency input at 32,768 Hz and
generates an approximate of 17.64 or 19.2 MHz (for 44.1 KHz and 48 KHz
respectively)

- The high-performance PLL generates an exact 19.2 MHz clock signal
from high-frequency input at 12/19.2/26/38.4 MHz.

Low-power playback mode is a special scenario where only headset path
(headset DAC and driver) is active.

For the particular case of headset path, PLL being used defines the
headset power mode: low-power, high-performance.

Signed-off-by: Misael Lopez Cruz 
Signed-off-by: Jorge Eduardo Candelaria 
Signed-off-by: Margarita Olaya Cabrera 
---
 sound/soc/codecs/Kconfig   |4 +
 sound/soc/codecs/Makefile  |2 +
 sound/soc/codecs/twl6040.c | 1227 
 sound/soc/codecs/twl6040.h |  141 +
 4 files changed, 1374 insertions(+), 0 deletions(-)
 create mode 100755 sound/soc/codecs/twl6040.c
 create mode 100644 sound/soc/codecs/twl6040.h

diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 16c47ed..398cbb0 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -35,6 +35,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_TPA6130A2 if I2C
select SND_SOC_TLV320DAC33 if I2C
select SND_SOC_TWL4030 if TWL4030_CORE
+   select SND_SOC_TWL6040 if TWL4030_CORE
select SND_SOC_UDA134X
select SND_SOC_UDA1380 if I2C
select SND_SOC_WM2000 if I2C
@@ -168,6 +169,9 @@ config SND_SOC_TWL4030
select TWL4030_CODEC
tristate

+config SND_SOC_TWL6040
+   tristate
+
 config SND_SOC_UDA134X
tristate

diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index 6981777..98bd10c 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -22,6 +22,7 @@ snd-soc-tlv320aic26-objs := tlv320aic26.o
 snd-soc-tlv320aic3x-objs := tlv320aic3x.o
 snd-soc-tlv320dac33-objs := tlv320dac33.o
 snd-soc-twl4030-objs := twl4030.o
+snd-soc-twl6040-objs := twl6040.o
 snd-soc-uda134x-objs := uda134x.o
 snd-soc-uda1380-objs := uda1380.o
 snd-soc-wm8350-objs := wm8350.o
@@ -85,6 +86,7 @@ obj-$(CONFIG_SND_SOC_TLV320AIC26) += snd-soc-tlv320aic26.o
 obj-$(CONFIG_SND_SOC_TLV320AIC3X)  += snd-soc-tlv320aic3x.o
 obj-$(CONFIG_SND_SOC_TLV320DAC33)  += snd-soc-tlv320dac33.o
 obj-$(CONFIG_SND_SOC_TWL4030)  += snd-soc-twl4030.o
+obj-$(CONFIG_SND_SOC_TWL6040)  += snd-soc-twl6040.o
 obj-$(CONFIG_SND_SOC_UDA134X)  += snd-soc-uda134x.o
 obj-$(CONFIG_SND_SOC_UDA1380)  += snd-soc-uda1380.o
 obj-$(CONFIG_SND_SOC_WM8350)   += snd-soc-wm8350.o
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
new file mode 100755
index 000..0e4dce7
--- /dev/null
+++ b/sound/soc/codecs/twl6040.c
@@ -0,0 +1,1227 @@
+/*
+ * ALSA SoC TWL6040 codec driver
+ *
+ * Author:  Misael Lopez Cruz 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "twl6040.h"
+
+#define TWL6040_RATES   (SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
+#define TWL6040_FORMATS (SNDRV_PCM_FMTBIT_S32_LE)
+
+/* codec private data */
+struct twl6040_data {
+   struct snd_soc_codec codec;
+   int audpwron;
+   int naudint;
+   int codec_powered;
+   int pll;
+   int non_lp;
+   unsigned int sysclk;
+   struct snd_pcm_hw_constraint_list *sysclk_constraints;
+   struct completion ready;
+};
+
+/*
+ * twl6040 register cache & default register settings
+ */
+static const u8 twl6040_reg[TWL6040_CACHEREGNUM] = {
+   0x00, /* not used   0x00*/
+ 

[PATCHv6 2/2] ASoC: TWL6040: Add twl6040 codec driver

2010-03-17 Thread Olaya, Margarita
From: Misael Lopez Cruz 

Initial version of TWL6040 codec driver.

The TWL6040 codec uses a proprietary PDM-based digital audio interface.
Audio paths supported are:

- Input: Main Mic, Sub Mic, Headset Mic, Auxiliary-FM Left/Right
- Output: Headset Left/Right, Handsfree Left/Right

TWL6040 codec supports power-up/down manual and automatic sequence.
Manual sequence is done through a specific register writes sequence.
Automatic sequence is done when the codec is powered-up through the
external AUDPWRON line. The completion of the sequence is signaled
through the audio interrupt.

TWL6040 codec sysclk can be provided by: low-power or high
performance PLL:

- The low-power PLL takes a low-frequency input at 32,768 Hz and
generates an approximate of 17.64 or 19.2 MHz (for 44.1 KHz and 48 KHz
respectively)

- The high-performance PLL generates an exact 19.2 MHz clock signal
from high-frequency input at 12/19.2/26/38.4 MHz.

Low-power playback mode is a special scenario where only headset path
(headset DAC and driver) is active.

For the particular case of headset path, PLL being used defines the
headset power mode: low-power, high-performance.

Signed-off-by: Misael Lopez Cruz 
Signed-off-by: Jorge Eduardo Candelaria 
Signed-off-by: Margarita Olaya Cabrera 
---
 sound/soc/codecs/Kconfig   |4 +
 sound/soc/codecs/Makefile  |2 +
 sound/soc/codecs/twl6040.c | 1227 
 sound/soc/codecs/twl6040.h |  141 +
 4 files changed, 1374 insertions(+), 0 deletions(-)
 create mode 100644 sound/soc/codecs/twl6040.c
 create mode 100644 sound/soc/codecs/twl6040.h

diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 16c47ed..398cbb0 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -35,6 +35,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_TPA6130A2 if I2C
select SND_SOC_TLV320DAC33 if I2C
select SND_SOC_TWL4030 if TWL4030_CORE
+   select SND_SOC_TWL6040 if TWL4030_CORE
select SND_SOC_UDA134X
select SND_SOC_UDA1380 if I2C
select SND_SOC_WM2000 if I2C
@@ -168,6 +169,9 @@ config SND_SOC_TWL4030
select TWL4030_CODEC
tristate

+config SND_SOC_TWL6040
+   tristate
+
 config SND_SOC_UDA134X
tristate

diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index 6981777..98bd10c 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -22,6 +22,7 @@ snd-soc-tlv320aic26-objs := tlv320aic26.o
 snd-soc-tlv320aic3x-objs := tlv320aic3x.o
 snd-soc-tlv320dac33-objs := tlv320dac33.o
 snd-soc-twl4030-objs := twl4030.o
+snd-soc-twl6040-objs := twl6040.o
 snd-soc-uda134x-objs := uda134x.o
 snd-soc-uda1380-objs := uda1380.o
 snd-soc-wm8350-objs := wm8350.o
@@ -85,6 +86,7 @@ obj-$(CONFIG_SND_SOC_TLV320AIC26) += snd-soc-tlv320aic26.o
 obj-$(CONFIG_SND_SOC_TLV320AIC3X)  += snd-soc-tlv320aic3x.o
 obj-$(CONFIG_SND_SOC_TLV320DAC33)  += snd-soc-tlv320dac33.o
 obj-$(CONFIG_SND_SOC_TWL4030)  += snd-soc-twl4030.o
+obj-$(CONFIG_SND_SOC_TWL6040)  += snd-soc-twl6040.o
 obj-$(CONFIG_SND_SOC_UDA134X)  += snd-soc-uda134x.o
 obj-$(CONFIG_SND_SOC_UDA1380)  += snd-soc-uda1380.o
 obj-$(CONFIG_SND_SOC_WM8350)   += snd-soc-wm8350.o
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
new file mode 100644
index 000..b90bc60
--- /dev/null
+++ b/sound/soc/codecs/twl6040.c
@@ -0,0 +1,1227 @@
+/*
+ * ALSA SoC TWL6040 codec driver
+ *
+ * Author:  Misael Lopez Cruz 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "twl6040.h"
+
+#define TWL6040_RATES   (SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
+#define TWL6040_FORMATS (SNDRV_PCM_FMTBIT_S32_LE)
+
+/* codec private data */
+struct twl6040_data {
+   struct snd_soc_codec codec;
+   int audpwron;
+   int naudint;
+   int codec_powered;
+   int pll;
+   int non_lp;
+   unsigned int sysclk;
+   struct snd_pcm_hw_constraint_list *sysclk_constraints;
+   struct completion ready;
+};
+
+/*
+ * twl6040 register cache & default register settings
+ */
+static const u8 twl6040_reg[TWL6040_CACHEREGNUM] = {
+   0x00, /* not used   0x00*/
+ 

[PATCHv2 1/2] OMAP4: PMIC: Rename twl6030_codec as twl6040_codec

2010-03-17 Thread Olaya, Margarita
Correction for chips:
twl6030 is Phoenix Power chip
twl6040 is Phoenix Audio chip

Signed-off-by: Margarita Olaya Cabrera 
---
 drivers/mfd/twl-core.c  |4 ++--
 include/linux/i2c/twl.h |6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index 562cd49..720e099 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -109,7 +109,7 @@
 #endif
 
 #if defined(CONFIG_TWL4030_CODEC) || defined(CONFIG_TWL4030_CODEC_MODULE) ||\
-   defined(CONFIG_SND_SOC_TWL6030) || 
defined(CONFIG_SND_SOC_TWL6030_MODULE)
+   defined(CONFIG_SND_SOC_TWL6040) || 
defined(CONFIG_SND_SOC_TWL6040_MODULE)
 #define twl_has_codec()true
 #else
 #define twl_has_codec()false
@@ -708,7 +708,7 @@ add_children(struct twl4030_platform_data *pdata, unsigned 
long features)
/* Phoenix*/
if (twl_has_codec() && pdata->codec && twl_class_is_6030()) {
sub_chip_id = twl_map[TWL_MODULE_AUDIO_VOICE].sid;
-   child = add_child(sub_chip_id, "twl6030_codec",
+   child = add_child(sub_chip_id, "twl6040_codec",
pdata->codec, sizeof(*pdata->codec),
false, 0, 0);
if (IS_ERR(child))
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index fb6784e..ebd90ce 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -569,9 +569,9 @@ struct twl4030_codec_data {
struct twl4030_codec_audio_data *audio;
struct twl4030_codec_vibra_data *vibra;
 
-   /* twl6030 */
-   int audpwron_gpio;  /* audio power-on gpio */
-   int naudint_irq;/* audio interrupt */
+   /* twl6040 */
+   int audpwron_gpio;  /* audio power-on gpio */
+   int naudint_irq;/* audio interrupt */
 };
 
 struct twl4030_platform_data {
-- 
1.6.1.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


[PATCHv6 0/2] TWL6040 audio codec initial support

2010-03-17 Thread Olaya, Margarita
Following patch series add initial support for TWL6040 codec driver.
The patch set is based on the series sent from Misael Lopez in October 2009.

Changes from v5:
- Add CONFIG_PM for twl6040_suspend and twl6030_resume functions
- Add description for patch 1

Regards,
Margarita
---

Misael Lopez Cruz (1):
  ASoC: TWL6040: Add twl6040 codec driver

Margarita Olaya Cabrera (1):
  OMAP4: PMIC: Rename twl6030_codec as twl6040_codec

 drivers/mfd/twl-core.c |4 +-
 include/linux/i2c/twl.h|6 +-
 sound/soc/codecs/Kconfig   |4 +
 sound/soc/codecs/Makefile  |2 +
 sound/soc/codecs/twl6040.c | 1227 
 sound/soc/codecs/twl6040.h |  141 +
 6 files changed, 1379 insertions(+), 5 deletions(-)
 create mode 100644 sound/soc/codecs/twl6040.c
 create mode 100644 sound/soc/codecs/twl6040.h
--
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: [PATCHv5 2/2] ASoC: TWL6040: Add twl6040 codec driver

2010-03-16 Thread Olaya, Margarita
On Saturday, March 13, 2010 5:23 AM  Felipe Balbi wrote: 

> Hi,
> 
> On Fri, 12 Mar 2010 19:52:20 -0600, "Olaya, Margarita"
>  wrote:
>> +/*
>> + * twl6040 register cache & default register settings + */
>> +static const u8 twl6040_reg[TWL6040_CACHEREGNUM] = {
>> +   0x00, /* not used   0x00*/
>> +   0x4B, /* TWL6040_ASICID (ro)0x01*/
[snip]
> 
> a little comment about what the default values are would be nice.

Most of the codecs only have the register description, not sure if this
is an standard in alsa. Some values are kind of hard to describe briefly.

> 
> #ifdef CONFIG_PM
> 
>> +static int twl6040_suspend(struct platform_device *pdev,
[snip]
> 
> #else
> #define twl6040_suspendNULL
> #define twl6040_resume NULL
> #endif

I'll add this.

Regards,
Margarita

N�r��yb�X��ǧv�^�)޺{.n�+{��f��{ay�ʇڙ�,j��f���h���z��w���
���j:+v���w�j�mzZ+�ݢj"��!�i

RE: [PATCH 1/2] OMAP4: PMIC: Rename twl6030_codec as twl6040_codec

2010-03-16 Thread Olaya, Margarita
On Saturday, March 13, 2010 5:18 AM  Felipe Balbi wrote: 

> Hi,
> 
> On Fri, 12 Mar 2010 19:52:15 -0600, "Olaya, Margarita"
>  wrote:
> 
> please add a description here. Why do you need to rename it ?

Ok, I'll add a description. We were using twl6030 for Phoenix
Audio and Phoenix Power chips but Phoenix Audio is actually twl6040.

> 
>> Signed-off-by: Margarita Olaya Cabrera 
> 
> [snip]
> 
>>  if (twl_has_codec() && pdata->codec && twl_class_is_6030()) {
>>  sub_chip_id = twl_map[TWL_MODULE_AUDIO_VOICE].sid;
>> -child = add_child(sub_chip_id, "twl6030_codec",
>> +child = add_child(sub_chip_id, "twl6040_codec",
> 
> you rename the platform_device but no the platform_driver ??
> how do you expect the driver to probe() ??

Platform_driver register is called in twl6040.c file, I haven't found an issue
at probe.



[PATCHv5 2/2] ASoC: TWL6040: Add twl6040 codec driver

2010-03-12 Thread Olaya, Margarita
From: Misael Lopez Cruz 

Initial version of TWL6040 codec driver.

The TWL6040 codec uses a proprietary PDM-based digital audio interface.
Audio paths supported are:

- Input: Main Mic, Sub Mic, Headset Mic, Auxiliary-FM Left/Right
- Output: Headset Left/Right, Handsfree Left/Right

TWL6040 codec supports power-up/down manual and automatic sequence.
Manual sequence is done through a specific register writes sequence.
Automatic sequence is done when the codec is powered-up through the
external AUDPWRON line. The completion of the sequence is signaled
through the audio interrupt.

TWL6040 codec sysclk can be provided by: low-power or high
performance PLL:

- The low-power PLL takes a low-frequency input at 32,768 Hz and
generates an approximate of 17.64 or 19.2 MHz (for 44.1 KHz and 48 KHz
respectively)

- The high-performance PLL generates an exact 19.2 MHz clock signal
from high-frequency input at 12/19.2/26/38.4 MHz.

Low-power playback mode is a special scenario where only headset path
(headset DAC and driver) is active.

For the particular case of headset path, PLL being used defines the
headset power mode: low-power, high-performance.

Signed-off-by: Misael Lopez Cruz 
Signed-off-by: Jorge Eduardo Candelaria 
Signed-off-by: Margarita Olaya Cabrera 
---
 sound/soc/codecs/Kconfig   |4 +
 sound/soc/codecs/Makefile  |2 +
 sound/soc/codecs/twl6040.c | 1223 
 sound/soc/codecs/twl6040.h |  141 +
 4 files changed, 1370 insertions(+), 0 deletions(-)
 create mode 100644 sound/soc/codecs/twl6040.c
 create mode 100644 sound/soc/codecs/twl6040.h

diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 16c47ed..398cbb0 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -35,6 +35,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_TPA6130A2 if I2C
select SND_SOC_TLV320DAC33 if I2C
select SND_SOC_TWL4030 if TWL4030_CORE
+   select SND_SOC_TWL6040 if TWL4030_CORE
select SND_SOC_UDA134X
select SND_SOC_UDA1380 if I2C
select SND_SOC_WM2000 if I2C
@@ -168,6 +169,9 @@ config SND_SOC_TWL4030
select TWL4030_CODEC
tristate

+config SND_SOC_TWL6040
+   tristate
+
 config SND_SOC_UDA134X
tristate

diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index 6981777..98bd10c 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -22,6 +22,7 @@ snd-soc-tlv320aic26-objs := tlv320aic26.o
 snd-soc-tlv320aic3x-objs := tlv320aic3x.o
 snd-soc-tlv320dac33-objs := tlv320dac33.o
 snd-soc-twl4030-objs := twl4030.o
+snd-soc-twl6040-objs := twl6040.o
 snd-soc-uda134x-objs := uda134x.o
 snd-soc-uda1380-objs := uda1380.o
 snd-soc-wm8350-objs := wm8350.o
@@ -85,6 +86,7 @@ obj-$(CONFIG_SND_SOC_TLV320AIC26) += snd-soc-tlv320aic26.o
 obj-$(CONFIG_SND_SOC_TLV320AIC3X)  += snd-soc-tlv320aic3x.o
 obj-$(CONFIG_SND_SOC_TLV320DAC33)  += snd-soc-tlv320dac33.o
 obj-$(CONFIG_SND_SOC_TWL4030)  += snd-soc-twl4030.o
+obj-$(CONFIG_SND_SOC_TWL6040)  += snd-soc-twl6040.o
 obj-$(CONFIG_SND_SOC_UDA134X)  += snd-soc-uda134x.o
 obj-$(CONFIG_SND_SOC_UDA1380)  += snd-soc-uda1380.o
 obj-$(CONFIG_SND_SOC_WM8350)   += snd-soc-wm8350.o
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
new file mode 100644
index 000..54835cc
--- /dev/null
+++ b/sound/soc/codecs/twl6040.c
@@ -0,0 +1,1223 @@
+/*
+ * ALSA SoC TWL6040 codec driver
+ *
+ * Author:  Misael Lopez Cruz 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "twl6040.h"
+
+#define TWL6040_RATES   (SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
+#define TWL6040_FORMATS (SNDRV_PCM_FMTBIT_S32_LE)
+
+/* codec private data */
+struct twl6040_data {
+   struct snd_soc_codec codec;
+   int audpwron;
+   int naudint;
+   int codec_powered;
+   int pll;
+   int non_lp;
+   unsigned int sysclk;
+   struct snd_pcm_hw_constraint_list *sysclk_constraints;
+   struct completion ready;
+};
+
+/*
+ * twl6040 register cache & default register settings
+ */
+static const u8 twl6040_reg[TWL6040_CACHEREGNUM] = {
+   0x00, /* not used   0x00*/
+ 

[PATCH 1/2] OMAP4: PMIC: Rename twl6030_codec as twl6040_codec

2010-03-12 Thread Olaya, Margarita
Signed-off-by: Margarita Olaya Cabrera 
---
 drivers/mfd/twl-core.c  |4 ++--
 include/linux/i2c/twl.h |6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index 562cd49..720e099 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -109,7 +109,7 @@
 #endif
 
 #if defined(CONFIG_TWL4030_CODEC) || defined(CONFIG_TWL4030_CODEC_MODULE) ||\
-   defined(CONFIG_SND_SOC_TWL6030) || 
defined(CONFIG_SND_SOC_TWL6030_MODULE)
+   defined(CONFIG_SND_SOC_TWL6040) || 
defined(CONFIG_SND_SOC_TWL6040_MODULE)
 #define twl_has_codec()true
 #else
 #define twl_has_codec()false
@@ -708,7 +708,7 @@ add_children(struct twl4030_platform_data *pdata, unsigned 
long features)
/* Phoenix*/
if (twl_has_codec() && pdata->codec && twl_class_is_6030()) {
sub_chip_id = twl_map[TWL_MODULE_AUDIO_VOICE].sid;
-   child = add_child(sub_chip_id, "twl6030_codec",
+   child = add_child(sub_chip_id, "twl6040_codec",
pdata->codec, sizeof(*pdata->codec),
false, 0, 0);
if (IS_ERR(child))
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index fb6784e..ebd90ce 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -569,9 +569,9 @@ struct twl4030_codec_data {
struct twl4030_codec_audio_data *audio;
struct twl4030_codec_vibra_data *vibra;
 
-   /* twl6030 */
-   int audpwron_gpio;  /* audio power-on gpio */
-   int naudint_irq;/* audio interrupt */
+   /* twl6040 */
+   int audpwron_gpio;  /* audio power-on gpio */
+   int naudint_irq;/* audio interrupt */
 };
 
 struct twl4030_platform_data {
-- 
1.6.1.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


[PATCHv5 0/2] TWL6040 audio codec initial support

2010-03-12 Thread Olaya, Margarita
Following patch series add initial support for TWL6040 codec driver.
The patch set is based on the series sent from Misael Lopez in October 2009.

Changes from v4:
- Rename twl6030_codec as twl6040_codec
- Rebase the 6 codec patches into a single patch
- Rename twl6040_read as twl6040_read_reg_volatile
- Use msleep instead of large mdelays
- Add more trigger sources
- Restructure set_bias_level function to avoid transitions like PREPARE->ON

Regards,
Margarita
---

Misael Lopez Cruz (1):
  ASoC: TWL6040: Add twl6040 codec driver

Margarita Olaya Cabrera (1):
  OMAP4: PMIC: Rename twl6030_codec as twl6040_codec

 drivers/mfd/twl-core.c |4 +-
 include/linux/i2c/twl.h|6 +-
 sound/soc/codecs/Kconfig   |4 +
 sound/soc/codecs/Makefile  |2 +
 sound/soc/codecs/twl6040.c | 1223 
 sound/soc/codecs/twl6040.h |  141 +
 6 files changed, 1375 insertions(+), 5 deletions(-)
 create mode 100644 sound/soc/codecs/twl6040.c
 create mode 100644 sound/soc/codecs/twl6040.h--
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] [PATCHv4 7/7] ASoC: TWL6030: Detect power-up sequence completion

2010-03-01 Thread Olaya, Margarita
On Monday, March 01, 2010 6:14 AM  Mark Brown wrote: 

> On Fri, Feb 26, 2010 at 06:22:34PM -0600, Olaya, Margarita wrote:
> 
>> Do you mean something like this?
>> time_left = wait_for_completion_timeout(&priv->ready,
>> msecs_to_jiffies(48));
>>  if(!time_left) { twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE,
>> &intid, TWL6040_REG_INTID);
>>   if (!(intid & TWL6040_READYINT))
>>  goto error;
>> }
>> 
>>  return 0;
>> 
>> error:
>>  dev_err(codec->dev, "timeout waiting for READYINT\n");
>>  return -ETIMEDOUT;
> 
> Yes, or wrapped in a for loop with shorter timeouts on the
> individual waits. 
> 
>> but in this case will it not take unnecessarily 48ms when the
>> interruption line is not valid?
> 
> You're always going to get some additional delay when polling
> unless you
> busy wait for completion, which obviously has its own problems.

Ok, thanks for the comment I'll re-write the loop for next version of
patches--
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] [PATCHv4 7/7] ASoC: TWL6030: Detect power-up sequence completion

2010-02-26 Thread Olaya, Margarita
On Friday, February 26, 2010 3:27 PM  Mark Brown wrote: 

> On Fri, Feb 26, 2010 at 03:04:22PM -0600, Olaya, Margarita wrote:
> 
>> In both cases if READYINIT is not set before the timeout runs out
>> it means the codec is not powering on and the driver reports an
>> error. 
> 
> That's kind of my point - because you're checking for the same
> status there shouldn't be any need to special case the situation
> where there's
> no interrupt, I'd expect to be able to use
> wait_for_timeout_interruptible()
> for the delay and have the timeout completion interrupt cause
> that to be
> signalled.  No *terribly* important but it makes it clearer
> what's going
> on.

Do you mean something like this?
time_left = wait_for_completion_timeout(&priv->ready,
msecs_to_jiffies(48));
if(!time_left) {
twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &intid,
TWL6040_REG_INTID);
  if (!(intid & TWL6040_READYINT))
goto error;
}

return 0;

error:
dev_err(codec->dev, "timeout waiting for READYINT\n");
return -ETIMEDOUT;

but in this case will it not take unnecessarily 48ms when the
interruption line is not valid?

Regards,
Margarita

--
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: [PATCHv4 7/7] ASoC: TWL6030: Detect power-up sequence completion

2010-02-26 Thread Olaya, Margarita
On Thursday, February 25, 2010 2:42 AM  Mark Brown wrote: 

>>> On Tue, Feb 23, 2010 at 06:10:54PM -0600, Olaya, Margarita wrote:
>>> 
>>>> +if (naudint) {
>>>> +/* wait for ready interrupt with 48 ms timeout */
>>>> +time_left = wait_for_completion_timeout(&priv->ready,
>>>> +msecs_to_jiffies(48));

Phoenix manages automatic and manual power on sequences. READYINT
indicates the completion of power up sequence, Phoenix audio drives
the NAUDINT line low when an interrupt is internally detected, when
automatic power on sequence is used, the state of READYINIT is verified
through the interrupt handler using wait_for_completion.

>>>> +} else {
>>>> +/* retry 3 times only */
>>>> +for (time_left = 3; time_left > 0; time_left--) { +
>>>> mdelay(16); +   
>>>> twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &intid, +   
>>>> TWL6030_REG_INTID); +if (intid & TWL6030_READYINT)
>>>> +break;
>>>> +}

When manual power on sequence is used the driver verifies the status of 
READYINIT by polling.

In both cases if READYINIT is not set before the timeout runs out it means
the codec is not powering on and the driver reports an error.

- Margarita

>>>> +}
>>> 



>>> It strikes me that you could combine these two cases - the
>>> wait_for_completion_timeout() will function just as well as a
>>> delay. I'd also expect to see an error reported if the device
>>> doesn't report as ready one way or another.
>> 
>> It is split to prevent the case of none valid irq line connected,
>> in such case, wait_for_completion won't work
> 
> It will - you can specify a timeout so if the interrupt doesn't
> happen all that happens is that you delay for the specified timeout.

--
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: [PATCHv4 2/7] ASoC: TWL6030: Add twl6030 codec driver

2010-02-26 Thread Olaya, Margarita
On Thursday, February 25, 2010 4:17 AM  Mark Brown wrote: 

>>> Are these two functions writing the default codec register values
>>> to the CODEC or are these non default (i.e. reset) values. If
>>> they are reset values is it not better to just issue the reset
>>> (and save the slow I2C writes) ?
> 
>> Yeap, but they write non default values to most of the registers.
> 
> Why are these non-default values being set?  The general style with
> things like this is that the register defaults listed in the
> driver are
> the physical defaults, and any explicit configuration is done with
> register writes.  This makes it clearer what's being changed and
> means that the actual register defaults are there for use if
> required. 
> 
> Normally only things that should be changed for all systems would be
> configured in this manner, things like audio paths which might
> change per system would be left for userspace to configure.
> 

I meant to say default values, sorry for the confusion

In TWL6040 codec, the registers belong to a power supply domain: VDD or VIO.
When the codec hits suspend state, VIO is not longer supplied, so registers
lose their values. However, VDD registers preserve their values as they belong
to a different power domain which still exist in suspend state. So when codec
resumes, it's only needed to restore VIO registers' values lost during suspend.
That's the reason why we have two separate functions to set VDD and VIO 
registers.
The former is only needed at probe time and the latter is needed every time 
codec
resumes.

At probe we are using the default values to keep the codec functional as many
features have not been enabled yet, some specific values are set using write
function.--
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] [PATCHv4 0/7] TWL6030 audio codec initial support

2010-02-25 Thread Olaya, Margarita


> -Original Message-
> From: Liam Girdwood [mailto:l...@slimlogic.co.uk]
> Sent: Thursday, February 25, 2010 3:13 AM
> To: Olaya, Margarita
> Cc: alsa-de...@alsa-project.org; linux-omap@vger.kernel.org; 
> broo...@opensource.wolfsonmicro.com
> Subject: Re: [alsa-devel] [PATCHv4 0/7] TWL6030 audio codec initial support
> 
> On Wed, 2010-02-24 at 18:17 -0600, Olaya, Margarita wrote:
> >
> > > -Original Message-
> > > From: Liam Girdwood [mailto:l...@slimlogic.co.uk]
> > > Sent: Wednesday, February 24, 2010 5:40 AM
> > > To: Olaya, Margarita
> > > Cc: alsa-de...@alsa-project.org; linux-omap@vger.kernel.org; 
> > > broo...@opensource.wolfsonmicro.com
> > > Subject: Re: [PATCHv4 0/7] TWL6030 audio codec initial support
> > >
> > > On Tue, 2010-02-23 at 18:10 -0600, Olaya, Margarita wrote:
> > > > Following patch series add initial support for TWL6030 codec driver.
> > > > The patch set is based on the series sent from Misael Lopez in October 
> > > > 2009.
> > > >
> > > > Changes from v3:
> > > > - Remove snd_soc_init_card function
> > > > - Adapt to latest twl core changes based on Balaji's comment
> > > >
> > > > Regards,
> > > > Margarita
> > > >
> > > > ---
> > > > Misael Lopez Cruz (7):
> > > >   OMAP4: PMIC: Add support for twl6030 codec
> > > >   ASoC: TWL6030: Add twl6030 codec driver
> > > >   ASoC: TWL6030: Manual power-up/down sequences
> > > >   ASoC: TWL6030: Add support for low-power PLL
> > > >   ASoC: TWL6030: Add restrictions for low-power playback mode
> > > >   ASoC: TWL6030: Enable audio interrupt
> > > >   ASoC: TWL6030: Detect power-up sequence completion
> > >
> > > Btw, since this is a new driver can you rebase the 6 codec patches into
> > > a single patch.
> > >
> >
> > The second patch adds the basic support for the codec and the others add 
> > features, that way it
> could be easier to review.
> 
> Some of the subsequent patches are actually removing chunks of code
> rather than just adding new features. In this case it's actually easier
> to review the complete codec driver as one patch rather than a series of
> changes (showing your internal development history).
> 
Ok, I'll send a single patch then.

Regards,
Margarita

> Thanks
> 
> Liam
> 
> --
> Freelance Developer, SlimLogic Ltd
> ASoC and Voltage Regulator Maintainer.
> http://www.slimlogic.co.uk

N�r��yb�X��ǧv�^�)޺{.n�+{��f��{ay�ʇڙ�,j��f���h���z��w���
���j:+v���w�j�mzZ+�ݢj"��!�i

RE: [PATCHv4 7/7] ASoC: TWL6030: Detect power-up sequence completion

2010-02-24 Thread Olaya, Margarita


> -Original Message-
> From: Mark Brown [mailto:broo...@opensource.wolfsonmicro.com]
> Sent: Wednesday, February 24, 2010 7:59 AM
> To: Olaya, Margarita
> Cc: alsa-de...@alsa-project.org; linux-omap@vger.kernel.org; 
> l...@slimlogic.co.uk
> Subject: Re: [PATCHv4 7/7] ASoC: TWL6030: Detect power-up sequence completion
> 
> On Tue, Feb 23, 2010 at 06:10:54PM -0600, Olaya, Margarita wrote:
> 
> > +   if (naudint) {
> > +   /* wait for ready interrupt with 48 ms timeout */
> > +   time_left = wait_for_completion_timeout(&priv->ready,
> > +   msecs_to_jiffies(48));
> > +   } else {
> > +   /* retry 3 times only */
> > +   for (time_left = 3; time_left > 0; time_left--) {
> > +   mdelay(16);
> > +   twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &intid,
> > +   TWL6030_REG_INTID);
> > +   if (intid & TWL6030_READYINT)
> > +   break;
> > +   }
> > +   }
> 
> It strikes me that you could combine these two cases - the
> wait_for_completion_timeout() will function just as well as a delay.
> I'd also expect to see an error reported if the device doesn't report as
> ready one way or another.

It is split to prevent the case of none valid irq line connected, in such case, 
wait_for_completion won't work.

Regards,
Margarita 
--
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: [PATCHv4 0/7] TWL6030 audio codec initial support

2010-02-24 Thread Olaya, Margarita


> -Original Message-
> From: Liam Girdwood [mailto:l...@slimlogic.co.uk]
> Sent: Wednesday, February 24, 2010 5:40 AM
> To: Olaya, Margarita
> Cc: alsa-de...@alsa-project.org; linux-omap@vger.kernel.org; 
> broo...@opensource.wolfsonmicro.com
> Subject: Re: [PATCHv4 0/7] TWL6030 audio codec initial support
> 
> On Tue, 2010-02-23 at 18:10 -0600, Olaya, Margarita wrote:
> > Following patch series add initial support for TWL6030 codec driver.
> > The patch set is based on the series sent from Misael Lopez in October 2009.
> >
> > Changes from v3:
> > - Remove snd_soc_init_card function
> > - Adapt to latest twl core changes based on Balaji's comment
> >
> > Regards,
> > Margarita
> >
> > ---
> > Misael Lopez Cruz (7):
> >   OMAP4: PMIC: Add support for twl6030 codec
> >   ASoC: TWL6030: Add twl6030 codec driver
> >   ASoC: TWL6030: Manual power-up/down sequences
> >   ASoC: TWL6030: Add support for low-power PLL
> >   ASoC: TWL6030: Add restrictions for low-power playback mode
> >   ASoC: TWL6030: Enable audio interrupt
> >   ASoC: TWL6030: Detect power-up sequence completion
> 
> Btw, since this is a new driver can you rebase the 6 codec patches into
> a single patch.
> 

The second patch adds the basic support for the codec and the others add 
features, that way it could be easier to review.

Regards,
Margarita
 
> Thanks
> 
> Liam
> 
> --
> Freelance Developer, SlimLogic Ltd
> ASoC and Voltage Regulator Maintainer.
> http://www.slimlogic.co.uk



RE: [alsa-devel] [PATCHv4 2/7] ASoC: TWL6030: Add twl6030 codec driver

2010-02-24 Thread Olaya, Margarita

> -Original Message-
> From: Mark Brown [mailto:broo...@opensource.wolfsonmicro.com]
> Sent: Wednesday, February 24, 2010 4:43 AM
> To: Liam Girdwood
> Cc: Olaya, Margarita; alsa-de...@alsa-project.org; linux-omap@vger.kernel.org
> Subject: Re: [alsa-devel] [PATCHv4 2/7] ASoC: TWL6030: Add twl6030 codec 
> driver
> 
> On Wed, Feb 24, 2010 at 10:38:01AM +, Liam Girdwood wrote:
> > On Tue, 2010-02-23 at 18:10 -0600, Olaya, Margarita wrote:
> 
> > > +   twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &value, reg);
> > > +   twl6030_write_reg_cache(codec, reg, value);
> 
> > You probably want to read from the cache if the register is not
> > volatile. This saves a slow I2C read.
> 
> ...and if you don't satisfy reads from the cache you may as well not
> bother with it - it's just consuming memory.

We have different functions for those cases.

> 
> > > +   /* skip read-only registers (ASICID, ASICREV, STATUS) */
> > > +   if ((reg == TWL6030_REG_ASICID) ||
> > > +   (reg == TWL6030_REG_ASICREV) ||
> > > +   (reg == TWL6030_REG_STATUS))
> > > +   continue;
> > > +   twl6030_write(codec, reg, cache[reg]);
> 
> A switch statement would be nicer here.

You mean something like this?

switch (reg) {
case TWL6030_REG_ASICID:
case TWL6030_REG_ASICREV:
case TWL6030_REG_STATUS:
continue;
default:
break:
}

Regards,
Margarita
--
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: [PATCHv4 3/7] ASoC: TWL6030: Manual power-up/down sequences

2010-02-24 Thread Olaya, Margarita


> -Original Message-
> From: Liam Girdwood [mailto:l...@slimlogic.co.uk]
> Sent: Wednesday, February 24, 2010 4:41 AM
> To: Olaya, Margarita
> Cc: alsa-de...@alsa-project.org; linux-omap@vger.kernel.org; 
> broo...@opensource.wolfsonmicro.com
> Subject: Re: [PATCHv4 3/7] ASoC: TWL6030: Manual power-up/down sequences
> 
> On Tue, 2010-02-23 at 18:10 -0600, Olaya, Margarita wrote:
> > From: Misael Lopez Cruz 
> >
> > TWL6030 codec device can be powered-up/down through a specific register
> > writes sequence. These sequences can be used when no gpio line is
> > provided for AUDPWRON.
> >
> > When the codec is powered-up in this way, automatic power-down sequence
> > (triggered by thermal shutdown) is not possible.
> >
> > Signed-off-by: Misael Lopez Cruz 
> > Signed-off-by: Jorge Eduardo Candelaria 
> > Signed-off-by: Margarita Olaya Cabrera 
> > ---
> >  sound/soc/codecs/twl6030.c |  112 
> > ++-
> >  sound/soc/codecs/twl6030.h |   16 ++
> >  2 files changed, 115 insertions(+), 13 deletions(-)
> >
> > diff --git a/sound/soc/codecs/twl6030.c b/sound/soc/codecs/twl6030.c
> > index 8b52aa1..ec838b1 100644
> > --- a/sound/soc/codecs/twl6030.c
> > +++ b/sound/soc/codecs/twl6030.c
> > @@ -244,6 +244,88 @@ static void twl6030_init_vdd_regs(struct snd_soc_codec 
> > *codec)
> > }
> >  }
> >
> > +/* twl6030 codec manual power-up sequence */
> > +static void twl6030_power_up(struct snd_soc_codec *codec)
> > +{
> > +   u8 ncpctl, ldoctl, lppllctl, accctl;
> > +
> > +   ncpctl = twl6030_read_reg_cache(codec, TWL6030_REG_NCPCTL);
> > +   ldoctl = twl6030_read_reg_cache(codec, TWL6030_REG_LDOCTL);
> > +   lppllctl = twl6030_read_reg_cache(codec, TWL6030_REG_LPPLLCTL);
> > +   accctl = twl6030_read_reg_cache(codec, TWL6030_REG_ACCCTL);
> > +
> > +   /* enable reference system */
> > +   ldoctl |= TWL6030_REFENA;
> > +   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
> > +   mdelay(10);
> > +   /* enable internal oscillator */
> > +   ldoctl |= TWL6030_OSCENA;
> > +   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
> > +   udelay(10);
> > +   /* enable high-side ldo */
> > +   ldoctl |= TWL6030_HSLDOENA;
> > +   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
> > +   udelay(244);
> > +   /* enable negative charge pump */
> > +   ncpctl |= TWL6030_NCPENA | TWL6030_NCPOPEN;
> > +   twl6030_write(codec, TWL6030_REG_NCPCTL, ncpctl);
> > +   udelay(488);
> > +   /* enable low-side ldo */
> > +   ldoctl |= TWL6030_LSLDOENA;
> > +   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
> > +   udelay(244);
> > +   /* enable low-power pll */
> > +   lppllctl |= TWL6030_LPLLENA;
> > +   twl6030_write(codec, TWL6030_REG_LPPLLCTL, lppllctl);
> > +   /* reset state machine */
> > +   accctl |= TWL6030_RESETSPLIT;
> > +   twl6030_write(codec, TWL6030_REG_ACCCTL, accctl);
> > +   mdelay(5);
> > +   accctl &= ~TWL6030_RESETSPLIT;
> > +   twl6030_write(codec, TWL6030_REG_ACCCTL, accctl);
> > +   /* disable internal oscillator */
> > +   ldoctl &= ~TWL6030_OSCENA;
> > +   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
> > +}
> > +
> > +/* twl6030 codec manual power-down sequence */
> > +static void twl6030_power_down(struct snd_soc_codec *codec)
> > +{
> > +   u8 ncpctl, ldoctl, lppllctl, accctl;
> > +
> > +   ncpctl = twl6030_read_reg_cache(codec, TWL6030_REG_NCPCTL);
> > +   ldoctl = twl6030_read_reg_cache(codec, TWL6030_REG_LDOCTL);
> > +   lppllctl = twl6030_read_reg_cache(codec, TWL6030_REG_LPPLLCTL);
> > +   accctl = twl6030_read_reg_cache(codec, TWL6030_REG_ACCCTL);
> > +
> > +   /* enable internal oscillator */
> > +   ldoctl |= TWL6030_OSCENA;
> > +   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
> > +   udelay(10);
> > +   /* disable low-power pll */
> > +   lppllctl &= ~TWL6030_LPLLENA;
> > +   twl6030_write(codec, TWL6030_REG_LPPLLCTL, lppllctl);
> > +   /* disable low-side ldo */
> > +   ldoctl &= ~TWL6030_LSLDOENA;
> > +   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
> > +   udelay(244);
> > +   /* disable negative charge pump */
> > +   ncpctl &= ~(TWL6030_NCPENA | TWL6030_NCPOPEN);
> > +   twl6030_write(codec, TWL6030_REG_NCPCTL, ncpctl);
> > +   udelay(488);
> > +   /* disable high-side ldo */
> > +   ldoctl &= ~TWL6030_HSLDOENA;
> > +   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
> > +   udelay(244);
> > +   /* disable internal oscillator */
> > +   ldoctl &= ~TWL6030_OSCENA;
> > +   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
> > +   /* disable reference system */
> > +   ldoctl &= ~TWL6030_REFENA;
> > +   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
> > +   mdelay(10);
> > +}
> > +
> >  /*
> 
> 
> Some large mdelays here again.
> 
> Liam

Ok, I'll verify and change them.

- Margarita
> 
> --
> Freelance Developer, SlimLogic Ltd
> ASoC and Voltage Regulator Maintainer.
> http://www.slimlogic.co.uk



RE: [PATCHv4 2/7] ASoC: TWL6030: Add twl6030 codec driver

2010-02-24 Thread Olaya, Margarita


> -Original Message-
> From: Liam Girdwood [mailto:l...@slimlogic.co.uk]
> Sent: Wednesday, February 24, 2010 4:38 AM
> To: Olaya, Margarita
> Cc: alsa-de...@alsa-project.org; linux-omap@vger.kernel.org; 
> broo...@opensource.wolfsonmicro.com
> Subject: Re: [PATCHv4 2/7] ASoC: TWL6030: Add twl6030 codec driver
>
> On Tue, 2010-02-23 at 18:10 -0600, Olaya, Margarita wrote:
> > From: Misael Lopez Cruz 
> >
> > Initial version of TWL6030 codec driver.
> >
> > The TWL6030 codec uses a propietary PDM-based digital audio interface.
> > Audio paths supported are:
> >
> > - Input: Main Mic, Sub Mic, Headset Mic, Auxiliary-FM Left/Right
> > - Output: Headset Left/Right, Handsfree Left/Right
> >
> > Signed-off-by: Misael Lopez Cruz 
> > Signed-off-by: Jorge Eduardo Candelaria 
> > Signed-off-by: Margarita Olaya Cabrera 
> > ---
> >  sound/soc/codecs/Kconfig   |4 +
> >  sound/soc/codecs/Makefile  |2 +
> >  sound/soc/codecs/twl6030.c |  823 
> > 
> >  sound/soc/codecs/twl6030.h |   94 +
> >  4 files changed, 923 insertions(+), 0 deletions(-)
> >  create mode 100644 sound/soc/codecs/twl6030.c
> >  create mode 100644 sound/soc/codecs/twl6030.h
> >
> > diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
> > index 52b005f..3b3d739 100644
> > --- a/sound/soc/codecs/Kconfig
> > +++ b/sound/soc/codecs/Kconfig
> > @@ -33,6 +33,7 @@ config SND_SOC_ALL_CODECS
> > select SND_SOC_TPA6130A2 if I2C
> > select SND_SOC_TLV320DAC33 if I2C
> > select SND_SOC_TWL4030 if TWL4030_CORE
> > +   select SND_SOC_TWL6030 if TWL4030_CORE
> > select SND_SOC_UDA134X
> > select SND_SOC_UDA1380 if I2C
> > select SND_SOC_WM8350 if MFD_WM8350
> > @@ -155,6 +156,9 @@ config SND_SOC_TWL4030
> > select TWL4030_CODEC
> > tristate
> >
> > +config SND_SOC_TWL6030
> > +   tristate
> > +
> >  config SND_SOC_UDA134X
> > tristate
> >
> > diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
> > index dbaecb1..e11a193 100644
> > --- a/sound/soc/codecs/Makefile
> > +++ b/sound/soc/codecs/Makefile
> > @@ -20,6 +20,7 @@ snd-soc-tlv320aic26-objs := tlv320aic26.o
> >  snd-soc-tlv320aic3x-objs := tlv320aic3x.o
> >  snd-soc-tlv320dac33-objs := tlv320dac33.o
> >  snd-soc-twl4030-objs := twl4030.o
> > +snd-soc-twl6030-objs := twl6030.o
> >  snd-soc-uda134x-objs := uda134x.o
> >  snd-soc-uda1380-objs := uda1380.o
> >  snd-soc-wm8350-objs := wm8350.o
> > @@ -76,6 +77,7 @@ obj-$(CONFIG_SND_SOC_TLV320AIC26) += 
> > snd-soc-tlv320aic26.o
> >  obj-$(CONFIG_SND_SOC_TLV320AIC3X)  += snd-soc-tlv320aic3x.o
> >  obj-$(CONFIG_SND_SOC_TLV320DAC33)  += snd-soc-tlv320dac33.o
> >  obj-$(CONFIG_SND_SOC_TWL4030)  += snd-soc-twl4030.o
> > +obj-$(CONFIG_SND_SOC_TWL6030)  += snd-soc-twl6030.o
> >  obj-$(CONFIG_SND_SOC_UDA134X)  += snd-soc-uda134x.o
> >  obj-$(CONFIG_SND_SOC_UDA1380)  += snd-soc-uda1380.o
> >  obj-$(CONFIG_SND_SOC_WM8350)   += snd-soc-wm8350.o
> > diff --git a/sound/soc/codecs/twl6030.c b/sound/soc/codecs/twl6030.c
> > new file mode 100644
> > index 000..8b52aa1
> > --- /dev/null
> > +++ b/sound/soc/codecs/twl6030.c
> > @@ -0,0 +1,823 @@
> > +/*
> > + * ALSA SoC TWL6030 codec driver
> > + *
> > + * Author:  Misael Lopez Cruz 
> > + *
> > + * This program is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public License
> > + * version 2 as published by the Free Software Foundation.
> > + *
> > + * This program is distributed in the hope that it will be useful, but
> > + * WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> > + * General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU General Public License
> > + * along with this program; if not, write to the Free Software
> > + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
> > + * 02110-1301 USA
> > + *
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > 

RE: [PATCHv4 1/7] OMAP4: PMIC: Add support for twl6030 codec

2010-02-24 Thread Olaya, Margarita
Mark,

I'll re-submit the patch series using twl6040_codec instead of twl6030_codec, 
twl6030 is the power companion chip and twl4030 is the audio chip, so in the 
case of this patch should I send an incremental patch to rename it?

Regards,
Margarita

> -Original Message-
> From: Mark Brown [mailto:broo...@opensource.wolfsonmicro.com]
> Sent: Wednesday, February 24, 2010 7:23 AM
> To: Samuel Ortiz
> Cc: Liam Girdwood; Olaya, Margarita; alsa-de...@alsa-project.org; 
> linux-omap@vger.kernel.org
> Subject: Re: [PATCHv4 1/7] OMAP4: PMIC: Add support for twl6030 codec
> 
> On Wed, Feb 24, 2010 at 12:13:29PM +0100, Samuel Ortiz wrote:
> 
> > > Samuel are you OK with this ?
> 
> > That seems fine, yes.
> > Acked-by: Samuel Ortiz 
> 
> OK, I've applied this one now - the cross tree issues mean it seems
> better to get into 2.6.34.  I'll review the rest of the patches now.
--
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


[PATCHv4 7/7] ASoC: TWL6030: Detect power-up sequence completion

2010-02-23 Thread Olaya, Margarita
From: Misael Lopez Cruz 

When the codec is powered-up through external AUDPWRON line it starts
its power-up sequence. The completion of the sequence is signaled
through the audio interrupt, and then codec is operational.

If NAUDINT irq is provided, CODEC driver starts a wait_for_completion
just after AUDPWRON line transitions from low to high. It's signaled as
complete when servicing READYINT interrupt.

If AUDPWRON gpio line is provided but NAUDINT irq is not, then CODEC
driver enables READYINT and polls on INTID register. If none of them are
provided, then CODEC uses manual power sequences and disables all audio
interrupts.

Signed-off-by: Misael Lopez Cruz 
Signed-off-by: Jorge Eduardo Candelaria 
Signed-off-by: Margarita Olaya Cabrera 
---
 sound/soc/codecs/twl6030.c |   61 +--
 sound/soc/codecs/twl6030.h |1 +
 2 files changed, 53 insertions(+), 9 deletions(-)

diff --git a/sound/soc/codecs/twl6030.c b/sound/soc/codecs/twl6030.c
index b8dd5ae..2847f1b 100644
--- a/sound/soc/codecs/twl6030.c
+++ b/sound/soc/codecs/twl6030.c
@@ -52,6 +52,7 @@ struct twl6030_data {
int non_lp;
unsigned int sysclk;
struct snd_pcm_hw_constraint_list *sysclk_constraints;
+   struct completion ready;
 };
 
 /*
@@ -372,6 +373,7 @@ static int twl6030_power_mode_event(struct 
snd_soc_dapm_widget *w,
 static irqreturn_t twl6030_naudint_handler(int irq, void *data)
 {
struct snd_soc_codec *codec = data;
+   struct twl6030_data *priv = codec->private_data;
u8 intid;
 
twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &intid, TWL6030_REG_INTID);
@@ -391,7 +393,7 @@ static irqreturn_t twl6030_naudint_handler(int irq, void 
*data)
dev_alert(codec->dev, "vib drivers over current detection\n");
break;
case TWL6030_READYINT:
-   dev_alert(codec->dev, "codec is ready\n");
+   complete(&priv->ready);
break;
default:
dev_err(codec->dev, "unknown audio interrupt %d\n", intid);
@@ -626,11 +628,45 @@ static int twl6030_add_widgets(struct snd_soc_codec 
*codec)
return 0;
 }
 
+static int twl6030_power_up_completion(struct snd_soc_codec *codec,
+   int naudint)
+{
+   struct twl6030_data *priv = codec->private_data;
+   int time_left;
+   u8 intid;
+
+   if (naudint) {
+   /* wait for ready interrupt with 48 ms timeout */
+   time_left = wait_for_completion_timeout(&priv->ready,
+   msecs_to_jiffies(48));
+   } else {
+   /* retry 3 times only */
+   for (time_left = 3; time_left > 0; time_left--) {
+   mdelay(16);
+   twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &intid,
+   TWL6030_REG_INTID);
+   if (intid & TWL6030_READYINT)
+   break;
+   }
+   }
+
+   if (!time_left) {
+   dev_err(codec->dev, "timeout waiting for READYINT\n");
+   return -ETIMEDOUT;
+   }
+
+   priv->codec_powered = 1;
+
+   return 0;
+}
+
 static int twl6030_set_bias_level(struct snd_soc_codec *codec,
enum snd_soc_bias_level level)
 {
struct twl6030_data *priv = codec->private_data;
int audpwron = priv->audpwron;
+   int naudint = priv->naudint;
+   int ret;
 
switch (level) {
case SND_SOC_BIAS_ON:
@@ -643,8 +679,10 @@ static int twl6030_set_bias_level(struct snd_soc_codec 
*codec,
/* use AUDPWRON line */
gpio_set_value(audpwron, 1);
 
-   /* power-up sequence latency */
-   mdelay(16);
+   /* wait for power-up completion */
+   ret = twl6030_power_up_completion(codec, naudint);
+   if (ret)
+   return ret;
 
/* sync registers updated during power-up sequence */
twl6030_read(codec, TWL6030_REG_NCPCTL);
@@ -653,12 +691,11 @@ static int twl6030_set_bias_level(struct snd_soc_codec 
*codec,
} else {
/* use manual power-up sequence */
twl6030_power_up(codec);
+   priv->codec_powered = 1;
}
 
/* initialize vdd/vss registers with reg_cache */
twl6030_init_vdd_regs(codec);
-
-   priv->codec_powered = 1;
break;
case SND_SOC_BIAS_OFF:
if (!priv->codec_powered)
@@ -1067,6 +1104,7 @@ static int __devinit twl6030_codec_probe(struct 
platform_device *pdev)
mutex_init(&codec->mutex);
INIT_LIST_HEAD(&codec->dapm_widgets);
INIT_LIST_HEAD(&codec->dapm_paths);
+   init_complet

[PATCHv4 6/7] ASoC: TWL6030: Enable audio interrupt

2010-02-23 Thread Olaya, Margarita
From: Misael Lopez Cruz 

NAUDINT interrupt line is provided by the TWL6030 codec to signal
externally events like headset plug/unplug, hook, power-up sequence
completion, etc.

Signed-off-by: Misael Lopez Cruz 
Signed-off-by: Jorge Eduardo Candelaria 
Signed-off-by: Margarita Olaya Cabrera 
---
 sound/soc/codecs/twl6030.c |   70 ---
 sound/soc/codecs/twl6030.h |   14 +
 2 files changed, 79 insertions(+), 5 deletions(-)

diff --git a/sound/soc/codecs/twl6030.c b/sound/soc/codecs/twl6030.c
index 53aa837..b8dd5ae 100644
--- a/sound/soc/codecs/twl6030.c
+++ b/sound/soc/codecs/twl6030.c
@@ -46,6 +46,7 @@
 struct twl6030_data {
struct snd_soc_codec codec;
int audpwron;
+   int naudint;
int codec_powered;
int pll;
int non_lp;
@@ -61,7 +62,7 @@ static const u8 twl6030_reg[TWL6030_CACHEREGNUM] = {
0x4B, /* TWL6030_ASICID (ro)0x01*/
0x00, /* TWL6030_ASICREV (ro)   0x02*/
0x00, /* TWL6030_INTID  0x03*/
-   0x7B, /* TWL6030_INTMR  0x04*/
+   0x00, /* TWL6030_INTMR  0x04*/
0x00, /* TWL6030_NCPCTRL0x05*/
0x00, /* TWL6030_LDOCTL 0x06*/
0x00, /* TWL6030_HPPLLCTL   0x07*/
@@ -367,6 +368,39 @@ static int twl6030_power_mode_event(struct 
snd_soc_dapm_widget *w,
return 0;
 }
 
+/* audio interrupt handler */
+static irqreturn_t twl6030_naudint_handler(int irq, void *data)
+{
+   struct snd_soc_codec *codec = data;
+   u8 intid;
+
+   twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &intid, TWL6030_REG_INTID);
+
+   switch (intid) {
+   case TWL6030_THINT:
+   dev_alert(codec->dev, "die temp over-limit detection\n");
+   break;
+   case TWL6030_PLUGINT:
+   case TWL6030_UNPLUGINT:
+   case TWL6030_HOOKINT:
+   break;
+   case TWL6030_HFINT:
+   dev_alert(codec->dev, "hf drivers over current detection\n");
+   break;
+   case TWL6030_VIBINT:
+   dev_alert(codec->dev, "vib drivers over current detection\n");
+   break;
+   case TWL6030_READYINT:
+   dev_alert(codec->dev, "codec is ready\n");
+   break;
+   default:
+   dev_err(codec->dev, "unknown audio interrupt %d\n", intid);
+   break;
+   }
+
+   return IRQ_HANDLED;
+}
+
 /*
  * MICATT volume control:
  * from -6 to 0 dB in 6 dB steps
@@ -992,19 +1026,23 @@ static int __devinit twl6030_codec_probe(struct 
platform_device *pdev)
struct twl4030_codec_data *twl_codec = pdev->dev.platform_data;
struct snd_soc_codec *codec;
struct twl6030_data *priv;
-   int audpwron;
+   int audpwron, naudint;
int ret = 0;
 
priv = kzalloc(sizeof(struct twl6030_data), GFP_KERNEL);
if (priv == NULL)
return -ENOMEM;
 
-   if (twl_codec)
+   if (twl_codec) {
audpwron = twl_codec->audpwron_gpio;
-   else
+   naudint = twl_codec->naudint_irq;
+   } else {
audpwron = -EINVAL;
+   naudint = 0;
+   }
 
priv->audpwron = audpwron;
+   priv->naudint = naudint;
 
codec = &priv->codec;
codec->dev = &pdev->dev;
@@ -1042,13 +1080,28 @@ static int __devinit twl6030_codec_probe(struct 
platform_device *pdev)
priv->codec_powered = 0;
}
 
+   if (naudint) {
+   /* audio interrupt */
+   ret = request_threaded_irq(naudint, NULL,
+   twl6030_naudint_handler,
+   IRQF_TRIGGER_LOW | IRQF_ONESHOT,
+   "twl6030_codec", codec);
+   if (ret)
+   goto gpio2_err;
+   } else {
+   dev_warn(codec->dev,
+   "no naudint irq, audio interrupts disabled\n");
+   twl6030_write_reg_cache(codec, TWL6030_REG_INTMR,
+   TWL6030_ALLINT_MSK);
+   }
+
/* init vio registers */
twl6030_init_vio_regs(codec);
 
/* power on device */
ret = twl6030_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
if (ret)
-   goto gpio2_err;
+   goto irq_err;
 
ret = snd_soc_register_codec(codec);
if (ret)
@@ -1067,6 +1120,9 @@ dai_err:
twl6030_codec = NULL;
 reg_err:
twl6030_set_bias_level(codec, SND_SOC_BIAS_OFF);
+irq_err:
+   if (naudint)
+   free_irq(naudint, codec);
 gpio2_err:
if (gpio_is_valid(audpwron))
gpio_free(audpwron);
@@ -1081,10 +1137,14 @@ static int __devexit twl6030_codec_remove(struct 
platform_device *pdev)
 {
struct twl6030_data *priv = twl6030_codec->private_data;
int audpwron = priv->audpwron;
+   int naudint = priv->naudint;
 
if (gpio_is_valid(

[PATCHv4 5/7] ASoC: TWL6030: Add restrictions for low-power playback mode

2010-02-23 Thread Olaya, Margarita
From: Misael Lopez Cruz 

Low-power playback mode is a special scenario where only headset path
(headset DAC and driver) is active. Only in this mode the codec can
support 44.1 and 48 kHz, low-power PLL should provide sysclk signal.

Currently, handsfree DAC and driver are the only components that can
prevent codec to enter to low-power playback mode. Other components
like earphone driver, vibrator driver or loopback (which are not yet
supported in the driver) can cause the same effect.

In order to detect conflicting paths, CODEC driver supervises
non-low-power widgets powered by DAPM mechanism, just at the point
pcm trigger callback gets called.

Signed-off-by: Misael Lopez Cruz 
Signed-off-by: Jorge Eduardo Candelaria 
Signed-off-by: Margarita Olaya Cabrera 
---
 sound/soc/codecs/twl6030.c |   79 +++
 1 files changed, 71 insertions(+), 8 deletions(-)

diff --git a/sound/soc/codecs/twl6030.c b/sound/soc/codecs/twl6030.c
index 792407f..53aa837 100644
--- a/sound/soc/codecs/twl6030.c
+++ b/sound/soc/codecs/twl6030.c
@@ -48,6 +48,7 @@ struct twl6030_data {
int audpwron;
int codec_powered;
int pll;
+   int non_lp;
unsigned int sysclk;
struct snd_pcm_hw_constraint_list *sysclk_constraints;
 };
@@ -352,6 +353,20 @@ static int headset_power_mode(struct snd_soc_codec *codec, 
int high_perf)
return 0;
 }
 
+static int twl6030_power_mode_event(struct snd_soc_dapm_widget *w,
+   struct snd_kcontrol *kcontrol, int event)
+{
+   struct snd_soc_codec *codec = w->codec;
+   struct twl6030_data *priv = codec->private_data;
+
+   if (SND_SOC_DAPM_EVENT_ON(event))
+   priv->non_lp++;
+   else
+   priv->non_lp--;
+
+   return 0;
+}
+
 /*
  * MICATT volume control:
  * from -6 to 0 dB in 6 dB steps
@@ -485,10 +500,14 @@ static const struct snd_soc_dapm_widget 
twl6030_dapm_widgets[] = {
TWL6030_REG_HSLCTL, 0, 0),
SND_SOC_DAPM_DAC("HSDAC Right", "Headset Playback",
TWL6030_REG_HSRCTL, 0, 0),
-   SND_SOC_DAPM_DAC("HFDAC Left", "Handsfree Playback",
-   TWL6030_REG_HFLCTL, 0, 0),
-   SND_SOC_DAPM_DAC("HFDAC Right", "Handsfree Playback",
-   TWL6030_REG_HFRCTL, 0, 0),
+   SND_SOC_DAPM_DAC_E("HFDAC Left", "Handsfree Playback",
+   TWL6030_REG_HFLCTL, 0, 0,
+   twl6030_power_mode_event,
+   SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
+   SND_SOC_DAPM_DAC_E("HFDAC Right", "Handsfree Playback",
+   TWL6030_REG_HFRCTL, 0, 0,
+   twl6030_power_mode_event,
+   SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
 
/* Analog playback switches */
SND_SOC_DAPM_SWITCH("HSDAC Left Playback",
@@ -504,10 +523,14 @@ static const struct snd_soc_dapm_widget 
twl6030_dapm_widgets[] = {
SND_SOC_NOPM, 0, 0, &hsl_driver_switch_controls),
SND_SOC_DAPM_SWITCH("Headset Right Driver",
SND_SOC_NOPM, 0, 0, &hsr_driver_switch_controls),
-   SND_SOC_DAPM_SWITCH("Handsfree Left Driver",
-   SND_SOC_NOPM, 0, 0, &hfl_driver_switch_controls),
-   SND_SOC_DAPM_SWITCH("Handsfree Right Driver",
-   SND_SOC_NOPM, 0, 0, &hfr_driver_switch_controls),
+   SND_SOC_DAPM_SWITCH_E("Handsfree Left Driver",
+   SND_SOC_NOPM, 0, 0, &hfl_driver_switch_controls,
+   twl6030_power_mode_event,
+   SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
+   SND_SOC_DAPM_SWITCH_E("Handsfree Right Driver",
+   SND_SOC_NOPM, 0, 0, &hfr_driver_switch_controls,
+   twl6030_power_mode_event,
+   SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
 
/* Analog playback PGAs */
SND_SOC_DAPM_PGA("HFDAC Left PGA",
@@ -668,6 +691,17 @@ static int twl6030_startup(struct snd_pcm_substream 
*substream,
return -EINVAL;
}
 
+   /*
+* capture is not supported at 17.64 MHz,
+* it's reserved for headset low-power playback scenario
+*/
+   if ((priv->sysclk == 1764) && substream->stream) {
+   dev_err(codec->dev,
+   "capture mode is not supported at %dHz\n",
+   priv->sysclk);
+   return -EINVAL;
+   }
+
snd_pcm_hw_constraint_list(substream->runtime, 0,
SNDRV_PCM_HW_PARAM_RATE,
priv->sysclk_constraints);
@@ -712,6 +746,34 @@ static int twl6030_hw_params(struct snd_pcm_substream 
*substream,
return 0;
 }
 
+static int twl6030_trigger(struct snd_pcm_substream *substream,
+   int cmd, struct snd_soc_dai *dai)
+{
+   struct snd_soc_pcm_runtime *rtd

[PATCHv4 4/7] ASoC: TWL6030: Add support for low-power PLL

2010-02-23 Thread Olaya, Margarita
From: Misael Lopez Cruz 

TWL6030 codec sysclk can be provided by: low-power or high
performance PLL.

The low-power PLL takes a low-frequency input at 32,768 Hz and
generates an approximate of 17.64 or 19.2 MHz.

The high-performance PLL generates an exact 19.2 MHz clock signal
from high-frequency input at 12/19.2/26/38.4 MHz.

For the particular case of headset path, PLL being used defines the
headset power mode: low-power, high-performance. Headset DAC and
output driver should be configured according to the selected mode.
17.64 MHz sysclk is recommended only for headset low-power playback
mode.

Signed-off-by: Misael Lopez Cruz 
Signed-off-by: Jorge Eduardo Candelaria 
Signed-off-by: Margarita Olaya Cabrera 
---
 sound/soc/codecs/twl6030.c |  232 +--
 sound/soc/codecs/twl6030.h |   16 +++
 2 files changed, 215 insertions(+), 33 deletions(-)

diff --git a/sound/soc/codecs/twl6030.c b/sound/soc/codecs/twl6030.c
index ec838b1..792407f 100644
--- a/sound/soc/codecs/twl6030.c
+++ b/sound/soc/codecs/twl6030.c
@@ -39,7 +39,7 @@
 
 #include "twl6030.h"
 
-#define TWL6030_RATES   (SNDRV_PCM_RATE_96000)
+#define TWL6030_RATES   (SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
 #define TWL6030_FORMATS (SNDRV_PCM_FMTBIT_S32_LE)
 
 /* codec private data */
@@ -47,6 +47,9 @@ struct twl6030_data {
struct snd_soc_codec codec;
int audpwron;
int codec_powered;
+   int pll;
+   unsigned int sysclk;
+   struct snd_pcm_hw_constraint_list *sysclk_constraints;
 };
 
 /*
@@ -326,6 +329,29 @@ static void twl6030_power_down(struct snd_soc_codec *codec)
mdelay(10);
 }
 
+/* set headset dac and driver power mode */
+static int headset_power_mode(struct snd_soc_codec *codec, int high_perf)
+{
+   int hslctl, hsrctl;
+   int mask = TWL6030_HSDRVMODEL | TWL6030_HSDACMODEL;
+
+   hslctl = twl6030_read_reg_cache(codec, TWL6030_REG_HSLCTL);
+   hsrctl = twl6030_read_reg_cache(codec, TWL6030_REG_HSRCTL);
+
+   if (high_perf) {
+   hslctl &= ~mask;
+   hsrctl &= ~mask;
+   } else {
+   hslctl |= mask;
+   hsrctl |= mask;
+   }
+
+   twl6030_write(codec, TWL6030_REG_HSLCTL, hslctl);
+   twl6030_write(codec, TWL6030_REG_HSRCTL, hsrctl);
+
+   return 0;
+}
+
 /*
  * MICATT volume control:
  * from -6 to 0 dB in 6 dB steps
@@ -607,55 +633,195 @@ static int twl6030_set_bias_level(struct snd_soc_codec 
*codec,
return 0;
 }
 
+/* set of rates for each pll: low-power and high-performance */
+
+static unsigned int lp_rates[] = {
+   88200,
+   96000,
+};
+
+static struct snd_pcm_hw_constraint_list lp_constraints = {
+   .count  = ARRAY_SIZE(lp_rates),
+   .list   = lp_rates,
+};
+
+static unsigned int hp_rates[] = {
+   96000,
+};
+
+static struct snd_pcm_hw_constraint_list hp_constraints = {
+   .count  = ARRAY_SIZE(hp_rates),
+   .list   = hp_rates,
+};
+
+static int twl6030_startup(struct snd_pcm_substream *substream,
+   struct snd_soc_dai *dai)
+{
+   struct snd_soc_pcm_runtime *rtd = substream->private_data;
+   struct snd_soc_device *socdev = rtd->socdev;
+   struct snd_soc_codec *codec = socdev->card->codec;
+   struct twl6030_data *priv = codec->private_data;
+
+   if (!priv->sysclk) {
+   dev_err(codec->dev,
+   "no mclk configured, call set_sysclk() on init\n");
+   return -EINVAL;
+   }
+
+   snd_pcm_hw_constraint_list(substream->runtime, 0,
+   SNDRV_PCM_HW_PARAM_RATE,
+   priv->sysclk_constraints);
+
+   return 0;
+}
+
+static int twl6030_hw_params(struct snd_pcm_substream *substream,
+   struct snd_pcm_hw_params *params,
+   struct snd_soc_dai *dai)
+{
+   struct snd_soc_pcm_runtime *rtd = substream->private_data;
+   struct snd_soc_device *socdev = rtd->socdev;
+   struct snd_soc_codec *codec = socdev->card->codec;
+   struct twl6030_data *priv = codec->private_data;
+   u8 lppllctl;
+   int rate;
+
+   /* nothing to do for high-perf pll, it supports only 48 kHz */
+   if (priv->pll == TWL6030_HPPLL_ID)
+   return 0;
+
+   lppllctl = twl6030_read_reg_cache(codec, TWL6030_REG_LPPLLCTL);
+
+   rate = params_rate(params);
+   switch (rate) {
+   case 88200:
+   lppllctl |= TWL6030_LPLLFIN;
+   priv->sysclk = 1764;
+   break;
+   case 96000:
+   lppllctl &= ~TWL6030_LPLLFIN;
+   priv->sysclk = 1920;
+   break;
+   default:
+   dev_err(codec->dev, "unsupported rate %d\n", rate);
+   return -EINVAL;
+   }
+
+   twl6030_write(codec, TWL6030_REG_LPPLLCTL, lppllctl);
+
+   return 0;
+}
+
 static int twl6030_set_dai_sysclk(struct snd_soc_dai *codec_dai,
  

[PATCHv4 3/7] ASoC: TWL6030: Manual power-up/down sequences

2010-02-23 Thread Olaya, Margarita
From: Misael Lopez Cruz 

TWL6030 codec device can be powered-up/down through a specific register
writes sequence. These sequences can be used when no gpio line is
provided for AUDPWRON.

When the codec is powered-up in this way, automatic power-down sequence
(triggered by thermal shutdown) is not possible.

Signed-off-by: Misael Lopez Cruz 
Signed-off-by: Jorge Eduardo Candelaria 
Signed-off-by: Margarita Olaya Cabrera 
---
 sound/soc/codecs/twl6030.c |  112 ++-
 sound/soc/codecs/twl6030.h |   16 ++
 2 files changed, 115 insertions(+), 13 deletions(-)

diff --git a/sound/soc/codecs/twl6030.c b/sound/soc/codecs/twl6030.c
index 8b52aa1..ec838b1 100644
--- a/sound/soc/codecs/twl6030.c
+++ b/sound/soc/codecs/twl6030.c
@@ -244,6 +244,88 @@ static void twl6030_init_vdd_regs(struct snd_soc_codec 
*codec)
}
 }
 
+/* twl6030 codec manual power-up sequence */
+static void twl6030_power_up(struct snd_soc_codec *codec)
+{
+   u8 ncpctl, ldoctl, lppllctl, accctl;
+
+   ncpctl = twl6030_read_reg_cache(codec, TWL6030_REG_NCPCTL);
+   ldoctl = twl6030_read_reg_cache(codec, TWL6030_REG_LDOCTL);
+   lppllctl = twl6030_read_reg_cache(codec, TWL6030_REG_LPPLLCTL);
+   accctl = twl6030_read_reg_cache(codec, TWL6030_REG_ACCCTL);
+
+   /* enable reference system */
+   ldoctl |= TWL6030_REFENA;
+   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
+   mdelay(10);
+   /* enable internal oscillator */
+   ldoctl |= TWL6030_OSCENA;
+   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
+   udelay(10);
+   /* enable high-side ldo */
+   ldoctl |= TWL6030_HSLDOENA;
+   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
+   udelay(244);
+   /* enable negative charge pump */
+   ncpctl |= TWL6030_NCPENA | TWL6030_NCPOPEN;
+   twl6030_write(codec, TWL6030_REG_NCPCTL, ncpctl);
+   udelay(488);
+   /* enable low-side ldo */
+   ldoctl |= TWL6030_LSLDOENA;
+   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
+   udelay(244);
+   /* enable low-power pll */
+   lppllctl |= TWL6030_LPLLENA;
+   twl6030_write(codec, TWL6030_REG_LPPLLCTL, lppllctl);
+   /* reset state machine */
+   accctl |= TWL6030_RESETSPLIT;
+   twl6030_write(codec, TWL6030_REG_ACCCTL, accctl);
+   mdelay(5);
+   accctl &= ~TWL6030_RESETSPLIT;
+   twl6030_write(codec, TWL6030_REG_ACCCTL, accctl);
+   /* disable internal oscillator */
+   ldoctl &= ~TWL6030_OSCENA;
+   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
+}
+
+/* twl6030 codec manual power-down sequence */
+static void twl6030_power_down(struct snd_soc_codec *codec)
+{
+   u8 ncpctl, ldoctl, lppllctl, accctl;
+
+   ncpctl = twl6030_read_reg_cache(codec, TWL6030_REG_NCPCTL);
+   ldoctl = twl6030_read_reg_cache(codec, TWL6030_REG_LDOCTL);
+   lppllctl = twl6030_read_reg_cache(codec, TWL6030_REG_LPPLLCTL);
+   accctl = twl6030_read_reg_cache(codec, TWL6030_REG_ACCCTL);
+
+   /* enable internal oscillator */
+   ldoctl |= TWL6030_OSCENA;
+   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
+   udelay(10);
+   /* disable low-power pll */
+   lppllctl &= ~TWL6030_LPLLENA;
+   twl6030_write(codec, TWL6030_REG_LPPLLCTL, lppllctl);
+   /* disable low-side ldo */
+   ldoctl &= ~TWL6030_LSLDOENA;
+   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
+   udelay(244);
+   /* disable negative charge pump */
+   ncpctl &= ~(TWL6030_NCPENA | TWL6030_NCPOPEN);
+   twl6030_write(codec, TWL6030_REG_NCPCTL, ncpctl);
+   udelay(488);
+   /* disable high-side ldo */
+   ldoctl &= ~TWL6030_HSLDOENA;
+   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
+   udelay(244);
+   /* disable internal oscillator */
+   ldoctl &= ~TWL6030_OSCENA;
+   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
+   /* disable reference system */
+   ldoctl &= ~TWL6030_REFENA;
+   twl6030_write(codec, TWL6030_REG_LDOCTL, ldoctl);
+   mdelay(10);
+}
+
 /*
  * MICATT volume control:
  * from -6 to 0 dB in 6 dB steps
@@ -480,12 +562,15 @@ static int twl6030_set_bias_level(struct snd_soc_codec 
*codec,
 
/* power-up sequence latency */
mdelay(16);
-   }
 
-   /* sync registers updated during power-up sequence */
-   twl6030_read(codec, TWL6030_REG_NCPCTL);
-   twl6030_read(codec, TWL6030_REG_LDOCTL);
-   twl6030_read(codec, TWL6030_REG_LPPLLCTL);
+   /* sync registers updated during power-up sequence */
+   twl6030_read(codec, TWL6030_REG_NCPCTL);
+   twl6030_read(codec, TWL6030_REG_LDOCTL);
+   twl6030_read(codec, TWL6030_REG_LPPLLCTL);
+   } else {
+   /* use manual power-up sequence */
+   twl6030_power

[PATCHv4 2/7] ASoC: TWL6030: Add twl6030 codec driver

2010-02-23 Thread Olaya, Margarita
From: Misael Lopez Cruz 

Initial version of TWL6030 codec driver.

The TWL6030 codec uses a propietary PDM-based digital audio interface.
Audio paths supported are:

- Input: Main Mic, Sub Mic, Headset Mic, Auxiliary-FM Left/Right
- Output: Headset Left/Right, Handsfree Left/Right

Signed-off-by: Misael Lopez Cruz 
Signed-off-by: Jorge Eduardo Candelaria 
Signed-off-by: Margarita Olaya Cabrera 
---
 sound/soc/codecs/Kconfig   |4 +
 sound/soc/codecs/Makefile  |2 +
 sound/soc/codecs/twl6030.c |  823 
 sound/soc/codecs/twl6030.h |   94 +
 4 files changed, 923 insertions(+), 0 deletions(-)
 create mode 100644 sound/soc/codecs/twl6030.c
 create mode 100644 sound/soc/codecs/twl6030.h

diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 52b005f..3b3d739 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -33,6 +33,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_TPA6130A2 if I2C
select SND_SOC_TLV320DAC33 if I2C
select SND_SOC_TWL4030 if TWL4030_CORE
+   select SND_SOC_TWL6030 if TWL4030_CORE
select SND_SOC_UDA134X
select SND_SOC_UDA1380 if I2C
select SND_SOC_WM8350 if MFD_WM8350
@@ -155,6 +156,9 @@ config SND_SOC_TWL4030
select TWL4030_CODEC
tristate

+config SND_SOC_TWL6030
+   tristate
+
 config SND_SOC_UDA134X
tristate

diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index dbaecb1..e11a193 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -20,6 +20,7 @@ snd-soc-tlv320aic26-objs := tlv320aic26.o
 snd-soc-tlv320aic3x-objs := tlv320aic3x.o
 snd-soc-tlv320dac33-objs := tlv320dac33.o
 snd-soc-twl4030-objs := twl4030.o
+snd-soc-twl6030-objs := twl6030.o
 snd-soc-uda134x-objs := uda134x.o
 snd-soc-uda1380-objs := uda1380.o
 snd-soc-wm8350-objs := wm8350.o
@@ -76,6 +77,7 @@ obj-$(CONFIG_SND_SOC_TLV320AIC26) += snd-soc-tlv320aic26.o
 obj-$(CONFIG_SND_SOC_TLV320AIC3X)  += snd-soc-tlv320aic3x.o
 obj-$(CONFIG_SND_SOC_TLV320DAC33)  += snd-soc-tlv320dac33.o
 obj-$(CONFIG_SND_SOC_TWL4030)  += snd-soc-twl4030.o
+obj-$(CONFIG_SND_SOC_TWL6030)  += snd-soc-twl6030.o
 obj-$(CONFIG_SND_SOC_UDA134X)  += snd-soc-uda134x.o
 obj-$(CONFIG_SND_SOC_UDA1380)  += snd-soc-uda1380.o
 obj-$(CONFIG_SND_SOC_WM8350)   += snd-soc-wm8350.o
diff --git a/sound/soc/codecs/twl6030.c b/sound/soc/codecs/twl6030.c
new file mode 100644
index 000..8b52aa1
--- /dev/null
+++ b/sound/soc/codecs/twl6030.c
@@ -0,0 +1,823 @@
+/*
+ * ALSA SoC TWL6030 codec driver
+ *
+ * Author:  Misael Lopez Cruz 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "twl6030.h"
+
+#define TWL6030_RATES   (SNDRV_PCM_RATE_96000)
+#define TWL6030_FORMATS (SNDRV_PCM_FMTBIT_S32_LE)
+
+/* codec private data */
+struct twl6030_data {
+   struct snd_soc_codec codec;
+   int audpwron;
+   int codec_powered;
+};
+
+/*
+ * twl6030 register cache & default register settings
+ */
+static const u8 twl6030_reg[TWL6030_CACHEREGNUM] = {
+   0x00, /* not used   0x00*/
+   0x4B, /* TWL6030_ASICID (ro)0x01*/
+   0x00, /* TWL6030_ASICREV (ro)   0x02*/
+   0x00, /* TWL6030_INTID  0x03*/
+   0x7B, /* TWL6030_INTMR  0x04*/
+   0x00, /* TWL6030_NCPCTRL0x05*/
+   0x00, /* TWL6030_LDOCTL 0x06*/
+   0x00, /* TWL6030_HPPLLCTL   0x07*/
+   0x00, /* TWL6030_LPPLLCTL   0x08*/
+   0x00, /* TWL6030_LPPLLDIV   0x09*/
+   0x00, /* TWL6030_AMICBCTL   0x0A*/
+   0x00, /* TWL6030_DMICBCTL   0x0B*/
+   0x18, /* TWL6030_MICLCTL0x0C*/
+   0x18, /* TWL6030_MICRCTL0x0D*/
+   0x00, /* TWL6030_MICGAIN0x0E*/
+   0x1B, /* TWL6030_LINEGAIN   0x0F*/
+   0x00, /* TWL6030_HSLCTL 0x10*/
+   0x00, /* TWL6030_HSRCTL 0x11*/
+   0x00, /* TWL6030_HSGAIN 0x12*/
+   0x06, /* TWL6030_EARCTL 0x13*/
+   0x00, /* TWL6030_HFLCTL 0x14*/
+   0x03, /* TWL6030_HFLGAIN0x15*/
+  

[PATCHv4 1/7] OMAP4: PMIC: Add support for twl6030 codec

2010-02-23 Thread Olaya, Margarita
From: Misael Lopez Cruz 

In order to have TWL6030 CODEC driver as a platform driver, codec data
should be passed through twl_platform_data structure.

For twl6030 audio codec, the following data may be passed:
- audpwron_gpio: gpio line used to power-up/down the codec. A low-to-high
  transition powers codec up. Setting audpwron_gpio to a negative value
  means that codec will use manual power sequence instead of automatic
  sequence
- naudint_irq: irq line for audio interrupt. twl6030 drives NAUDINT line
  to low when an interrupt (codec ready, plug insertion/removal, etc) is
  detected

However, codec driver can operate if any or none of them are passed.

Signed-off-by: Misael Lopez Cruz 
Signed-off-by: Margarita Olaya Cabrera 
Signed-off-by: Jorge Eduardo Candelaria 
---
 drivers/mfd/twl-core.c  |   18 +++---
 include/linux/i2c/twl.h |4 
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index 514e1e4..7e3b0d7 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -118,7 +118,8 @@
 #define twl_has_watchdog()false
 #endif
 
-#if defined(CONFIG_TWL4030_CODEC) || defined(CONFIG_TWL4030_CODEC_MODULE)
+#if defined(CONFIG_TWL4030_CODEC) || defined(CONFIG_TWL4030_CODEC_MODULE) ||\
+   defined(CONFIG_SND_SOC_TWL6030) || 
defined(CONFIG_SND_SOC_TWL6030_MODULE)
 #define twl_has_codec()true
 #else
 #define twl_has_codec()false
@@ -735,8 +736,19 @@ add_children(struct twl4030_platform_data *pdata, unsigned 
long features)
return PTR_ERR(child);
}
 
-   if (twl_has_codec() && pdata->codec) {
-   child = add_child(1, "twl4030_codec",
+   if (twl_has_codec() && pdata->codec && twl_class_is_4030()) {
+   sub_chip_id = twl_map[TWL_MODULE_AUDIO_VOICE].sid;
+   child = add_child(sub_chip_id, "twl4030_codec",
+   pdata->codec, sizeof(*pdata->codec),
+   false, 0, 0);
+   if (IS_ERR(child))
+   return PTR_ERR(child);
+   }
+
+   /* Phoenix*/
+   if (twl_has_codec() && pdata->codec && twl_class_is_6030()) {
+   sub_chip_id = twl_map[TWL_MODULE_AUDIO_VOICE].sid;
+   child = add_child(sub_chip_id, "twl6030_codec",
pdata->codec, sizeof(*pdata->codec),
false, 0, 0);
if (IS_ERR(child))
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 9cf6cd7..d943c8b 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -556,6 +556,10 @@ struct twl4030_codec_data {
unsigned intaudio_mclk;
struct twl4030_codec_audio_data *audio;
struct twl4030_codec_vibra_data *vibra;
+
+   /* twl6030 */
+   int audpwron_gpio;  /* audio power-on gpio */
+   int naudint_irq;/* audio interrupt */
 };
 
 struct twl4030_platform_data {
-- 
1.6.1.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


[PATCHv4 0/7] TWL6030 audio codec initial support

2010-02-23 Thread Olaya, Margarita
Following patch series add initial support for TWL6030 codec driver.
The patch set is based on the series sent from Misael Lopez in October 2009.

Changes from v3:
- Remove snd_soc_init_card function
- Adapt to latest twl core changes based on Balaji's comment

Regards,
Margarita

---
Misael Lopez Cruz (7):
  OMAP4: PMIC: Add support for twl6030 codec
  ASoC: TWL6030: Add twl6030 codec driver
  ASoC: TWL6030: Manual power-up/down sequences
  ASoC: TWL6030: Add support for low-power PLL
  ASoC: TWL6030: Add restrictions for low-power playback mode
  ASoC: TWL6030: Enable audio interrupt
  ASoC: TWL6030: Detect power-up sequence completion

 drivers/mfd/twl-core.c |   18 +-
 include/linux/i2c/twl.h|4 +
 sound/soc/codecs/Kconfig   |4 +
 sound/soc/codecs/Makefile  |2 +
 sound/soc/codecs/twl6030.c | 1241 
 sound/soc/codecs/twl6030.h |  141 +
 6 files changed, 1407 insertions(+), 3 deletions(-)
 create mode 100644 sound/soc/codecs/twl6030.c
 create mode 100644 sound/soc/codecs/twl6030.h
--
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