alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Liam Girdwood <lrg@slimlogic.co.uk>
To: "Olaya, Margarita" <magi.olaya@ti.com>,
	Samuel Ortiz <sameo@linux.intel.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"broonie@opensource.wolfsonmicro.com"
	<broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCHv4 1/7] OMAP4: PMIC: Add support for twl6030 codec
Date: Wed, 24 Feb 2010 10:09:29 +0000	[thread overview]
Message-ID: <1267006169.3274.88.camel@odin> (raw)
In-Reply-To: <1889FA7136B567478A67D4B0F85B0CCE65DD1B13@dlee06.ent.ti.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

  reply	other threads:[~2010-02-24 10:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-24  0:10 [PATCHv4 1/7] OMAP4: PMIC: Add support for twl6030 codec Olaya, Margarita
2010-02-24 10:09 ` Liam Girdwood [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1267006169.3274.88.camel@odin \
    --to=lrg@slimlogic.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=magi.olaya@ti.com \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).