int340x_thermal.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * ACPI support for int340x thermal drivers
  4. *
  5. * Copyright (C) 2014, Intel Corporation
  6. * Authors: Zhang Rui <[email protected]>
  7. */
  8. #include <linux/acpi.h>
  9. #include <linux/module.h>
  10. #include "../internal.h"
  11. #define INT3401_DEVICE 0X01
  12. static const struct acpi_device_id int340x_thermal_device_ids[] = {
  13. {"INT3400"},
  14. {"INT3401", INT3401_DEVICE},
  15. {"INT3402"},
  16. {"INT3403"},
  17. {"INT3404"},
  18. {"INT3406"},
  19. {"INT3407"},
  20. {"INT3408"},
  21. {"INT3409"},
  22. {"INT340A"},
  23. {"INT340B"},
  24. {"INT3532"},
  25. {"INTC1040"},
  26. {"INTC1041"},
  27. {"INTC1042"},
  28. {"INTC1043"},
  29. {"INTC1044"},
  30. {"INTC1045"},
  31. {"INTC1046"},
  32. {"INTC1047"},
  33. {"INTC1048"},
  34. {"INTC1049"},
  35. {"INTC1050"},
  36. {"INTC1060"},
  37. {"INTC1061"},
  38. {"INTC1062"},
  39. {"INTC1063"},
  40. {"INTC1064"},
  41. {"INTC1065"},
  42. {"INTC1066"},
  43. {"INTC10A0"},
  44. {"INTC10A1"},
  45. {"INTC10A2"},
  46. {"INTC10A3"},
  47. {"INTC10A4"},
  48. {"INTC10A5"},
  49. {""},
  50. };
  51. static int int340x_thermal_handler_attach(struct acpi_device *adev,
  52. const struct acpi_device_id *id)
  53. {
  54. if (IS_ENABLED(CONFIG_INT340X_THERMAL))
  55. acpi_create_platform_device(adev, NULL);
  56. /* Intel SoC DTS thermal driver needs INT3401 to set IRQ descriptor */
  57. else if (IS_ENABLED(CONFIG_INTEL_SOC_DTS_THERMAL) &&
  58. id->driver_data == INT3401_DEVICE)
  59. acpi_create_platform_device(adev, NULL);
  60. return 1;
  61. }
  62. static struct acpi_scan_handler int340x_thermal_handler = {
  63. .ids = int340x_thermal_device_ids,
  64. .attach = int340x_thermal_handler_attach,
  65. };
  66. void __init acpi_int340x_thermal_init(void)
  67. {
  68. acpi_scan_add_handler(&int340x_thermal_handler);
  69. }