wm8994 : add POWER_EN PA_CTRL iomux to pdata
author邱建斌 <qjb@rock-chips.com>
Sat, 17 Dec 2011 03:35:06 +0000 (11:35 +0800)
committer邱建斌 <qjb@rock-chips.com>
Sat, 17 Dec 2011 03:35:06 +0000 (11:35 +0800)
drivers/regulator/wm8994-regulator.c
include/linux/mfd/wm8994/pdata.h
sound/soc/codecs/wm8994.c

index e7b65bbd698fc10df9c35ddc633575d073a0b63e..91c8043fc5766f0c495debd5fa43070fb48c911f 100755 (executable)
@@ -25,6 +25,8 @@
 #include <linux/mfd/wm8994/registers.h>
 #include <linux/mfd/wm8994/pdata.h>
 
+#include <mach/iomux.h>
+
 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;
index 8f6c61490d79a3b7843c78736831c88f0162bcd5..66da98e51d08623a50e0b34490bdc8d1609d2b52 100755 (executable)
@@ -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;          
        
 };
 
index 038d65c429e2160126150e1dd0767fed4b5a306a..662b01364d36c48e4b658c005957a4fbea76e012 100755 (executable)
@@ -30,6 +30,7 @@
 #include <sound/tlv.h>
 #include <trace/events/asoc.h>
 #include <mach/gpio.h>
+#include <mach/iomux.h>
 
 #include <linux/mfd/wm8994/core.h>
 #include <linux/mfd/wm8994/registers.h>
@@ -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);
        }