[#5580] GPIO pin not reserved for CTS function on SPORT-UART driver
Submitted By: Eduardo Tagle
Open Date
2009-09-29 12:01:49 Close Date
2009-09-30 00:02:49
Priority:
Medium Assignee:
Sonic Zhang
Status:
Closed Fixed In Release:
N/A
Found In Release:
2010R1 Release:
Category:
N/A Board:
N/A
Processor:
ALL Silicon Revision:
Is this bug repeatable?:
Yes Resolution:
Rejected
Uboot version or rev.:
Toolchain version or rev.:
GCC4.1.2
App binary format:
N/A
Summary: GPIO pin not reserved for CTS function on SPORT-UART driver
Details:
Is there a reason for not gpio_request()ing in sport_uart_probe() the CTS pin , and then gpio_free() it in sport_uart_remove() ? -- Just curious
Follow-ups
--- Sonic Zhang 2009-09-29 23:24:19
Because CTS PIN is implicitly reserved in request_irq when sport uart starts
up.
--- Mike Frysinger 2009-09-29 23:30:18
this doesnt make much sense ... if we use request_irq(), then we should use
free_irq() and not gpio_free()
doing a gpio_request() and request_irq() should work with the gpio framework
--- Sonic Zhang 2009-09-29 23:51:10
Yes. We do use free_irq() in bfin_sport_uart.c. See sport_shutdown().
--- Mike Frysinger 2009-09-30 00:02:49
you're mismatching things. the shutdown:free_irq() matches the
startup:request_irq() while the remove:gpio_free() matches the
probe:gpio_request(). both are matched -- there is no implicit handling and the
request_irq is irrelevant to the gpio_free.
--- Sonic Zhang 2009-09-30 02:47:02
I didn't mismatch things. See following lines in bfin_sport_uart.c
in sport_startup:
if (up->cts_pin >= 0) {
if (request_irq(gpio_to_irq(up->cts_pin),
in sport_shutdown:
if (up->cts_pin >= 0)
free_irq(gpio_to_irq(up->cts_pin), up);
in sport_uart_probe:
if (sport->rts_pin >= 0)
gpio_request(sport->rts_pin, DRV_NAME);
in sport_uart_remove:
if (sport->rts_pin >= 0)
gpio_free(sport->rts_pin);
CTS PIN is implicitly reserved and freed in request_irq and free_irq.
request_irq() -> request_threaded_irq() -> __setup_irq() ->
__irq_set_trigger() -> [chip->set_type()] -> bfin_gpio_irq_type() ->
bfin_gpio_irq_request() -> [che
reserved_gpio_map/reserved_peri_map/reserved_gpio_irq_map and set
reserved_gpio_irq_map]
free_irq() -> __free_irq -> [desc->chip->shutdown] ->
bfin_gpio_irq_shutdown -> bfin_gpio_irq_free() -> [clear
reserved_gpio_irq_map]
gpio_request() -> bfin_gpio_request() -> [check
reserved_gpio_map/reserved_peri_map/reserved_gpio_irq_map and set
reserved_gpio_map]
gpio_free() -> bfin_gpio_free() -> [clear reserved_gpio_map]
--- Mike Frysinger 2009-09-30 02:53:31
yes, you're right of course. thanks for clarifying.
Files
Changes
Commits
Dependencies
Duplicates
Associations
Tags
File Name File Type File Size Posted By
No Files Were Found