diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2010-05-16 18:45:50 -0400 |
---|---|---|
committer | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2010-05-16 18:45:50 -0400 |
commit | 2cbb5c8f5533facb606adc5986ce40da2e987d6d (patch) | |
tree | 69df71f525eff63af96f44e244f299b53d63c060 /drivers/platform | |
parent | 72f19921217c2267adc65cbe69c63da970578a14 (diff) |
thinkpad-acpi: don't depend on led_path for led firmware type (v2)
Don't depend on the contents of led_path to know which LED interface
the firmware wants.
This removes the only user of *_path for the thinkpad-acpi ACPI
handlers, which will simplify future code.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index a39f159d4f2f..29ad27346443 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -5009,11 +5009,7 @@ enum { /* For TPACPI_LED_OLD */ | |||
5009 | 5009 | ||
5010 | static enum led_access_mode led_supported; | 5010 | static enum led_access_mode led_supported; |
5011 | 5011 | ||
5012 | TPACPI_HANDLE(led, ec, "SLED", /* 570 */ | 5012 | static acpi_handle led_handle; |
5013 | "SYSL", /* 600e/x, 770e, 770x, A21e, A2xm/p, */ | ||
5014 | /* T20-22, X20-21 */ | ||
5015 | "LED", /* all others */ | ||
5016 | ); /* R30, R31 */ | ||
5017 | 5013 | ||
5018 | #define TPACPI_LED_NUMLEDS 16 | 5014 | #define TPACPI_LED_NUMLEDS 16 |
5019 | static struct tpacpi_led_classdev *tpacpi_leds; | 5015 | static struct tpacpi_led_classdev *tpacpi_leds; |
@@ -5273,6 +5269,32 @@ static const struct tpacpi_quirk led_useful_qtable[] __initconst = { | |||
5273 | #undef TPACPI_LEDQ_IBM | 5269 | #undef TPACPI_LEDQ_IBM |
5274 | #undef TPACPI_LEDQ_LNV | 5270 | #undef TPACPI_LEDQ_LNV |
5275 | 5271 | ||
5272 | static enum led_access_mode __init led_init_detect_mode(void) | ||
5273 | { | ||
5274 | acpi_status status; | ||
5275 | |||
5276 | if (tpacpi_is_ibm()) { | ||
5277 | /* 570 */ | ||
5278 | status = acpi_get_handle(ec_handle, "SLED", &led_handle); | ||
5279 | if (ACPI_SUCCESS(status)) | ||
5280 | return TPACPI_LED_570; | ||
5281 | |||
5282 | /* 600e/x, 770e, 770x, A21e, A2xm/p, T20-22, X20-21 */ | ||
5283 | status = acpi_get_handle(ec_handle, "SYSL", &led_handle); | ||
5284 | if (ACPI_SUCCESS(status)) | ||
5285 | return TPACPI_LED_OLD; | ||
5286 | } | ||
5287 | |||
5288 | /* most others */ | ||
5289 | status = acpi_get_handle(ec_handle, "LED", &led_handle); | ||
5290 | if (ACPI_SUCCESS(status)) | ||
5291 | return TPACPI_LED_NEW; | ||
5292 | |||
5293 | /* R30, R31, and unknown firmwares */ | ||
5294 | led_handle = NULL; | ||
5295 | return TPACPI_LED_NONE; | ||
5296 | } | ||
5297 | |||
5276 | static int __init led_init(struct ibm_init_struct *iibm) | 5298 | static int __init led_init(struct ibm_init_struct *iibm) |
5277 | { | 5299 | { |
5278 | unsigned int i; | 5300 | unsigned int i; |
@@ -5281,20 +5303,7 @@ static int __init led_init(struct ibm_init_struct *iibm) | |||
5281 | 5303 | ||
5282 | vdbg_printk(TPACPI_DBG_INIT, "initializing LED subdriver\n"); | 5304 | vdbg_printk(TPACPI_DBG_INIT, "initializing LED subdriver\n"); |
5283 | 5305 | ||
5284 | TPACPI_ACPIHANDLE_INIT(led); | 5306 | led_supported = led_init_detect_mode(); |
5285 | |||
5286 | if (!led_handle) | ||
5287 | /* led not supported on R30, R31 */ | ||
5288 | led_supported = TPACPI_LED_NONE; | ||
5289 | else if (tpacpi_is_ibm() && strlencmp(led_path, "SLED") == 0) | ||
5290 | /* 570 */ | ||
5291 | led_supported = TPACPI_LED_570; | ||
5292 | else if (tpacpi_is_ibm() && strlencmp(led_path, "SYSL") == 0) | ||
5293 | /* 600e/x, 770e, 770x, A21e, A2xm/p, T20-22, X20-21 */ | ||
5294 | led_supported = TPACPI_LED_OLD; | ||
5295 | else | ||
5296 | /* all others */ | ||
5297 | led_supported = TPACPI_LED_NEW; | ||
5298 | 5307 | ||
5299 | vdbg_printk(TPACPI_DBG_INIT, "LED commands are %s, mode %d\n", | 5308 | vdbg_printk(TPACPI_DBG_INIT, "LED commands are %s, mode %d\n", |
5300 | str_supported(led_supported), led_supported); | 5309 | str_supported(led_supported), led_supported); |