s3c2410.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Driver for Samsung S3C2410 SoC onboard UARTs.
  3. *
  4. * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics
  5. * http://armlinux.simtec.co.uk/
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #include <linux/module.h>
  12. #include <linux/ioport.h>
  13. #include <linux/io.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/init.h>
  16. #include <linux/serial_core.h>
  17. #include <linux/serial.h>
  18. #include <asm/irq.h>
  19. #include <mach/hardware.h>
  20. #include <plat/regs-serial.h>
  21. #include <mach/regs-gpio.h>
  22. #include "samsung.h"
  23. static struct s3c24xx_uart_info s3c2410_uart_inf = {
  24. .name = "Samsung S3C2410 UART",
  25. .type = PORT_S3C2410,
  26. .fifosize = 16,
  27. .rx_fifomask = S3C2410_UFSTAT_RXMASK,
  28. .rx_fifoshift = S3C2410_UFSTAT_RXSHIFT,
  29. .rx_fifofull = S3C2410_UFSTAT_RXFULL,
  30. .tx_fifofull = S3C2410_UFSTAT_TXFULL,
  31. .tx_fifomask = S3C2410_UFSTAT_TXMASK,
  32. .tx_fifoshift = S3C2410_UFSTAT_TXSHIFT,
  33. .def_clk_sel = S3C2410_UCON_CLKSEL0,
  34. .num_clks = 2,
  35. .clksel_mask = S3C2410_UCON_CLKMASK,
  36. .clksel_shift = S3C2410_UCON_CLKSHIFT,
  37. };
  38. static int s3c2410_serial_probe(struct platform_device *dev)
  39. {
  40. return s3c24xx_serial_probe(dev, &s3c2410_uart_inf);
  41. }
  42. static struct platform_driver s3c2410_serial_driver = {
  43. .probe = s3c2410_serial_probe,
  44. .remove = __devexit_p(s3c24xx_serial_remove),
  45. .driver = {
  46. .name = "s3c2410-uart",
  47. .owner = THIS_MODULE,
  48. },
  49. };
  50. static int __init s3c2410_serial_init(void)
  51. {
  52. return s3c24xx_serial_init(&s3c2410_serial_driver, &s3c2410_uart_inf);
  53. }
  54. static void __exit s3c2410_serial_exit(void)
  55. {
  56. platform_driver_unregister(&s3c2410_serial_driver);
  57. }
  58. module_init(s3c2410_serial_init);
  59. module_exit(s3c2410_serial_exit);
  60. MODULE_LICENSE("GPL v2");
  61. MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
  62. MODULE_DESCRIPTION("Samsung S3C2410 SoC Serial port driver");
  63. MODULE_ALIAS("platform:s3c2410-uart");