public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHv3 1/7] OMAP4: PMIC: Add support for twl6030 codec
@ 2009-10-06  7:29 Lopez Cruz, Misael
  2009-10-06  8:46 ` Peter Ujfalusi
  0 siblings, 1 reply; 11+ messages in thread
From: Lopez Cruz, Misael @ 2009-10-06  7:29 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org
  Cc: Mark Brown, Krishnamoorthy, Balaji T

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>
---
 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
 
 /* 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);
+	}
 #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 */
+};
+
 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;
-- 
1.5.4.3

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

* Re: [PATCHv3 1/7] OMAP4: PMIC: Add support for twl6030 codec
  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
  2009-10-06 16:35   ` Mark Brown
                     ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Peter Ujfalusi @ 2009-10-06  8:46 UTC (permalink / raw)
  To: alsa-devel
  Cc: linux-omap@vger.kernel.org, Krishnamoorthy, Balaji T,
	ext Lopez Cruz, Misael, Mark Brown

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

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

* Re: [PATCHv3 1/7] OMAP4: PMIC: Add support for twl6030 codec
  2009-10-06  8:46 ` Peter Ujfalusi
@ 2009-10-06 16:35   ` Mark Brown
  2009-10-07  6:26     ` [alsa-devel] " Shilimkar, Santosh
  2009-10-06 16:53   ` Lopez Cruz, Misael
  2009-10-07  5:20   ` [alsa-devel] " Krishnamoorthy, Balaji T
  2 siblings, 1 reply; 11+ messages in thread
From: Mark Brown @ 2009-10-06 16:35 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: alsa-devel, linux-omap@vger.kernel.org, Krishnamoorthy, Balaji T,
	ext Lopez Cruz, Misael

On Tue, Oct 06, 2009 at 11:46:05AM +0300, Peter Ujfalusi wrote:

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

The TWL6030 specific bits all look good but this change ought to go via
the MFD tree (probably as part of the big patch series adding twl6030
support that doesn't look to have been applied yet).  Are people happy
that the interface to the twl6030 won't change as a result of the
twl4030 audio support?  If so then I'll apply the ASoC side now, the
Kconfig dependencies will stop it being built too soon.

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

* Re: [PATCHv3 1/7] OMAP4: PMIC: Add support for twl6030 codec
  2009-10-06  8:46 ` Peter Ujfalusi
  2009-10-06 16:35   ` Mark Brown
@ 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
  2 siblings, 1 reply; 11+ messages in thread
From: Lopez Cruz, Misael @ 2009-10-06 16:53 UTC (permalink / raw)
  To: Peter Ujfalusi, alsa-devel@alsa-project.org
  Cc: linux-omap@vger.kernel.org, Shilimkar, Santosh,
	Krishnamoorthy, Balaji T, Mark Brown

Peter Ujfalusi wrote:
> 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.

twl6030 codec data won't conflict with twl4030's as it's dependent of
TWL6030_CORE. We can add parallely the required data for twl4030 codec.

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

CODEC_SUB_CHIP_ID for twl6030 is under #ifdef CONFIG_TWL6030_CORE.
There are a different set of _CHIP_IDs for twl4030 children, which
doesn't have a definition for CODEC yet.

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

Currently, the support for TWL4030 and TWL6030 makes them mutually
exclusive, TWL6030_CORE depends on !TWL4030_CORE. So we can have
separate twl_codec_data definitions to avoid unused space in the
structure.

> Should I merge here the things which will be used for the twl4030
> codec?

I think merging them would suit only if both twl versions can be
enabled at the same time, but not sure it that makes sense.

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

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

* RE: [alsa-devel] [PATCHv3 1/7] OMAP4: PMIC: Add support for twl6030 codec
  2009-10-06  8:46 ` Peter Ujfalusi
  2009-10-06 16:35   ` Mark Brown
  2009-10-06 16:53   ` Lopez Cruz, Misael
