diff options
author | Jouke Witteveen <j.witteveen@gmail.com> | 2018-12-05 06:17:52 -0500 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2018-12-10 04:31:00 -0500 |
commit | 599eefffcf6b9cff3e8cc2d96fd8eebfadab339c (patch) | |
tree | 9b3a8dafea87468849c202187bcbe5319c5514ff /drivers/platform/x86/thinkpad_acpi.c | |
parent | f25b6302b294c220d5be010342f6399d89dcabf3 (diff) |
platform/x86: thinkpad_acpi: Cleanup quirks macros
- Use generic quirks macros for fan quirks
The fan-specific quirks macros were duplicates of the generic ones.
- Remove useless #undef lines
The referenced macros are not defined anywhere.
Signed-off-by: Jouke Witteveen <j.witteveen@gmail.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86/thinkpad_acpi.c')
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 45 |
1 files changed, 13 insertions, 32 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index a86cf47292e9..f5773cdfdebc 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -478,6 +478,12 @@ do { \ | |||
478 | .ec = TPACPI_MATCH_ANY, \ | 478 | .ec = TPACPI_MATCH_ANY, \ |
479 | .quirks = (__quirk) } | 479 | .quirks = (__quirk) } |
480 | 480 | ||
481 | #define TPACPI_QEC_IBM(__id1, __id2, __quirk) \ | ||
482 | { .vendor = PCI_VENDOR_ID_IBM, \ | ||
483 | .bios = TPACPI_MATCH_ANY, \ | ||
484 | .ec = TPID(__id1, __id2), \ | ||
485 | .quirks = (__quirk) } | ||
486 | |||
481 | #define TPACPI_QEC_LNV(__id1, __id2, __quirk) \ | 487 | #define TPACPI_QEC_LNV(__id1, __id2, __quirk) \ |
482 | { .vendor = PCI_VENDOR_ID_LENOVO, \ | 488 | { .vendor = PCI_VENDOR_ID_LENOVO, \ |
483 | .bios = TPACPI_MATCH_ANY, \ | 489 | .bios = TPACPI_MATCH_ANY, \ |
@@ -5973,9 +5979,6 @@ static const struct tpacpi_quirk led_useful_qtable[] __initconst = { | |||
5973 | }, | 5979 | }, |
5974 | }; | 5980 | }; |
5975 | 5981 | ||
5976 | #undef TPACPI_LEDQ_IBM | ||
5977 | #undef TPACPI_LEDQ_LNV | ||
5978 | |||
5979 | static enum led_access_mode __init led_init_detect_mode(void) | 5982 | static enum led_access_mode __init led_init_detect_mode(void) |
5980 | { | 5983 | { |
5981 | acpi_status status; | 5984 | acpi_status status; |
@@ -8710,40 +8713,18 @@ static const struct attribute_group fan_attr_group = { | |||
8710 | .attrs = fan_attributes, | 8713 | .attrs = fan_attributes, |
8711 | }; | 8714 | }; |
8712 | 8715 | ||
8713 | #define TPACPI_FAN_Q1 0x0001 /* Unitialized HFSP */ | 8716 | #define TPACPI_FAN_Q1 0x0001 /* Unitialized HFSP */ |
8714 | #define TPACPI_FAN_2FAN 0x0002 /* EC 0x31 bit 0 selects fan2 */ | 8717 | #define TPACPI_FAN_2FAN 0x0002 /* EC 0x31 bit 0 selects fan2 */ |
8715 | 8718 | ||
8716 | #define TPACPI_FAN_QI(__id1, __id2, __quirks) \ | ||
8717 | { .vendor = PCI_VENDOR_ID_IBM, \ | ||
8718 | .bios = TPACPI_MATCH_ANY, \ | ||
8719 | .ec = TPID(__id1, __id2), \ | ||
8720 | .quirks = __quirks } | ||
8721 | |||
8722 | #define TPACPI_FAN_QL(__id1, __id2, __quirks) \ | ||
8723 | { .vendor = PCI_VENDOR_ID_LENOVO, \ | ||
8724 | .bios = TPACPI_MATCH_ANY, \ | ||
8725 | .ec = TPID(__id1, __id2), \ | ||
8726 | .quirks = __quirks } | ||
8727 | |||
8728 | #define TPACPI_FAN_QB(__id1, __id2, __quirks) \ | ||
8729 | { .vendor = PCI_VENDOR_ID_LENOVO, \ | ||
8730 | .bios = TPID(__id1, __id2), \ | ||
8731 | .ec = TPACPI_MATCH_ANY, \ | ||
8732 | .quirks = __quirks } | ||
8733 | |||
8734 | static const struct tpacpi_quirk fan_quirk_table[] __initconst = { | 8719 | static const struct tpacpi_quirk fan_quirk_table[] __initconst = { |
8735 | TPACPI_FAN_QI('1', 'Y', TPACPI_FAN_Q1), | 8720 | TPACPI_QEC_IBM('1', 'Y', TPACPI_FAN_Q1), |
8736 | TPACPI_FAN_QI('7', '8', TPACPI_FAN_Q1), | 8721 | TPACPI_QEC_IBM('7', '8', TPACPI_FAN_Q1), |
8737 | TPACPI_FAN_QI('7', '6', TPACPI_FAN_Q1), | 8722 | TPACPI_QEC_IBM('7', '6', TPACPI_FAN_Q1), |
8738 | TPACPI_FAN_QI('7', '0', TPACPI_FAN_Q1), | 8723 | TPACPI_QEC_IBM('7', '0', TPACPI_FAN_Q1), |
8739 | TPACPI_FAN_QL('7', 'M', TPACPI_FAN_2FAN), | 8724 | TPACPI_QEC_LNV('7', 'M', TPACPI_FAN_2FAN), |
8740 | TPACPI_FAN_QB('N', '1', TPACPI_FAN_2FAN), | 8725 | TPACPI_Q_LNV('N', '1', TPACPI_FAN_2FAN), |
8741 | }; | 8726 | }; |
8742 | 8727 | ||
8743 | #undef TPACPI_FAN_QL | ||
8744 | #undef TPACPI_FAN_QI | ||
8745 | #undef TPACPI_FAN_QB | ||
8746 | |||
8747 | static int __init fan_init(struct ibm_init_struct *iibm) | 8728 | static int __init fan_init(struct ibm_init_struct *iibm) |
8748 | { | 8729 | { |
8749 | int rc; | 8730 | int rc; |