Commit d62abe56 authored by Misael Lopez Cruz's avatar Misael Lopez Cruz Committed by Mark Brown

OMAP4: PMIC: Add support for twl6030 codec

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: default avatarMisael Lopez Cruz <x0052729@ti.com>
Signed-off-by: default avatarMargarita Olaya Cabrera <magi.olaya@ti.com>
Signed-off-by: default avatarJorge Eduardo Candelaria <jorge.candelaria@ti.com>
Acked-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 47fc9a0a
......@@ -115,7 +115,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
......@@ -711,8 +712,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))
......
......@@ -547,6 +547,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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment