Skip to content

Commit eb16f59

Browse files
diandersbentiss
authored andcommitted
HID: i2c-hid: goodix: Add mainboard-vddio-supply
As talked about in the patch ("dt-bindings: HID: i2c-hid: goodix: Add mainboard-vddio-supply") we may need to power up a 1.8V rail on the host associated with touchscreen IO. Let's add support in the driver for it. Signed-off-by: Douglas Anderson <[email protected]> Reviewed-by: Dmitry Torokhov <[email protected]> Reviewed-by: Matthias Kaehlcke <[email protected]> Link: https://lore.kernel.org/r/20230206184744.6.Ic234b931025d1f920ce9e06fff294643943a65ad@changeid Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent 1d18c1f commit eb16f59

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/hid/i2c-hid/i2c-hid-of-goodix.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ struct i2c_hid_of_goodix {
2626
struct i2chid_ops ops;
2727

2828
struct regulator *vdd;
29+
struct regulator *vddio;
2930
struct gpio_desc *reset_gpio;
3031
const struct goodix_i2c_hid_timing_data *timings;
3132
};
@@ -40,6 +41,10 @@ static int goodix_i2c_hid_power_up(struct i2chid_ops *ops)
4041
if (ret)
4142
return ret;
4243

44+
ret = regulator_enable(ihid_goodix->vddio);
45+
if (ret)
46+
return ret;
47+
4348
if (ihid_goodix->timings->post_power_delay_ms)
4449
msleep(ihid_goodix->timings->post_power_delay_ms);
4550

@@ -56,6 +61,7 @@ static void goodix_i2c_hid_power_down(struct i2chid_ops *ops)
5661
container_of(ops, struct i2c_hid_of_goodix, ops);
5762

5863
gpiod_set_value_cansleep(ihid_goodix->reset_gpio, 1);
64+
regulator_disable(ihid_goodix->vddio);
5965
regulator_disable(ihid_goodix->vdd);
6066
}
6167

@@ -81,6 +87,10 @@ static int i2c_hid_of_goodix_probe(struct i2c_client *client)
8187
if (IS_ERR(ihid_goodix->vdd))
8288
return PTR_ERR(ihid_goodix->vdd);
8389

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+
8494
ihid_goodix->timings = device_get_match_data(&client->dev);
8595

8696
return i2c_hid_core_probe(client, &ihid_goodix->ops, 0x0001, 0);

0 commit comments

Comments
 (0)