diff options
author | Adam Lee <adam.lee@canonical.com> | 2013-06-07 04:20:08 -0400 |
---|---|---|
committer | Matthew Garrett <matthew.garrett@nebula.com> | 2013-09-05 08:51:24 -0400 |
commit | fcb44e12d38a18f99d22ff66e739bb2f2ac762f0 (patch) | |
tree | efe9105ff47d890dc7d8a3081a52ca528189e8d4 /drivers/platform | |
parent | edf2d7780da5d96a168da7e31b36fb11620106d3 (diff) |
thinkpad_acpi: add the ability setting TPACPI_LED_NONE by quirk
Some new Lenovo or ThinkPad laptops don't have EC controllable LEDs,
their LED quirks are 0. This patch set led_supported=TPACPI_LED_NONE
when quirk equals 0.
Signed-off-by: Adam Lee <adam.lee@canonical.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 359c87b3b1b2..03ca6c139f1a 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -5296,6 +5296,16 @@ static int __init led_init(struct ibm_init_struct *iibm) | |||
5296 | 5296 | ||
5297 | led_supported = led_init_detect_mode(); | 5297 | led_supported = led_init_detect_mode(); |
5298 | 5298 | ||
5299 | if (led_supported != TPACPI_LED_NONE) { | ||
5300 | useful_leds = tpacpi_check_quirks(led_useful_qtable, | ||
5301 | ARRAY_SIZE(led_useful_qtable)); | ||
5302 | |||
5303 | if (!useful_leds) { | ||
5304 | led_handle = NULL; | ||
5305 | led_supported = TPACPI_LED_NONE; | ||
5306 | } | ||
5307 | } | ||
5308 | |||
5299 | vdbg_printk(TPACPI_DBG_INIT, "LED commands are %s, mode %d\n", | 5309 | vdbg_printk(TPACPI_DBG_INIT, "LED commands are %s, mode %d\n", |
5300 | str_supported(led_supported), led_supported); | 5310 | str_supported(led_supported), led_supported); |
5301 | 5311 | ||
@@ -5309,9 +5319,6 @@ static int __init led_init(struct ibm_init_struct *iibm) | |||
5309 | return -ENOMEM; | 5319 | return -ENOMEM; |
5310 | } | 5320 | } |
5311 | 5321 | ||
5312 | useful_leds = tpacpi_check_quirks(led_useful_qtable, | ||
5313 | ARRAY_SIZE(led_useful_qtable)); | ||
5314 | |||
5315 | for (i = 0; i < TPACPI_LED_NUMLEDS; i++) { | 5322 | for (i = 0; i < TPACPI_LED_NUMLEDS; i++) { |
5316 | tpacpi_leds[i].led = -1; | 5323 | tpacpi_leds[i].led = -1; |
5317 | 5324 | ||