pxa2xx.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 <mach/hardware.h>
  16. #include <mach/pxa2xx-regs.h>
  17. #include <mach/mfp-pxa25x.h>
  18. #include <mach/reset.h>
  19. #include <mach/irda.h>
  20. void pxa2xx_clear_reset_status(unsigned int mask)
  21. {
  22. /* RESET_STATUS_* has a 1:1 mapping with RCSR */
  23. RCSR = mask;
  24. }
  25. static unsigned long pxa2xx_mfp_fir[] = {
  26. GPIO46_FICP_RXD,
  27. GPIO47_FICP_TXD,
  28. };
  29. static unsigned long pxa2xx_mfp_sir[] = {
  30. GPIO46_STUART_RXD,
  31. GPIO47_STUART_TXD,
  32. };
  33. static unsigned long pxa2xx_mfp_off[] = {
  34. GPIO46_GPIO | MFP_LPM_DRIVE_LOW,
  35. GPIO47_GPIO | MFP_LPM_DRIVE_LOW,
  36. };
  37. void pxa2xx_transceiver_mode(struct device *dev, int mode)
  38. {
  39. if (mode & IR_OFF) {
  40. pxa2xx_mfp_config(pxa2xx_mfp_off, ARRAY_SIZE(pxa2xx_mfp_off));
  41. } else if (mode & IR_SIRMODE) {
  42. pxa2xx_mfp_config(pxa2xx_mfp_sir, ARRAY_SIZE(pxa2xx_mfp_sir));
  43. } else if (mode & IR_FIRMODE) {
  44. pxa2xx_mfp_config(pxa2xx_mfp_fir, ARRAY_SIZE(pxa2xx_mfp_fir));
  45. } else
  46. BUG();
  47. }