pxa2xx.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * linux/arch/arm/mach-pxa/pxa2xx.c
  3. *
  4. * code specific to pxa2xx
  5. *
  6. * Copyright (C) 2008 Dmitry Baryshkov
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <linux/module.h>
  13. #include <linux/kernel.h>
  14. #include <linux/device.h>
  15. #include <linux/io.h>
  16. #include <mach/hardware.h>
  17. #include <mach/pxa2xx-regs.h>
  18. #include "mfp-pxa25x.h"
  19. #include <mach/reset.h>
  20. #include <linux/platform_data/irda-pxaficp.h>
  21. void pxa2xx_clear_reset_status(unsigned int mask)
  22. {
  23. /* RESET_STATUS_* has a 1:1 mapping with RCSR */
  24. RCSR = mask;
  25. }
  26. static unsigned long pxa2xx_mfp_fir[] = {
  27. GPIO46_FICP_RXD,
  28. GPIO47_FICP_TXD,
  29. };
  30. static unsigned long pxa2xx_mfp_sir[] = {
  31. GPIO46_STUART_RXD,
  32. GPIO47_STUART_TXD,
  33. };
  34. static unsigned long pxa2xx_mfp_off[] = {
  35. GPIO46_GPIO | MFP_LPM_DRIVE_LOW,
  36. GPIO47_GPIO | MFP_LPM_DRIVE_LOW,
  37. };
  38. void pxa2xx_transceiver_mode(struct device *dev, int mode)
  39. {
  40. if (mode & IR_OFF) {
  41. pxa2xx_mfp_config(pxa2xx_mfp_off, ARRAY_SIZE(pxa2xx_mfp_off));
  42. } else if (mode & IR_SIRMODE) {
  43. pxa2xx_mfp_config(pxa2xx_mfp_sir, ARRAY_SIZE(pxa2xx_mfp_sir));
  44. } else if (mode & IR_FIRMODE) {
  45. pxa2xx_mfp_config(pxa2xx_mfp_fir, ARRAY_SIZE(pxa2xx_mfp_fir));
  46. } else
  47. BUG();
  48. }
  49. EXPORT_SYMBOL_GPL(pxa2xx_transceiver_mode);