blob: 05a7827d211af0514ce97d30d473c70d0af45e7e [file] [log] [blame]
Julian Sax9ee3e062018-09-19 11:46:23 +02001/* SPDX-License-Identifier: GPL-2.0+ */
2
3#ifndef I2C_HID_H
4#define I2C_HID_H
5
Douglas Andersonb33752c2021-01-15 09:06:37 -08006#include <linux/i2c.h>
Julian Sax9ee3e062018-09-19 11:46:23 +02007
8#ifdef CONFIG_DMI
9struct i2c_hid_desc *i2c_hid_get_dmi_i2c_hid_desc_override(uint8_t *i2c_name);
10char *i2c_hid_get_dmi_hid_report_desc_override(uint8_t *i2c_name,
11 unsigned int *size);
12#else
13static inline struct i2c_hid_desc
14 *i2c_hid_get_dmi_i2c_hid_desc_override(uint8_t *i2c_name)
15{ return NULL; }
16static inline char *i2c_hid_get_dmi_hid_report_desc_override(uint8_t *i2c_name,
17 unsigned int *size)
18{ return NULL; }
19#endif
20
Douglas Andersonb33752c2021-01-15 09:06:37 -080021/**
22 * struct i2chid_ops - Ops provided to the core.
23 *
24 * @power_up: do sequencing to power up the device.
25 * @power_down: do sequencing to power down the device.
26 * @shutdown_tail: called at the end of shutdown.
27 */
28struct i2chid_ops {
29 int (*power_up)(struct i2chid_ops *ops);
30 void (*power_down)(struct i2chid_ops *ops);
31 void (*shutdown_tail)(struct i2chid_ops *ops);
32};
33
34int i2c_hid_core_probe(struct i2c_client *client, struct i2chid_ops *ops,
35 u16 hid_descriptor_address);
36int i2c_hid_core_remove(struct i2c_client *client);
37
38void i2c_hid_core_shutdown(struct i2c_client *client);
39
40extern const struct dev_pm_ops i2c_hid_core_pm;
41
Julian Sax9ee3e062018-09-19 11:46:23 +020042#endif