diff options
author | Michael Hennerich <michael.hennerich@analog.com> | 2007-10-10 22:57:54 -0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2007-10-10 22:57:54 -0400 |
commit | b99ab54d4f11141b2ef3e50c3543b7243d3f49fb (patch) | |
tree | 941eeec217757b2e25019dd78d75c7dae89c1e4a /include/asm-blackfin | |
parent | 8c61362377970cd35cc37960b5cbed03cecd57e7 (diff) |
Blackfin serial driver: use new GPIO API
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'include/asm-blackfin')
-rw-r--r-- | include/asm-blackfin/mach-bf548/bfin_serial_5xx.h | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h index 2f4afc90db11..f21a1620e6bd 100644 --- a/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h +++ b/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/serial.h> | 1 | #include <linux/serial.h> |
2 | #include <asm/dma.h> | 2 | #include <asm/dma.h> |
3 | #include <asm/portmux.h> | ||
3 | 4 | ||
4 | #define NR_PORTS 4 | 5 | #define NR_PORTS 4 |
5 | 6 | ||
@@ -143,50 +144,48 @@ struct bfin_serial_res bfin_serial_resource[] = { | |||
143 | 144 | ||
144 | int nr_ports = ARRAY_SIZE(bfin_serial_resource); | 145 | int nr_ports = ARRAY_SIZE(bfin_serial_resource); |
145 | 146 | ||
147 | #define DRIVER_NAME "bfin-uart" | ||
148 | |||
146 | static void bfin_serial_hw_init(struct bfin_serial_port *uart) | 149 | static void bfin_serial_hw_init(struct bfin_serial_port *uart) |
147 | { | 150 | { |
148 | #ifdef CONFIG_SERIAL_BFIN_UART0 | 151 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
149 | /* Enable UART0 RX and TX on pin 7 & 8 of PORT E */ | 152 | peripheral_request(P_UART0_TX, DRIVER_NAME); |
150 | bfin_write_PORTE_FER(0x180 | bfin_read_PORTE_FER()); | 153 | peripheral_request(P_UART0_RX, DRIVER_NAME); |
151 | bfin_write_PORTE_MUX(0x3C000 | bfin_read_PORTE_MUX()); | ||
152 | #endif | 154 | #endif |
153 | 155 | ||
154 | #ifdef CONFIG_SERIAL_BFIN_UART1 | 156 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
155 | /* Enable UART1 RX and TX on pin 0 & 1 of PORT H */ | 157 | peripheral_request(P_UART1_TX, DRIVER_NAME); |
156 | bfin_write_PORTH_FER(0x3 | bfin_read_PORTH_FER()); | 158 | peripheral_request(P_UART1_RX, DRIVER_NAME); |
157 | bfin_write_PORTH_MUX(~0xF & bfin_read_PORTH_MUX()); | 159 | |
158 | #ifdef CONFIG_BFIN_UART1_CTSRTS | 160 | #ifdef CONFIG_BFIN_UART1_CTSRTS |
159 | /* Enable UART1 RTS and CTS on pin 9 & 10 of PORT E */ | 161 | peripheral_request(P_UART1_RTS, DRIVER_NAME); |
160 | bfin_write_PORTE_FER(0x600 | bfin_read_PORTE_FER()); | 162 | peripheral_request(P_UART1_CTS DRIVER_NAME); |
161 | bfin_write_PORTE_MUX(~0x3C0000 & bfin_read_PORTE_MUX()); | ||
162 | #endif | 163 | #endif |
163 | #endif | 164 | #endif |
164 | 165 | ||
165 | #ifdef CONFIG_SERIAL_BFIN_UART2 | 166 | #ifdef CONFIG_SERIAL_BFIN_UART2 |
166 | /* Enable UART2 RX and TX on pin 4 & 5 of PORT B */ | 167 | peripheral_request(P_UART2_TX, DRIVER_NAME); |
167 | bfin_write_PORTB_FER(0x30 | bfin_read_PORTB_FER()); | 168 | peripheral_request(P_UART2_RX, DRIVER_NAME); |
168 | bfin_write_PORTB_MUX(~0xF00 & bfin_read_PORTB_MUX()); | ||
169 | #endif | 169 | #endif |
170 | 170 | ||
171 | #ifdef CONFIG_SERIAL_BFIN_UART3 | 171 | #ifdef CONFIG_SERIAL_BFIN_UART3 |
172 | /* Enable UART3 RX and TX on pin 6 & 7 of PORT B */ | 172 | peripheral_request(P_UART3_TX, DRIVER_NAME); |
173 | bfin_write_PORTB_FER(0xC0 | bfin_read_PORTB_FER()); | 173 | peripheral_request(P_UART3_RX, DRIVER_NAME); |
174 | bfin_write_PORTB_MUX(~0xF000 | bfin_read_PORTB_MUX()); | 174 | |
175 | #ifdef CONFIG_BFIN_UART3_CTSRTS | 175 | #ifdef CONFIG_BFIN_UART3_CTSRTS |
176 | /* Enable UART3 RTS and CTS on pin 2 & 3 of PORT B */ | 176 | peripheral_request(P_UART3_RTS, DRIVER_NAME); |
177 | bfin_write_PORTB_FER(0xC | bfin_read_PORTB_FER()); | 177 | peripheral_request(P_UART3_CTS DRIVER_NAME); |
178 | bfin_write_PORTB_MUX(~0xF0 | bfin_read_PORTB_MUX()); | ||
179 | #endif | 178 | #endif |
180 | #endif | 179 | #endif |
181 | SSYNC(); | 180 | SSYNC(); |
182 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS | 181 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS |
183 | if (uart->cts_pin >= 0) { | 182 | if (uart->cts_pin >= 0) { |
184 | gpio_request(uart->cts_pin, NULL); | 183 | gpio_request(uart->cts_pin, DRIVER_NAME); |
185 | gpio_direction_input(uart->cts_pin); | 184 | gpio_direction_input(uart->cts_pin); |
186 | } | 185 | } |
187 | 186 | ||
188 | if (uart->rts_pin >= 0) { | 187 | if (uart->rts_pin >= 0) { |
189 | gpio_request(uart->rts_pin, NULL); | 188 | gpio_request(uart->rts_pin, DRIVER_NAME); |
190 | gpio_direction_output(uart->rts_pin); | 189 | gpio_direction_output(uart->rts_pin); |
191 | } | 190 | } |
192 | #endif | 191 | #endif |