@@ -43,6 +43,8 @@ struct lt8912 {
43
43
44
44
struct videomode mode ;
45
45
46
+ struct regulator_bulk_data supplies [7 ];
47
+
46
48
u8 data_lanes ;
47
49
bool is_power_on ;
48
50
};
@@ -257,6 +259,12 @@ static int lt8912_free_i2c(struct lt8912 *lt)
257
259
258
260
static int lt8912_hard_power_on (struct lt8912 * lt )
259
261
{
262
+ int ret ;
263
+
264
+ ret = regulator_bulk_enable (ARRAY_SIZE (lt -> supplies ), lt -> supplies );
265
+ if (ret )
266
+ return ret ;
267
+
260
268
gpiod_set_value_cansleep (lt -> gp_reset , 0 );
261
269
msleep (20 );
262
270
@@ -267,6 +275,9 @@ static void lt8912_hard_power_off(struct lt8912 *lt)
267
275
{
268
276
gpiod_set_value_cansleep (lt -> gp_reset , 1 );
269
277
msleep (20 );
278
+
279
+ regulator_bulk_disable (ARRAY_SIZE (lt -> supplies ), lt -> supplies );
280
+
270
281
lt -> is_power_on = false;
271
282
}
272
283
@@ -661,6 +672,21 @@ static int lt8912_bridge_suspend(struct device *dev)
661
672
662
673
static DEFINE_SIMPLE_DEV_PM_OPS (lt8912_bridge_pm_ops , lt8912_bridge_suspend , lt8912_bridge_resume ) ;
663
674
675
+ static int lt8912_get_regulators (struct lt8912 * lt )
676
+ {
677
+ unsigned int i ;
678
+ const char * const supply_names [] = {
679
+ "vdd" , "vccmipirx" , "vccsysclk" , "vcclvdstx" ,
680
+ "vcchdmitx" , "vcclvdspll" , "vcchdmipll"
681
+ };
682
+
683
+ for (i = 0 ; i < ARRAY_SIZE (lt -> supplies ); i ++ )
684
+ lt -> supplies [i ].supply = supply_names [i ];
685
+
686
+ return devm_regulator_bulk_get (lt -> dev , ARRAY_SIZE (lt -> supplies ),
687
+ lt -> supplies );
688
+ }
689
+
664
690
static int lt8912_parse_dt (struct lt8912 * lt )
665
691
{
666
692
struct gpio_desc * gp_reset ;
@@ -712,6 +738,10 @@ static int lt8912_parse_dt(struct lt8912 *lt)
712
738
goto err_free_host_node ;
713
739
}
714
740
741
+ ret = lt8912_get_regulators (lt );
742
+ if (ret )
743
+ goto err_free_host_node ;
744
+
715
745
of_node_put (port_node );
716
746
return 0 ;
717
747
0 commit comments