All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@nokia.com>
To: alsa-devel@alsa-project.org
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"Krishnamoorthy, Balaji T" <balajitk@ti.com>,
	"ext Lopez Cruz, Misael" <x0052729@ti.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCHv3 1/7] OMAP4: PMIC: Add support for twl6030 codec
Date: Tue, 6 Oct 2009 11:46:05 +0300	[thread overview]
Message-ID: <200910061146.05080.peter.ujfalusi@nokia.com> (raw)
In-Reply-To: <67059DBF19D7214F9C66BB0EA91BA90E90C2F648@dlee04.ent.ti.com>

On Tuesday 06 October 2009 10:29:39 ext Lopez Cruz, Misael wrote:
> 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.

How does the twl4030 series would fit with this modification?
I have also added the twl4030 codec as a child for the twl MFD, but I have not 
finished the cleanup of the codec fully.

> 
> Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
> ---
>  drivers/mfd/twl-core.c  |   15 +++++++++++++++
>  include/linux/i2c/twl.h |    7 +++++++
>  2 files changed, 22 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
> index af4cf47..6432af1 100644
> --- a/drivers/mfd/twl-core.c
> +++ b/drivers/mfd/twl-core.c
> @@ -108,6 +108,12 @@
>  #define twl_has_mmc()   false
>  #endif
> 
> +#if defined(CONFIG_SND_SOC_TWL6030) ||
>  defined(CONFIG_SND_SOC_TWL6030_MODULE) +#define twl_has_codec()	true
> +#else
> +#define twl_has_codec()	false
> +#endif
> +
>  #if defined(CONFIG_TWL4030_USB) || defined(CONFIG_TWL4030_USB_MODULE)
>  #define twl_has_usb()	true
>  #else
> @@ -190,6 +196,7 @@
>  #define BCI_SUB_CHIP_ID		SUB_CHIP_ID1
>  #define GPIO_SUB_CHIP_ID	0 /* NOT SUPPORTED IN TWL6030 */
>  #define KEYPAD_SUB_CHIP_ID	0 /* ADDED FOR COMPILATION ONLY */
> +#define CODEC_SUB_CHIP_ID	SUB_CHIP_ID3

TWL4030 codec is under ID2 address group.

> 
>  /* subchip/slave 0 0x48 - POWER */
>  #define TWL6030_BASEADD_RTC		0x0000
> @@ -632,6 +639,14 @@ add_children(struct twl_platform_data *pdata, unsigned
>  long features) if (IS_ERR(child))
>  			return PTR_ERR(child);
>  	}
> +
> +	if (twl_has_codec()) {
> +		child = add_child(CODEC_SUB_CHIP_ID, "twl6030_codec",
> +			pdata->codec, sizeof(*pdata->codec), false,
> +			0, 0);
> +		if (IS_ERR(child))
> +			return PTR_ERR(child);
> +	}

We are going to have the twl4030 as child as well.

>  #endif
> 
>  	if (twl_has_usb() && pdata->usb) {
> diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
> index b687a8b..e76ca9b 100644
> --- a/include/linux/i2c/twl.h
> +++ b/include/linux/i2c/twl.h
> @@ -472,6 +472,12 @@ struct twl_usb_data {
>  	enum twl_usb_mode	usb_mode;
>  };
> 
> +struct twl_codec_data {
> +	/* twl6030 */
> +	int audpwron_gpio;	/* audio power-on gpio */
> +	int naudint_irq;	/* audio interrupt */
> +};

These are not applicable for the twl4030 codec, should we have different 
twl_codec_data for twl6030 and twl4030 series?
Should I merge here the things which will be used for the twl4030 codec?
At the moment, I only have audio_mclk in my codec_data, but most probably the HS 
ramp related things will be also merged here in the future.

> +
>  struct twl_platform_data {
>  	unsigned				irq_base, irq_end;
>  	struct twl_bci_platform_data	*bci;
> @@ -479,6 +485,7 @@ struct twl_platform_data {
>  	struct twl_madc_platform_data	*madc;
>  	struct twl_keypad_data		*keypad;
>  	struct twl_usb_data			*usb;
> +	struct twl_codec_data		*codec;
> 
>  	/* LDO regulators common to TWL4030/TWL6030 */
>  	struct regulator_init_data		*vdac;
> 

-- 
Péter

  reply	other threads:[~2009-10-06  8:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-06  7:29 [PATCHv3 1/7] OMAP4: PMIC: Add support for twl6030 codec Lopez Cruz, Misael
2009-10-06  8:46 ` Peter Ujfalusi [this message]
2009-10-06 16:35   ` Mark Brown
2009-10-07  6:26     ` [alsa-devel] " Shilimkar, Santosh
2009-10-07  9:37       ` Mark Brown
2009-10-07  9:40         ` [alsa-devel] " Shilimkar, Santosh
2009-10-06 16:53   ` Lopez Cruz, Misael
2009-10-07  7:32     ` Peter Ujfalusi
2009-10-07  5:20   ` [alsa-devel] " Krishnamoorthy, Balaji T
2009-10-07  7:41     ` Peter Ujfalusi
2009-10-08  1:30     ` Lopez Cruz, Misael

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=200910061146.05080.peter.ujfalusi@nokia.com \
    --to=peter.ujfalusi@nokia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=balajitk@ti.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=x0052729@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.