int340x_thermal.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 <rui.zhang@intel.com>
  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. {"INTC1068"},
  44. {"INTC1069"},
  45. {"INTC106A"},
  46. {"INTC106B"},
  47. {"INTC106C"},
  48. {"INTC106D"},
  49. {"INTC10A0"},
  50. {"INTC10A1"},
  51. {"INTC10A2"},
  52. {"INTC10A3"},
  53. {"INTC10A4"},
  54. {"INTC10A5"},
  55. {""},
  56. };
  57. static int int340x_thermal_handler_attach(struct acpi_device *adev,
  58. const struct acpi_device_id *id)
  59. {
  60. if (IS_ENABLED(CONFIG_INT340X_THERMAL))
  61. acpi_create_platform_device(adev, NULL);
  62. /* Intel SoC DTS thermal driver needs INT3401 to set IRQ descriptor */
  63. else if (IS_ENABLED(CONFIG_INTEL_SOC_DTS_THERMAL) &&
  64. id->driver_data == INT3401_DEVICE)
  65. acpi_create_platform_device(adev, NULL);
  66. return 1;
  67. }
  68. static struct acpi_scan_handler int340x_thermal_handler = {
  69. .ids = int340x_thermal_device_ids,
  70. .attach = int340x_thermal_handler_attach,
  71. };
  72. void __init acpi_int340x_thermal_init(void)
  73. {
  74. acpi_scan_add_handler(&int340x_thermal_handler);
  75. }