0008-surface-sensors.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From d5cf2024ec3ac0682d5bea659cab215c5ac7626b Mon Sep 17 00:00:00 2001
  2. From: Max Leiter <maxwell.leiter@gmail.com>
  3. Date: Sat, 19 Dec 2020 17:50:55 -0800
  4. Subject: [PATCH] iio:light:apds9960 add detection for MSHW0184 ACPI device in
  5. apds9960 driver
  6. The device is used in the Microsoft Surface Book 3 and Surface Pro 7
  7. Signed-off-by: Max Leiter <maxwell.leiter@gmail.com>
  8. Reviewed-by: Matt Ranostay <matt.ranostay@konsulko.com>
  9. Link: https://lore.kernel.org/r/20201220015057.107246-1-maxwell.leiter@gmail.com
  10. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  11. Patchset: surface-sensors
  12. ---
  13. drivers/iio/light/apds9960.c | 8 ++++++++
  14. 1 file changed, 8 insertions(+)
  15. diff --git a/drivers/iio/light/apds9960.c b/drivers/iio/light/apds9960.c
  16. index 547e7f9d6920..df0647856e5d 100644
  17. --- a/drivers/iio/light/apds9960.c
  18. +++ b/drivers/iio/light/apds9960.c
  19. @@ -8,6 +8,7 @@
  20. * TODO: gesture + proximity calib offsets
  21. */
  22. +#include <linux/acpi.h>
  23. #include <linux/module.h>
  24. #include <linux/init.h>
  25. #include <linux/interrupt.h>
  26. @@ -1113,6 +1114,12 @@ static const struct i2c_device_id apds9960_id[] = {
  27. };
  28. MODULE_DEVICE_TABLE(i2c, apds9960_id);
  29. +static const struct acpi_device_id apds9960_acpi_match[] = {
  30. + { "MSHW0184" },
  31. + { }
  32. +};
  33. +MODULE_DEVICE_TABLE(acpi, apds9960_acpi_match);
  34. +
  35. static const struct of_device_id apds9960_of_match[] = {
  36. { .compatible = "avago,apds9960" },
  37. { }
  38. @@ -1124,6 +1131,7 @@ static struct i2c_driver apds9960_driver = {
  39. .name = APDS9960_DRV_NAME,
  40. .of_match_table = apds9960_of_match,
  41. .pm = &apds9960_pm_ops,
  42. + .acpi_match_table = apds9960_acpi_match,
  43. },
  44. .probe = apds9960_probe,
  45. .remove = apds9960_remove,
  46. --
  47. 2.31.0