aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2012-05-02 08:47:18 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-02 17:08:07 -0400
commite8155629ff19e05722ba057d1521baec270d780e (patch)
treed800fc07d2b2c8eaaee42e8d88e30f61ea7593ca /drivers/tty
parent28bf4cf22dcd936f93dd6063696b1accdc1d5207 (diff)
serial8250: Clean up default map and dl code
Get rid of unused functions and macros now when Alchemy and RM9K are converted over to callbacks. Signed-off-by: Magnus Damm <damm@opensource.se> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/8250/8250.c38
1 files changed, 12 insertions, 26 deletions
diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
index cc398b1bcebf..662188d6cddf 100644
--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -285,28 +285,18 @@ static const struct serial8250_config uart_config[] = {
285}; 285};
286 286
287/* Uart divisor latch read */ 287/* Uart divisor latch read */
288static int default_dl_read(struct uart_8250_port *up) 288static int default_serial_dl_read(struct uart_8250_port *up)
289{ 289{
290 return serial_in(up, UART_DLL) | serial_in(up, UART_DLM) << 8; 290 return serial_in(up, UART_DLL) | serial_in(up, UART_DLM) << 8;
291} 291}
292 292
293/* Uart divisor latch write */ 293/* Uart divisor latch write */
294static void default_dl_write(struct uart_8250_port *up, int value) 294static void default_serial_dl_write(struct uart_8250_port *up, int value)
295{ 295{
296 serial_out(up, UART_DLL, value & 0xff); 296 serial_out(up, UART_DLL, value & 0xff);
297 serial_out(up, UART_DLM, value >> 8 & 0xff); 297 serial_out(up, UART_DLM, value >> 8 & 0xff);
298} 298}
299 299
300static int _serial_dl_read(struct uart_8250_port *up)
301{
302 return default_dl_read(up);
303}
304
305static void _serial_dl_write(struct uart_8250_port *up, int value)
306{
307 default_dl_write(up, value);
308}
309
310#ifdef CONFIG_MIPS_ALCHEMY 300#ifdef CONFIG_MIPS_ALCHEMY
311 301
312/* Au1x00 UART hardware has a weird register layout */ 302/* Au1x00 UART hardware has a weird register layout */
@@ -403,57 +393,53 @@ static void rm9k_serial_dl_write(struct uart_8250_port *up, int value)
403 393
404#endif 394#endif
405 395
406/* sane hardware needs no mapping */
407#define map_8250_in_reg(up, offset) (offset)
408#define map_8250_out_reg(up, offset) (offset)
409
410static unsigned int hub6_serial_in(struct uart_port *p, int offset) 396static unsigned int hub6_serial_in(struct uart_port *p, int offset)
411{ 397{
412 offset = map_8250_in_reg(p, offset) << p->regshift; 398 offset = offset << p->regshift;
413 outb(p->hub6 - 1 + offset, p->iobase); 399 outb(p->hub6 - 1 + offset, p->iobase);
414 return inb(p->iobase + 1); 400 return inb(p->iobase + 1);
415} 401}
416 402
417static void hub6_serial_out(struct uart_port *p, int offset, int value) 403static void hub6_serial_out(struct uart_port *p, int offset, int value)
418{ 404{
419 offset = map_8250_out_reg(p, offset) << p->regshift; 405 offset = offset << p->regshift;
420 outb(p->hub6 - 1 + offset, p->iobase); 406 outb(p->hub6 - 1 + offset, p->iobase);
421 outb(value, p->iobase + 1); 407 outb(value, p->iobase + 1);
422} 408}
423 409
424static unsigned int mem_serial_in(struct uart_port *p, int offset) 410static unsigned int mem_serial_in(struct uart_port *p, int offset)
425{ 411{
426 offset = map_8250_in_reg(p, offset) << p->regshift; 412 offset = offset << p->regshift;
427 return readb(p->membase + offset); 413 return readb(p->membase + offset);
428} 414}
429 415
430static void mem_serial_out(struct uart_port *p, int offset, int value) 416static void mem_serial_out(struct uart_port *p, int offset, int value)
431{ 417{
432 offset = map_8250_out_reg(p, offset) << p->regshift; 418 offset = offset << p->regshift;
433 writeb(value, p->membase + offset); 419 writeb(value, p->membase + offset);
434} 420}
435 421
436static void mem32_serial_out(struct uart_port *p, int offset, int value) 422static void mem32_serial_out(struct uart_port *p, int offset, int value)
437{ 423{
438 offset = map_8250_out_reg(p, offset) << p->regshift; 424 offset = offset << p->regshift;
439 writel(value, p->membase + offset); 425 writel(value, p->membase + offset);
440} 426}
441 427
442static unsigned int mem32_serial_in(struct uart_port *p, int offset) 428static unsigned int mem32_serial_in(struct uart_port *p, int offset)
443{ 429{
444 offset = map_8250_in_reg(p, offset) << p->regshift; 430 offset = offset << p->regshift;
445 return readl(p->membase + offset); 431 return readl(p->membase + offset);
446} 432}
447 433
448static unsigned int io_serial_in(struct uart_port *p, int offset) 434static unsigned int io_serial_in(struct uart_port *p, int offset)
449{ 435{
450 offset = map_8250_in_reg(p, offset) << p->regshift; 436 offset = offset << p->regshift;
451 return inb(p->iobase + offset); 437 return inb(p->iobase + offset);
452} 438}
453 439
454static void io_serial_out(struct uart_port *p, int offset, int value) 440static void io_serial_out(struct uart_port *p, int offset, int value)
455{ 441{
456 offset = map_8250_out_reg(p, offset) << p->regshift; 442 offset = offset << p->regshift;
457 outb(value, p->iobase + offset); 443 outb(value, p->iobase + offset);
458} 444}
459 445
@@ -464,8 +450,8 @@ static void set_io_from_upio(struct uart_port *p)
464 struct uart_8250_port *up = 450 struct uart_8250_port *up =
465 container_of(p, struct uart_8250_port, port); 451 container_of(p, struct uart_8250_port, port);
466 452
467 up->dl_read = _serial_dl_read; 453 up->dl_read = default_serial_dl_read;
468 up->dl_write = _serial_dl_write; 454 up->dl_write = default_serial_dl_write;
469 455
470 switch (p->iotype) { 456 switch (p->iotype) {
471 case UPIO_HUB6: 457 case UPIO_HUB6: