alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv4 1/7] OMAP4: PMIC: Add support for twl6030 codec
@ 2010-02-24  0:10 Olaya, Margarita
  2010-02-24 10:09 ` Liam Girdwood
  0 siblings, 1 reply; 7+ messages in thread
From: Olaya, Margarita @ 2010-02-24  0:10 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org
  Cc: broonie@opensource.wolfsonmicro.com, lrg@slimlogic.co.uk

From: Misael Lopez Cruz <x0052729@ti.com>

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 <x0052729@ti.com>
Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
Signed-off-by: Jorge Eduardo Candelaria <jorge.candelaria@ti.com>
---
 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 int	audio_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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCHv4 1/7] OMAP4: PMIC: Add support for twl6030 codec
  2010-02-24  0:10 [PATCHv4 1/7] OMAP4: PMIC: Add support for twl6030 codec Olaya, Margarita
@ 2010-02-24 10:09 ` Liam Girdwood
  2010-02-24 11:13   ` Samuel Ortiz
  0 siblings, 1 reply; 7+ messages in thread
From: Liam Girdwood @ 2010-02-24 10:09 UTC (permalink / raw)
  To: Olaya, Margarita, Samuel Ortiz
  Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
	broonie@opensource.wolfsonmicro.com

On Tue, 2010-02-23 at 18:10 -0600, Olaya, Margarita wrote:
> From: Misael Lopez Cruz <x0052729@ti.com>
> 
> 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 <x0052729@ti.com>
> Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
> Signed-off-by: Jorge Eduardo Candelaria <jorge.candelaria@ti.com>

It would be good to get Samuel's Ack on this as it touches MFD.

Samuel are you OK with this ?

> ---
>  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 int	audio_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 {

Liam

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCHv4 1/7] OMAP4: PMIC: Add support for twl6030 codec
  2010-02-24 10:09 ` Liam Girdwood
@ 2010-02-24 11:13   ` Samuel Ortiz
  2010-02-24 13:22     ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Samuel Ortiz @ 2010-02-24 11:13 UTC (permalink / raw)
  To: Liam Girdwood
  Cc: Olaya, Margarita, alsa-devel@alsa-project.org,
	linux-omap@vger.kernel.org, broonie@opensource.wolfsonmicro.com

Hi Liam,

On Wed, Feb 24, 2010 at 10:09:29AM +0000, Liam Girdwood wrote:
> On Tue, 2010-02-23 at 18:10 -0600, Olaya, Margarita wrote:
> > From: Misael Lopez Cruz <x0052729@ti.com>
> > 
> > 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 <x0052729@ti.com>
> > Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
> > Signed-off-by: Jorge Eduardo Candelaria <jorge.candelaria@ti.com>
> 
> It would be good to get Samuel's Ack on this as it touches MFD.
> 
> Samuel are you OK with this ?
That seems fine, yes.
Acked-by: Samuel Ortiz <sameo@linux.intel.com>

Cheers,
Samuel.


> > ---
> >  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 int	audio_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 {
> 
> Liam
> 
> -- 
> Freelance Developer, SlimLogic Ltd
> ASoC and Voltage Regulator Maintainer.
> http://www.slimlogic.co.uk
> 

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCHv4 1/7] OMAP4: PMIC: Add support for twl6030 codec
  2010-02-24 11:13   ` Samuel Ortiz
@ 2010-02-24 13:22     ` Mark Brown
  2010-02-24 21:43       ` Olaya, Margarita
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2010-02-24 13:22 UTC (permalink / raw)
  To: Samuel Ortiz
  Cc: Liam Girdwood, Olaya, Margarita, alsa-devel@alsa-project.org,
	linux-omap@vger.kernel.org

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 <sameo@linux.intel.com>

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCHv4 1/7] OMAP4: PMIC: Add support for twl6030 codec
  2010-02-24 13:22     ` Mark Brown
@ 2010-02-24 21:43       ` Olaya, Margarita
  2010-02-25  0:15         ` Misael Lopez
  2010-02-25 10:07         ` Mark Brown
  0 siblings, 2 replies; 7+ messages in thread
From: Olaya, Margarita @ 2010-02-24 21:43 UTC (permalink / raw)
  To: Mark Brown, Samuel Ortiz
  Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
	Liam Girdwood

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:broonie@opensource.wolfsonmicro.com]
> Sent: Wednesday, February 24, 2010 7:23 AM
> To: Samuel Ortiz
> Cc: Liam Girdwood; Olaya, Margarita; alsa-devel@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 <sameo@linux.intel.com>
> 
> 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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCHv4 1/7] OMAP4: PMIC: Add support for twl6030 codec
  2010-02-24 21:43       ` Olaya, Margarita
@ 2010-02-25  0:15         ` Misael Lopez
  2010-02-25 10:07         ` Mark Brown
  1 sibling, 0 replies; 7+ messages in thread
From: Misael Lopez @ 2010-02-25  0:15 UTC (permalink / raw)
  To: Olaya, Margarita, Mark Brown, Samuel Ortiz
  Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
	Liam Girdwood

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?

As shown in TI's website ([1], [2]):
- TWL6030 contains PM, USB, I2C, etc
- TWL6040 contains only audio

Then, TWL6030 is the MFD and TWL6040 is a simple audio codec, and
this patch ([PATCHv4 1/7] OMAP4: PMIC: Add support for twl6030 codec)
is not valid since the codec doesn't belong to the MFD anymore.

TWL6040 can become a MFD to support vibrator as Mark pointed out.

-Misa

[1] http://focus.ti.com/general/docs/wtbu/wtbuproductcontent.tsp?templateId=6123&navigationId=12845&contentId=53245
[2] http://focus.ti.com/pdfs/wtbu/twl60x0flyer_slyv008.pdf

> Regards,
> Margarita
> 
> > -----Original Message-----
> > From: Mark Brown [mailto:broonie@opensource.wolfsonmicro.com]
> > Sent: Wednesday, February 24, 2010 7:23 AM
> > To: Samuel Ortiz
> > Cc: Liam Girdwood; Olaya, Margarita; alsa-devel@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 <sameo@linux.intel.com>
> >
> > 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.
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCHv4 1/7] OMAP4: PMIC: Add support for twl6030 codec
  2010-02-24 21:43       ` Olaya, Margarita
  2010-02-25  0:15         ` Misael Lopez
@ 2010-02-25 10:07         ` Mark Brown
  1 sibling, 0 replies; 7+ messages in thread
From: Mark Brown @ 2010-02-25 10:07 UTC (permalink / raw)
  To: Olaya, Margarita
  Cc: Samuel Ortiz, Liam Girdwood, alsa-devel@alsa-project.org,
	linux-omap@vger.kernel.org

On Wed, Feb 24, 2010 at 03:43:14PM -0600, Olaya, Margarita wrote:

[Reflowed into 80 columns]

> 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?

Incremental patch, please.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-02-25 10:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-24  0:10 [PATCHv4 1/7] OMAP4: PMIC: Add support for twl6030 codec Olaya, Margarita
2010-02-24 10:09 ` Liam Girdwood
2010-02-24 11:13   ` Samuel Ortiz
2010-02-24 13:22     ` Mark Brown
2010-02-24 21:43       ` Olaya, Margarita
2010-02-25  0:15         ` Misael Lopez
2010-02-25 10:07         ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).