diff options
author | Ben Gardiner <bengardiner@nanometrics.ca> | 2010-12-09 16:51:05 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-12-22 14:45:19 -0500 |
commit | 53c2897d36153830d4d34324bedf23a641602cc9 (patch) | |
tree | 9af715146eae006984dd279dbbdf273a3874371a /arch/arm/mach-davinci | |
parent | 75929f5e2bcba7cc328fcf9a3d7ba7076946ac3a (diff) |
da850-evm: extract defines for SEL{A,B,C} pins in UI expander
The setup and teardown methods of the UI expander reference the SEL_{A,B,C}
pins by 'magic number' in each function. This uses the common enum for their offsets
in the expander setup and teardown functions.
Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Reviewed-by: Chris Cordahi <christophercordahi@nanometrics.ca>
Reviewed-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
CC: Victor Rodriguez <vm.rod25@gmail.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci')
-rw-r--r-- | arch/arm/mach-davinci/board-da850-evm.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 93bd43e93c45..f9969dead63b 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c | |||
@@ -360,23 +360,23 @@ static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio, | |||
360 | { | 360 | { |
361 | int sel_a, sel_b, sel_c, ret; | 361 | int sel_a, sel_b, sel_c, ret; |
362 | 362 | ||
363 | sel_a = gpio + 7; | 363 | sel_a = gpio + DA850_EVM_UI_EXP_SEL_A; |
364 | sel_b = gpio + 6; | 364 | sel_b = gpio + DA850_EVM_UI_EXP_SEL_B; |
365 | sel_c = gpio + 5; | 365 | sel_c = gpio + DA850_EVM_UI_EXP_SEL_C; |
366 | 366 | ||
367 | ret = gpio_request(sel_a, "sel_a"); | 367 | ret = gpio_request(sel_a, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_A]); |
368 | if (ret) { | 368 | if (ret) { |
369 | pr_warning("Cannot open UI expander pin %d\n", sel_a); | 369 | pr_warning("Cannot open UI expander pin %d\n", sel_a); |
370 | goto exp_setup_sela_fail; | 370 | goto exp_setup_sela_fail; |
371 | } | 371 | } |
372 | 372 | ||
373 | ret = gpio_request(sel_b, "sel_b"); | 373 | ret = gpio_request(sel_b, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_B]); |
374 | if (ret) { | 374 | if (ret) { |
375 | pr_warning("Cannot open UI expander pin %d\n", sel_b); | 375 | pr_warning("Cannot open UI expander pin %d\n", sel_b); |
376 | goto exp_setup_selb_fail; | 376 | goto exp_setup_selb_fail; |
377 | } | 377 | } |
378 | 378 | ||
379 | ret = gpio_request(sel_c, "sel_c"); | 379 | ret = gpio_request(sel_c, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_C]); |
380 | if (ret) { | 380 | if (ret) { |
381 | pr_warning("Cannot open UI expander pin %d\n", sel_c); | 381 | pr_warning("Cannot open UI expander pin %d\n", sel_c); |
382 | goto exp_setup_selc_fail; | 382 | goto exp_setup_selc_fail; |
@@ -419,13 +419,13 @@ static int da850_evm_ui_expander_teardown(struct i2c_client *client, | |||
419 | platform_device_unregister(&da850_evm_ui_keys_device); | 419 | platform_device_unregister(&da850_evm_ui_keys_device); |
420 | 420 | ||
421 | /* deselect all functionalities */ | 421 | /* deselect all functionalities */ |
422 | gpio_set_value_cansleep(gpio + 5, 1); | 422 | gpio_set_value_cansleep(gpio + DA850_EVM_UI_EXP_SEL_C, 1); |
423 | gpio_set_value_cansleep(gpio + 6, 1); | 423 | gpio_set_value_cansleep(gpio + DA850_EVM_UI_EXP_SEL_B, 1); |
424 | gpio_set_value_cansleep(gpio + 7, 1); | 424 | gpio_set_value_cansleep(gpio + DA850_EVM_UI_EXP_SEL_A, 1); |
425 | 425 | ||
426 | gpio_free(gpio + 5); | 426 | gpio_free(gpio + DA850_EVM_UI_EXP_SEL_C); |
427 | gpio_free(gpio + 6); | 427 | gpio_free(gpio + DA850_EVM_UI_EXP_SEL_B); |
428 | gpio_free(gpio + 7); | 428 | gpio_free(gpio + DA850_EVM_UI_EXP_SEL_A); |
429 | 429 | ||
430 | return 0; | 430 | return 0; |
431 | } | 431 | } |