s3c6400.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * Driver for Samsung S3C6400 and S3C6410 SoC onboard UARTs.
  3. *
  4. * Copyright 2008 Openmoko, Inc.
  5. * Copyright 2008 Simtec Electronics
  6. * Ben Dooks <ben@simtec.co.uk>
  7. * http://armlinux.simtec.co.uk/
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #include <linux/module.h>
  14. #include <linux/ioport.h>
  15. #include <linux/io.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/init.h>
  18. #include <linux/serial_core.h>
  19. #include <linux/serial.h>
  20. #include <asm/irq.h>
  21. #include <mach/hardware.h>
  22. #include <plat/regs-serial.h>
  23. #include "samsung.h"
  24. static struct s3c24xx_uart_info s3c6400_uart_inf = {
  25. .name = "Samsung S3C6400 UART",
  26. .type = PORT_S3C6400,
  27. .fifosize = 64,
  28. .has_divslot = 1,
  29. .rx_fifomask = S3C2440_UFSTAT_RXMASK,
  30. .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT,
  31. .rx_fifofull = S3C2440_UFSTAT_RXFULL,
  32. .tx_fifofull = S3C2440_UFSTAT_TXFULL,
  33. .tx_fifomask = S3C2440_UFSTAT_TXMASK,
  34. .tx_fifoshift = S3C2440_UFSTAT_TXSHIFT,
  35. .def_clk_sel = S3C2410_UCON_CLKSEL2,
  36. .num_clks = 4,
  37. .clksel_mask = S3C6400_UCON_CLKMASK,
  38. .clksel_shift = S3C6400_UCON_CLKSHIFT,
  39. };
  40. /* device management */
  41. static int s3c6400_serial_probe(struct platform_device *dev)
  42. {
  43. dbg("s3c6400_serial_probe: dev=%p\n", dev);
  44. return s3c24xx_serial_probe(dev, &s3c6400_uart_inf);
  45. }
  46. static struct platform_driver s3c6400_serial_driver = {
  47. .probe = s3c6400_serial_probe,
  48. .remove = __devexit_p(s3c24xx_serial_remove),
  49. .driver = {
  50. .name = "s3c6400-uart",
  51. .owner = THIS_MODULE,
  52. },
  53. };
  54. static int __init s3c6400_serial_init(void)
  55. {
  56. return s3c24xx_serial_init(&s3c6400_serial_driver, &s3c6400_uart_inf);
  57. }
  58. static void __exit s3c6400_serial_exit(void)
  59. {
  60. platform_driver_unregister(&s3c6400_serial_driver);
  61. }
  62. module_init(s3c6400_serial_init);
  63. module_exit(s3c6400_serial_exit);
  64. MODULE_DESCRIPTION("Samsung S3C6400,S3C6410 SoC Serial port driver");
  65. MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
  66. MODULE_LICENSE("GPL v2");
  67. MODULE_ALIAS("platform:s3c6400-uart");