@@ -332,7 +332,6 @@ struct wcd9335_codec {
332
332
333
333
int intr1 ;
334
334
struct gpio_desc * reset_gpio ;
335
- struct regulator_bulk_data supplies [WCD9335_MAX_SUPPLY ];
336
335
337
336
unsigned int rx_port_value [WCD9335_RX_MAX ];
338
337
unsigned int tx_port_value [WCD9335_TX_MAX ];
@@ -355,6 +354,10 @@ struct wcd9335_irq {
355
354
char * name ;
356
355
};
357
356
357
+ static const char * const wcd9335_supplies [] = {
358
+ "vdd-buck" , "vdd-buck-sido" , "vdd-tx" , "vdd-rx" , "vdd-io" ,
359
+ };
360
+
358
361
static const struct wcd9335_slim_ch wcd9335_tx_chs [WCD9335_TX_MAX ] = {
359
362
WCD9335_SLIM_TX_CH (0 ),
360
363
WCD9335_SLIM_TX_CH (1 ),
@@ -4989,30 +4992,16 @@ static int wcd9335_parse_dt(struct wcd9335_codec *wcd)
4989
4992
if (IS_ERR (wcd -> native_clk ))
4990
4993
return dev_err_probe (dev , PTR_ERR (wcd -> native_clk ), "slimbus clock not found\n" );
4991
4994
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 );
4999
4997
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" );
5001
4999
5002
5000
return 0 ;
5003
5001
}
5004
5002
5005
5003
static int wcd9335_power_on_reset (struct wcd9335_codec * wcd )
5006
5004
{
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
-
5016
5005
/*
5017
5006
* For WCD9335, it takes about 600us for the Vout_A and
5018
5007
* Vout_D to be ready after BUCK_SIDO is powered up.
0 commit comments