s3c2440.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Driver for Samsung S3C2440 and S3C2442 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 s3c2440_uart_inf = {
  24. .name = "Samsung S3C2440 UART",
  25. .type = PORT_S3C2440,
  26. .fifosize = 64,
  27. .rx_fifomask = S3C2440_UFSTAT_RXMASK,
  28. .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT,
  29. .rx_fifofull = S3C2440_UFSTAT_RXFULL,
  30. .tx_fifofull = S3C2440_UFSTAT_TXFULL,
  31. .tx_fifomask = S3C2440_UFSTAT_TXMASK,
  32. .tx_fifoshift = S3C2440_UFSTAT_TXSHIFT,
  33. .def_clk_sel = S3C2410_UCON_CLKSEL2,
  34. .num_clks = 4,
  35. .clksel_mask = S3C2440_UCON_CLKMASK,
  36. .clksel_shift = S3C2440_UCON_CLKSHIFT,
  37. };
  38. /* device management */
  39. static int s3c2440_serial_probe(struct platform_device *dev)
  40. {
  41. dbg("s3c2440_serial_probe: dev=%p\n", dev);
  42. return s3c24xx_serial_probe(dev, &s3c2440_uart_inf);
  43. }
  44. static struct platform_driver s3c2440_serial_driver = {
  45. .probe = s3c2440_serial_probe,
  46. .remove = __devexit_p(s3c24xx_serial_remove),
  47. .driver = {
  48. .name = "s3c2440-uart",
  49. .owner = THIS_MODULE,
  50. },
  51. };
  52. static int __init s3c2440_serial_init(void)
  53. {
  54. return s3c24xx_serial_init(&s3c2440_serial_driver, &s3c2440_uart_inf);
  55. }
  56. static void __exit s3c2440_serial_exit(void)
  57. {
  58. platform_driver_unregister(&s3c2440_serial_driver);
  59. }
  60. module_init(s3c2440_serial_init);
  61. module_exit(s3c2440_serial_exit);
  62. MODULE_DESCRIPTION("Samsung S3C2440,S3C2442 SoC Serial port driver");
  63. MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
  64. MODULE_LICENSE("GPL v2");
  65. MODULE_ALIAS("platform:s3c2440-uart");