diff options
author | Brian Norris <briannorris@chromium.org> | 2017-02-10 05:03:57 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2017-03-06 15:48:44 +0300 |
commit | 572d3c6444979a6a49c6b464110563f578e8dece (patch) | |
tree | edfa44f72e6d60a0b4ca84705e39f6a3b8dd9812 /include/linux/i2c | |
parent | cb5cfd91a7ae5ae355e657e5ce4931836b7665eb (diff) | |
download | linux-572d3c6444979a6a49c6b464110563f578e8dece.tar.xz |
HID: i2c-hid: support regulator power on/off
On some boards, we need to enable a regulator before using the HID, and
it's also nice to save power in suspend by disabling it. Support an
optional "vdd-supply" and a companion initialization delay.
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: linux-input@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include/linux/i2c')
-rw-r--r-- | include/linux/i2c/i2c-hid.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/i2c/i2c-hid.h b/include/linux/i2c/i2c-hid.h index 7aa901d92058..1fb088239d12 100644 --- a/include/linux/i2c/i2c-hid.h +++ b/include/linux/i2c/i2c-hid.h @@ -14,9 +14,13 @@ #include <linux/types.h> +struct regulator; + /** * struct i2chid_platform_data - used by hid over i2c implementation. * @hid_descriptor_address: i2c register where the HID descriptor is stored. + * @supply: regulator for powering on the device. + * @post_power_delay_ms: delay after powering on before device is usable. * * Note that it is the responsibility of the platform driver (or the acpi 5.0 * driver, or the flattened device tree) to setup the irq related to the gpio in @@ -31,6 +35,8 @@ */ struct i2c_hid_platform_data { u16 hid_descriptor_address; + struct regulator *supply; + int post_power_delay_ms; }; #endif /* __LINUX_I2C_HID_H */ |