@@ -26,6 +26,7 @@ struct i2c_hid_of_goodix {
26
26
struct i2chid_ops ops ;
27
27
28
28
struct regulator * vdd ;
29
+ struct regulator * vddio ;
29
30
struct gpio_desc * reset_gpio ;
30
31
const struct goodix_i2c_hid_timing_data * timings ;
31
32
};
@@ -40,6 +41,10 @@ static int goodix_i2c_hid_power_up(struct i2chid_ops *ops)
40
41
if (ret )
41
42
return ret ;
42
43
44
+ ret = regulator_enable (ihid_goodix -> vddio );
45
+ if (ret )
46
+ return ret ;
47
+
43
48
if (ihid_goodix -> timings -> post_power_delay_ms )
44
49
msleep (ihid_goodix -> timings -> post_power_delay_ms );
45
50
@@ -56,6 +61,7 @@ static void goodix_i2c_hid_power_down(struct i2chid_ops *ops)
56
61
container_of (ops , struct i2c_hid_of_goodix , ops );
57
62
58
63
gpiod_set_value_cansleep (ihid_goodix -> reset_gpio , 1 );
64
+ regulator_disable (ihid_goodix -> vddio );
59
65
regulator_disable (ihid_goodix -> vdd );
60
66
}
61
67
@@ -81,6 +87,10 @@ static int i2c_hid_of_goodix_probe(struct i2c_client *client)
81
87
if (IS_ERR (ihid_goodix -> vdd ))
82
88
return PTR_ERR (ihid_goodix -> vdd );
83
89
90
+ ihid_goodix -> vddio = devm_regulator_get (& client -> dev , "mainboard-vddio" );
91
+ if (IS_ERR (ihid_goodix -> vddio ))
92
+ return PTR_ERR (ihid_goodix -> vddio );
93
+
84
94
ihid_goodix -> timings = device_get_match_data (& client -> dev );
85
95
86
96
return i2c_hid_core_probe (client , & ihid_goodix -> ops , 0x0001 , 0 );
0 commit comments