i2c-hid.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. #ifndef I2C_HID_H
  3. #define I2C_HID_H
  4. #include <linux/i2c.h>
  5. #ifdef CONFIG_DMI
  6. struct i2c_hid_desc *i2c_hid_get_dmi_i2c_hid_desc_override(uint8_t *i2c_name);
  7. char *i2c_hid_get_dmi_hid_report_desc_override(uint8_t *i2c_name,
  8. unsigned int *size);
  9. u32 i2c_hid_get_dmi_quirks(const u16 vendor, const u16 product);
  10. #else
  11. static inline struct i2c_hid_desc
  12. *i2c_hid_get_dmi_i2c_hid_desc_override(uint8_t *i2c_name)
  13. { return NULL; }
  14. static inline char *i2c_hid_get_dmi_hid_report_desc_override(uint8_t *i2c_name,
  15. unsigned int *size)
  16. { return NULL; }
  17. static inline u32 i2c_hid_get_dmi_quirks(const u16 vendor, const u16 product)
  18. { return 0; }
  19. #endif
  20. /**
  21. * struct i2chid_ops - Ops provided to the core.
  22. *
  23. * @power_up: do sequencing to power up the device.
  24. * @power_down: do sequencing to power down the device.
  25. * @shutdown_tail: called at the end of shutdown.
  26. */
  27. struct i2chid_ops {
  28. int (*power_up)(struct i2chid_ops *ops);
  29. void (*power_down)(struct i2chid_ops *ops);
  30. void (*shutdown_tail)(struct i2chid_ops *ops);
  31. };
  32. int i2c_hid_core_probe(struct i2c_client *client, struct i2chid_ops *ops,
  33. u16 hid_descriptor_address, u32 quirks);
  34. void i2c_hid_core_remove(struct i2c_client *client);
  35. void i2c_hid_core_shutdown(struct i2c_client *client);
  36. extern const struct dev_pm_ops i2c_hid_core_pm;
  37. #endif