From f3000ead23599b42d19c3d2e7cb5c094b7f25132 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=82=B1=E5=BB=BA=E6=96=8C?= Date: Sat, 17 Dec 2011 11:35:06 +0800 Subject: [PATCH] wm8994 : add POWER_EN PA_CTRL iomux to pdata --- drivers/regulator/wm8994-regulator.c | 7 ++++++- include/linux/mfd/wm8994/pdata.h | 9 ++++++--- sound/soc/codecs/wm8994.c | 3 +++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/wm8994-regulator.c b/drivers/regulator/wm8994-regulator.c index e7b65bbd698f..91c8043fc576 100755 --- a/drivers/regulator/wm8994-regulator.c +++ b/drivers/regulator/wm8994-regulator.c @@ -25,6 +25,8 @@ #include #include +#include + struct wm8994_ldo { int enable; bool is_enabled; @@ -235,7 +237,10 @@ static __devinit int wm8994_ldo_probe(struct platform_device *pdev) } ldo->wm8994 = wm8994; - + + if(pdata->ldo[id].iomux_name != NULL) + rk29_mux_api_set(pdata->ldo[id].iomux_name, pdata->ldo[id].iomux_mode); + if (pdata->ldo[id].enable && gpio_is_valid(pdata->ldo[id].enable)) { ldo->enable = pdata->ldo[id].enable; ldo->is_enabled = true; diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h index 8f6c61490d79..66da98e51d08 100755 --- a/include/linux/mfd/wm8994/pdata.h +++ b/include/linux/mfd/wm8994/pdata.h @@ -24,6 +24,10 @@ struct wm8994_ldo_pdata { const char *supply; struct regulator_init_data *init_data; + + //wm8994 LDO1_ENA and LDO2_ENA + char iomux_name[50]; + int iomux_mode; }; #define WM8994_CONFIGURE_GPIO 0x10000 @@ -123,9 +127,6 @@ struct wm8994_pdata { int gpio_defaults[WM8994_NUM_GPIO]; struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO]; - //wm8994 LDO1_ENA and LDO2_ENA - char PowerEN_iomux_name[50]; - int PowerEN_iomux_mode; int irq_base; /** Base IRQ number for WM8994, required for IRQs */ @@ -173,6 +174,8 @@ struct wm8994_pdata { //If an external amplifier speakers wm8994 enable>0 disable=0 unsigned int PA_control_pin; + char PA_iomux_name[50]; + int PA_iomux_mode; }; diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 038d65c429e2..662b01364d36 100755 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -3249,6 +3250,8 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) ARRAY_SIZE(wm8994_PA_dapm_widgets)); snd_soc_dapm_add_routes(dapm, wm8994_PA_intercon, ARRAY_SIZE(wm8994_PA_intercon)); + if(pdata->PA_iomux_name != NULL) + rk29_mux_api_set(pdata->PA_iomux_name, pdata->PA_iomux_mode); gpio_request(pdata->PA_control_pin, "wm8994_PA_ctrl"); gpio_direction_output(pdata->PA_control_pin,GPIO_LOW); } -- 2.34.1