@@ -73,7 +73,6 @@ struct wm8996_priv {
73
73
74
74
struct regulator_bulk_data supplies [WM8996_NUM_SUPPLIES ];
75
75
struct notifier_block disable_nb [WM8996_NUM_SUPPLIES ];
76
- struct regulator * cpvdd ;
77
76
int bg_ena ;
78
77
79
78
struct wm8996_pdata pdata ;
@@ -793,29 +792,18 @@ static int bg_event(struct snd_soc_dapm_widget *w,
793
792
static int cp_event (struct snd_soc_dapm_widget * w ,
794
793
struct snd_kcontrol * kcontrol , int event )
795
794
{
796
- struct snd_soc_codec * codec = w -> codec ;
797
- struct wm8996_priv * wm8996 = snd_soc_codec_get_drvdata (codec );
798
795
int ret = 0 ;
799
796
800
797
switch (event ) {
801
- case SND_SOC_DAPM_PRE_PMU :
802
- ret = regulator_enable (wm8996 -> cpvdd );
803
- if (ret != 0 )
804
- dev_err (codec -> dev , "Failed to enable CPVDD: %d\n" ,
805
- ret );
806
- break ;
807
798
case SND_SOC_DAPM_POST_PMU :
808
799
msleep (5 );
809
800
break ;
810
- case SND_SOC_DAPM_POST_PMD :
811
- regulator_disable_deferred (wm8996 -> cpvdd , 20 );
812
- break ;
813
801
default :
814
802
BUG ();
815
803
ret = - EINVAL ;
816
804
}
817
805
818
- return ret ;
806
+ return 0 ;
819
807
}
820
808
821
809
static int rmv_short_event (struct snd_soc_dapm_widget * w ,
@@ -1117,12 +1105,12 @@ SND_SOC_DAPM_INPUT("IN2RP"),
1117
1105
SND_SOC_DAPM_INPUT ("DMIC1DAT" ),
1118
1106
SND_SOC_DAPM_INPUT ("DMIC2DAT" ),
1119
1107
1108
+ SND_SOC_DAPM_REGULATOR_SUPPLY ("CPVDD" , 20 ),
1120
1109
SND_SOC_DAPM_SUPPLY_S ("SYSCLK" , 1 , WM8996_AIF_CLOCKING_1 , 0 , 0 , NULL , 0 ),
1121
1110
SND_SOC_DAPM_SUPPLY_S ("SYSDSPCLK" , 2 , WM8996_CLOCKING_1 , 1 , 0 , NULL , 0 ),
1122
1111
SND_SOC_DAPM_SUPPLY_S ("AIFCLK" , 2 , WM8996_CLOCKING_1 , 2 , 0 , NULL , 0 ),
1123
1112
SND_SOC_DAPM_SUPPLY_S ("Charge Pump" , 2 , WM8996_CHARGE_PUMP_1 , 15 , 0 , cp_event ,
1124
- SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
1125
- SND_SOC_DAPM_POST_PMD ),
1113
+ SND_SOC_DAPM_POST_PMU ),
1126
1114
SND_SOC_DAPM_SUPPLY ("Bandgap" , SND_SOC_NOPM , 0 , 0 , bg_event ,
1127
1115
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD ),
1128
1116
SND_SOC_DAPM_SUPPLY ("LDO2" , WM8996_POWER_MANAGEMENT_2 , 1 , 0 , NULL , 0 ),
@@ -1281,6 +1269,7 @@ static const struct snd_soc_dapm_route wm8996_dapm_routes[] = {
1281
1269
{ "AIFCLK" , NULL , "SYSCLK" },
1282
1270
{ "SYSDSPCLK" , NULL , "SYSCLK" },
1283
1271
{ "Charge Pump" , NULL , "SYSCLK" },
1272
+ { "Charge Pump" , NULL , "CPVDD" },
1284
1273
1285
1274
{ "MICB1" , NULL , "LDO2" },
1286
1275
{ "MICB1" , NULL , "MICB1 Audio" },
@@ -3049,7 +3038,6 @@ static int wm8996_remove(struct snd_soc_codec *codec)
3049
3038
for (i = 0 ; i < ARRAY_SIZE (wm8996 -> supplies ); i ++ )
3050
3039
regulator_unregister_notifier (wm8996 -> supplies [i ].consumer ,
3051
3040
& wm8996 -> disable_nb [i ]);
3052
- regulator_put (wm8996 -> cpvdd );
3053
3041
regulator_bulk_free (ARRAY_SIZE (wm8996 -> supplies ), wm8996 -> supplies );
3054
3042
3055
3043
return 0 ;
@@ -3172,18 +3160,11 @@ static __devinit int wm8996_i2c_probe(struct i2c_client *i2c,
3172
3160
goto err_gpio ;
3173
3161
}
3174
3162
3175
- wm8996 -> cpvdd = regulator_get (& i2c -> dev , "CPVDD" );
3176
- if (IS_ERR (wm8996 -> cpvdd )) {
3177
- ret = PTR_ERR (wm8996 -> cpvdd );
3178
- dev_err (& i2c -> dev , "Failed to get CPVDD: %d\n" , ret );
3179
- goto err_get ;
3180
- }
3181
-
3182
3163
ret = regulator_bulk_enable (ARRAY_SIZE (wm8996 -> supplies ),
3183
3164
wm8996 -> supplies );
3184
3165
if (ret != 0 ) {
3185
3166
dev_err (& i2c -> dev , "Failed to enable supplies: %d\n" , ret );
3186
- goto err_cpvdd ;
3167
+ goto err_get ;
3187
3168
}
3188
3169
3189
3170
if (wm8996 -> pdata .ldo_ena > 0 ) {
@@ -3245,8 +3226,6 @@ static __devinit int wm8996_i2c_probe(struct i2c_client *i2c,
3245
3226
if (wm8996 -> pdata .ldo_ena > 0 )
3246
3227
gpio_set_value_cansleep (wm8996 -> pdata .ldo_ena , 0 );
3247
3228
regulator_bulk_disable (ARRAY_SIZE (wm8996 -> supplies ), wm8996 -> supplies );
3248
- err_cpvdd :
3249
- regulator_put (wm8996 -> cpvdd );
3250
3229
err_get :
3251
3230
regulator_bulk_free (ARRAY_SIZE (wm8996 -> supplies ), wm8996 -> supplies );
3252
3231
err_gpio :
@@ -3263,7 +3242,6 @@ static __devexit int wm8996_i2c_remove(struct i2c_client *client)
3263
3242
3264
3243
snd_soc_unregister_codec (& client -> dev );
3265
3244
wm8996_free_gpio (wm8996 );
3266
- regulator_put (wm8996 -> cpvdd );
3267
3245
regulator_bulk_free (ARRAY_SIZE (wm8996 -> supplies ), wm8996 -> supplies );
3268
3246
regmap_exit (wm8996 -> regmap );
3269
3247
if (wm8996 -> pdata .ldo_ena > 0 ) {
0 commit comments