@@ -332,7 +332,6 @@ struct wcd9335_codec {
332332
333333 int intr1 ;
334334 struct gpio_desc * reset_gpio ;
335- struct regulator_bulk_data supplies [WCD9335_MAX_SUPPLY ];
336335
337336 unsigned int rx_port_value [WCD9335_RX_MAX ];
338337 unsigned int tx_port_value [WCD9335_TX_MAX ];
@@ -355,6 +354,10 @@ struct wcd9335_irq {
355354 char * name ;
356355};
357356
357+ static const char * const wcd9335_supplies [] = {
358+ "vdd-buck" , "vdd-buck-sido" , "vdd-tx" , "vdd-rx" , "vdd-io" ,
359+ };
360+
358361static const struct wcd9335_slim_ch wcd9335_tx_chs [WCD9335_TX_MAX ] = {
359362 WCD9335_SLIM_TX_CH (0 ),
360363 WCD9335_SLIM_TX_CH (1 ),
@@ -4989,30 +4992,16 @@ static int wcd9335_parse_dt(struct wcd9335_codec *wcd)
49894992 if (IS_ERR (wcd -> native_clk ))
49904993 return dev_err_probe (dev , PTR_ERR (wcd -> native_clk ), "slimbus clock not found\n" );
49914994
4992- wcd -> supplies [0 ].supply = "vdd-buck" ;
4993- wcd -> supplies [1 ].supply = "vdd-buck-sido" ;
4994- wcd -> supplies [2 ].supply = "vdd-tx" ;
4995- wcd -> supplies [3 ].supply = "vdd-rx" ;
4996- wcd -> supplies [4 ].supply = "vdd-io" ;
4997-
4998- ret = regulator_bulk_get (dev , WCD9335_MAX_SUPPLY , wcd -> supplies );
4995+ ret = devm_regulator_bulk_get_enable (dev , ARRAY_SIZE (wcd9335_supplies ),
4996+ wcd9335_supplies );
49994997 if (ret )
5000- return dev_err_probe (dev , ret , "Failed to get supplies\n" );
4998+ return dev_err_probe (dev , ret , "Failed to get and enable supplies\n" );
50014999
50025000 return 0 ;
50035001}
50045002
50055003static int wcd9335_power_on_reset (struct wcd9335_codec * wcd )
50065004{
5007- struct device * dev = wcd -> dev ;
5008- int ret ;
5009-
5010- ret = regulator_bulk_enable (WCD9335_MAX_SUPPLY , wcd -> supplies );
5011- if (ret ) {
5012- dev_err (dev , "Failed to get supplies: err = %d\n" , ret );
5013- return ret ;
5014- }
5015-
50165005 /*
50175006 * For WCD9335, it takes about 600us for the Vout_A and
50185007 * Vout_D to be ready after BUCK_SIDO is powered up.
0 commit comments