@ 2009-10-07  5:20   ` Krishnamoorthy, Balaji T
  2009-10-07  7:41     ` Peter Ujfalusi
  2009-10-08  1:30     ` Lopez Cruz, Misael
  2 siblings, 2 replies; 11+ messages in thread
From: Krishnamoorthy, Balaji T @ 2009-10-07  5:20 UTC (permalink / raw)
  To: Peter Ujfalusi, alsa-devel@alsa-project.org
  Cc: Lopez Cruz, Misael, linux-omap@vger.kernel.org, Mark Brown

> >  #define twl_has_mmc()   false
> >  #endif
> >
> > +#if defined(CONFIG_SND_SOC_TWL6030) ||
defined(CONFIG_SND_SOC_TWL6030_MODULE) ||
defined(CONFIG_SND_SOC_TWL4030) ||
defined(CONFIG_SND_SOC_TWL4030_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.
To pick the sub chip id from structure twl_mapping twl6030_map or twl4030_map at 
Runtime.  
> 
> >
> >  /* 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);
> > +	}
after [PATCH v3 0/4] TWL6030 patch series
Will now become something like
+	if (twl_has_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))
+			return PTR_ERR(child);
+	}
And similarly for 4030 code
+	if (twl_has_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);
+	}

> 
> 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 {
4030 and 6030 codec common fields can be added here
> > +	/* twl6030 */
> > +	int audpwron_gpio;	/* audio power-on gpio */
> > +	int naudint_irq;	/* audio interrupt */
Here twl4030 specific fields can be added
> > +};
> 
CONFIG_TWL6030_CORE and CONFIG_TWL4030_CORE is merged to CONFIG_TWL_CORE
As two different build config was not encouraged.  Now switch 
twl_class_is_6030() will be used to decide at runtime time to support for 6030 
related drivers, Similarly twl_class_is_4030() for 4030 drivers

> 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

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

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

* RE: [alsa-devel] [PATCHv3 1/7] OMAP4: PMIC: Add support for twl6030 codec
  2009-10-06 16:35   ` Mark Brown
@ 2009-10-07  6:26     ` Shilimkar, Santosh
  2009-10-07  9:37       ` Mark Brown
  0 siblings, 1 reply; 11+ messages in thread
From: Shilimkar, Santosh @ 2009-10-07  6:26 UTC (permalink / raw)
  To: Mark Brown, Peter Ujfalusi, sameo@linux.intel.com
  Cc: alsa-devel@alsa-project.org, Lopez Cruz, Misael,
	linux-omap@vger.kernel.org, Krishnamoorthy, Balaji T

