diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2012-05-10 00:08:03 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2012-05-10 00:13:11 +0200 |
commit | 645680d62b82455d24fcb178f1cc5208f9942e38 (patch) | |
tree | 1a9f928afc34260059bf986fc2caa7fc5b2a2028 /firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c | |
parent | d29a11b7a8f4ce230e9385a44f352a559bde753f (diff) | |
download | rockbox-645680d62b82455d24fcb178f1cc5208f9942e38.tar.gz rockbox-645680d62b82455d24fcb178f1cc5208f9942e38.zip |
imx233: add pinctrl debug code to track pin uses
Past development has proved that one can mistakely use
the same pin for two uses without noticing. Since this
causes extremely hard to find bugs, the infrastructure
will allow to register pin uses and panic when a conflict
is detected. The pinctrl debug now shows the pin uses
when its support is compiled in.
Change-Id: Idb2d5235ce09207d77aa474d6f158e72b933761a
Diffstat (limited to 'firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c')
-rw-r--r-- | firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c index 26e5a0a102..86bb00f4a5 100644 --- a/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c +++ b/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c | |||
@@ -301,7 +301,8 @@ void button_init_device(void) | |||
301 | * The B0P26 line seems to be related to the touchpad | 301 | * The B0P26 line seems to be related to the touchpad |
302 | */ | 302 | */ |
303 | 303 | ||
304 | /* touchpad CE ? */ | 304 | /* touchpad power */ |
305 | imx233_pinctrl_acquire_pin(0, 26, "touchpad power"); | ||
305 | imx233_set_pin_function(0, 26, PINCTRL_FUNCTION_GPIO); | 306 | imx233_set_pin_function(0, 26, PINCTRL_FUNCTION_GPIO); |
306 | imx233_enable_gpio_output(0, 26, false); | 307 | imx233_enable_gpio_output(0, 26, false); |
307 | imx233_set_pin_drive_strength(0, 26, PINCTRL_DRIVE_8mA); | 308 | imx233_set_pin_drive_strength(0, 26, PINCTRL_DRIVE_8mA); |
@@ -324,10 +325,12 @@ void button_init_device(void) | |||
324 | create_thread(rmi_thread, rmi_stack, sizeof(rmi_stack), 0, | 325 | create_thread(rmi_thread, rmi_stack, sizeof(rmi_stack), 0, |
325 | rmi_thread_name IF_PRIO(, PRIORITY_USER_INTERFACE) IF_COP(, CPU)); | 326 | rmi_thread_name IF_PRIO(, PRIORITY_USER_INTERFACE) IF_COP(, CPU)); |
326 | /* enable interrupt */ | 327 | /* enable interrupt */ |
328 | imx233_pinctrl_acquire_pin(0, 27, "touchpad int"); | ||
327 | imx233_set_pin_function(0, 27, PINCTRL_FUNCTION_GPIO); | 329 | imx233_set_pin_function(0, 27, PINCTRL_FUNCTION_GPIO); |
328 | imx233_enable_gpio_output(0, 27, false); | 330 | imx233_enable_gpio_output(0, 27, false); |
329 | imx233_setup_pin_irq(0, 27, true, true, false, &rmi_attn_cb); | 331 | imx233_setup_pin_irq(0, 27, true, true, false, &rmi_attn_cb); |
330 | /* Volume down */ | 332 | /* Volume down */ |
333 | imx233_pinctrl_acquire_pin(1, 30, "volume down"); | ||
331 | imx233_set_pin_function(1, 30, PINCTRL_FUNCTION_GPIO); | 334 | imx233_set_pin_function(1, 30, PINCTRL_FUNCTION_GPIO); |
332 | imx233_enable_gpio_output(1, 30, false); | 335 | imx233_enable_gpio_output(1, 30, false); |
333 | } | 336 | } |
@@ -336,6 +339,10 @@ void button_init_device(void) | |||
336 | 339 | ||
337 | void button_init_device(void) | 340 | void button_init_device(void) |
338 | { | 341 | { |
342 | /* Volume down */ | ||
343 | imx233_pinctrl_acquire_pin(1, 30, "volume down"); | ||
344 | imx233_set_pin_function(1, 30, PINCTRL_FUNCTION_GPIO); | ||
345 | imx233_enable_gpio_output(1, 30, false); | ||
339 | } | 346 | } |
340 | 347 | ||
341 | int touchpad_read_device(void) | 348 | int touchpad_read_device(void) |