(Looping Samuel)
> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of Mark Brown
> Sent: Tuesday, October 06, 2009 10:06 PM
> To: Peter Ujfalusi
> Cc: alsa-devel@alsa-project.org; Lopez Cruz, Misael; linux-
> omap@vger.kernel.org; Krishnamoorthy, Balaji T
> Subject: Re: [alsa-devel] [PATCHv3 1/7] OMAP4: PMIC: Add support for
> twl6030 codec
> 
> On Tue, Oct 06, 2009 at 11:46:05AM +0300, Peter Ujfalusi wrote:
> 
> > 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.
> 
> The TWL6030 specific bits all look good but this change ought to go via
> the MFD tree (probably as part of the big patch series adding twl6030
> support that doesn't look to have been applied yet).  Are people happy
> that the interface to the twl6030 won't change as a result of the
> twl4030 audio support?  If so then I'll apply the ASoC side now, the
> Kconfig dependencies will stop it being built too soon.
Since there is some sort of dependency on ASOC series with TWL_6030 core series by Balaji, its better that these gets merged in correct order to avoid reworks. 

Below order should make the merge without many conflicts.
1. [PATCH v3 0/4] TWL patch series
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg17059.html

2. [PATCH v3 0/4] TWL6030 patch series
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg17130.html

3. [PATCHv3 0/7] TWL6030 audio codec initial support + Rework the Kconfig dependency. 
http://www.spinics.net/lists/alsa-devel/msg28134.html

Samuel can take a call on this.


Regards,
Santosh

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

* Re: [PATCHv3 1/7] OMAP4: PMIC: Add support for twl6030 codec
  2009-10-06 16:53   ` Lopez Cruz, Misael
@ 2009-10-07  7:32     ` Peter Ujfalusi
  0 siblings, 0 replies; 11+ messages in thread
From: Peter Ujfalusi @ 2009-10-07  7:32 UTC (permalink / raw)
  To: ext Lopez Cruz, Misael
  Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
	Shilimkar, Santosh, Krishnamoorthy, Balaji T, Mark Brown

On Tuesday 06 October 2009 19:53:03 ext Lopez Cruz, Misael wrote:
> Peter Ujfalusi wrote:
> > 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.
> 
> twl6030 codec data won't conflict with twl4030's as it's dependent of
> TWL6030_CORE. We can add parallely the required data for twl4030 codec.

I see. I think I'll wait till the twl6030 codec and it's dependencies are in 
place, than I can start adding the needed code for the twl4030 codec as well.

Obviously this is needed for the clean up of twl4030 codec and get it to more 
sane form.

Thanks,
Péter

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

* Re: [PATCHv3 1/7] OMAP4: PMIC: Add support for twl6030 codec
  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
  1 sibling, 0 replies; 11+ messages in thread
From: Peter Ujfalusi @ 2009-10-07  7:41 UTC (permalink / raw)
  To: ext Krishnamoorthy, Balaji T
  Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
	Lopez Cruz, Misael, Mark Brown

On Wednesday 07 October 2009 08:20:35 ext Krishnamoorthy, Balaji T wrote:
> > >  #define twl_has_mmc()   false
> > >  #endif
> > >
> > > +#if defined(CONFIG_SND_SOC_TWL6030) ||
> 
> defined(CONFIG_SND_SOC_TWL6030_MODULE) ||
> defined(CONFIG_SND_SOC_TWL4030) ||
> defined(CONFIG_SND_SOC_TWL4030_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.
> 
> To pick the sub chip id from structure twl_mapping twl6030_map or
>  twl4030_map at Runtime.

Yes, it can be done.

> 
> > >  /* 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);
> > > +	}
> 
> after [PATCH v3 0/4] TWL6030 patch series
> Will now become something like
> +	if (twl_has_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))
> +			return PTR_ERR(child);
> +	}
> And similarly for 4030 code
> +	if (twl_has_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);
> +	}

Sounds good.

> 
> > 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 {
> 
> 4030 and 6030 codec common fields can be added here
> 
> > > +	/* twl6030 */
> > > +	int audpwron_gpio;	/* audio power-on gpio */
> > > +	int naudint_irq;	/* audio interrupt */
> 
> Here twl4030 specific fields can be added

We can also use different twl_codec_data for 6030 and 4030.
There are not that many common things to handle, or is there?

> 
> > > +};
> 
> CONFIG_TWL6030_CORE and CONFIG_TWL4030_CORE is merged to CONFIG_TWL_CORE
> As two different build config was not encouraged.  Now switch
> twl_class_is_6030() will be used to decide at runtime time to support for
>  6030 related drivers, Similarly twl_class_is_4030() for 4030 drivers

I will hold back the patches for the twl4030 codec and twl core for now and wait 
till things settled a bit. 

Thanks,
Péter

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

* Re: [PATCHv3 1/7] OMAP4: PMIC: Add support for twl6030 codec
  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
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Brown @ 2009-10-07  9:37 UTC (permalink / raw)
  To: Shilimkar, Santosh
  Cc: alsa-devel@alsa-project.org, sameo@linux.intel.com,
	Peter Ujfalusi, Lopez Cruz, Misael, linux-omap@vger.kernel.org,
	Krishnamoorthy, Balaji T

On Wed, Oct 07, 2009 at 11:56:38AM +0530, Shilimkar, Santosh wrote:

[I've reflowed your mail to fit into 80 columns]

> Since there is some sort of dependency on ASOC series with TWL_6030
> core series by Balaji, its better that these gets merged in correct
> order to avoid reworks. 

There's no ordering problem with ASoC providing the TWL6030 core patches
add the TWL6030_CORE symbol as the last thing in the merge.  None of the
ASoC drivers will be built until that symbol is defined so the absence
of the core shouldn't matter.

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

* RE: [alsa-devel] [PATCHv3 1/7] OMAP4: PMIC: Add support for twl6030 codec
  2009-10-07  9:37       ` Mark Brown
@ 2009-10-07  9:40         ` Shilimkar, Santosh
  0 siblings, 0 replies; 11+ messages in thread
From: Shilimkar, Santosh @ 2009-10-07  9:40 UTC (permalink / raw)
  To: Mark Brown
  Cc: Peter Ujfalusi, sameo@linux.intel.com,
	alsa-devel@alsa-project.org, Lopez Cruz, Misael,
	linux-omap@vger.kernel.org, Krishnamoorthy, Balaji T

> -----Original Message-----
> From: Mark Brown [mailto:broonie@opensource.wolfsonmicro.com]
> Sent: Wednesday, October 07, 2009 3:07 PM
> To: Shilimkar, Santosh
> Cc: Peter Ujfalusi; sameo@linux.intel.com; alsa-devel@alsa-project.org;
> Lopez Cruz, Misael; linux-omap@vger.kernel.org; Krishnamoorthy, Balaji T
> Subject: Re: [alsa-devel] [PATCHv3 1/7] OMAP4: PMIC: Add support for
> twl6030 codec
> 
> On Wed, Oct 07, 2009 at 11:56:38AM +0530, Shilimkar, Santosh wrote:
> 
> [I've reflowed your mail to fit into 80 columns]
> 
> > Since there is some sort of dependency on ASOC series with TWL_6030
> > core series by Balaji, its better that these gets merged in correct
> > order to avoid reworks.
> 
> There's no ordering problem with ASoC providing the TWL6030 core patches
> add the TWL6030_CORE symbol as the last thing in the merge.  None of the
> ASoC drivers will be built until that symbol is defined so the absence
> of the core shouldn't matter.
OK. 

Regards,
Santosh

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

* Re: [PATCHv3 1/7] OMAP4: PMIC: Add support for twl6030 codec
  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
  1 sibling, 0 replies; 11+ messages in thread
From: Lopez Cruz, Misael @ 2009-10-08  1:30 UTC (permalink / raw)
  To: Krishnamoorthy, Balaji T, Peter Ujfalusi,
	alsa-devel@alsa-project.org
  Cc: linux-omap@vger.kernel.org, Mark Brown

Krishnamoorthy, Balaji T wrote:

> CONFIG_TWL6030_CORE and CONFIG_TWL4030_CORE is merged to
> CONFIG_TWL_CORE As two different build config was not encouraged. 
> Now switch twl_class_is_6030() will be used to decide at runtime time
> to support for 6030 related drivers, Similarly twl_class_is_4030()
> for 4030 drivers 

In patch "[PATCH v3 01/04] OMAP4: PMIC: Add support for twl6030 irq
framework" [1], TWL4030_CORE is redefined as TWL_CORE as you mentioned.
Then I guess that audio drivers should depend on TWL_CORE as well, if so
then we have to update all its dependencies:

1. TWL4030 codec driver: SND_SOC_TWL4030
2. All machine drivers using twl4030 codec driver: overo, omap2evm,
   omap3evm, sdp3430, omap3_pandora, omap3_beagle and zoom2

And I should do the same for twl6030 codec driver.

Regards,
-Misa

[1] http://www.mail-archive.com/linux-omap@vger.kernel.org/msg17066.html

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

end of thread, other threads:[~2009-10-08  1:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox