pxa2xx.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 <asm/arch/mfp-pxa2xx.h>
  16. #include <asm/arch/mfp-pxa25x.h>
  17. #include <asm/arch/irda.h>
  18. static unsigned long pxa2xx_mfp_fir[] = {
  19. GPIO46_FICP_RXD,
  20. GPIO47_FICP_TXD,
  21. };
  22. static unsigned long pxa2xx_mfp_sir[] = {
  23. GPIO46_STUART_RXD,
  24. GPIO47_STUART_TXD,
  25. };
  26. static unsigned long pxa2xx_mfp_off[] = {
  27. GPIO46_GPIO | MFP_LPM_DRIVE_LOW,
  28. GPIO47_GPIO | MFP_LPM_DRIVE_LOW,
  29. };
  30. void pxa2xx_transceiver_mode(struct device *dev, int mode)
  31. {
  32. if (mode & IR_OFF) {
  33. pxa2xx_mfp_config(pxa2xx_mfp_off, ARRAY_SIZE(pxa2xx_mfp_off));
  34. } else if (mode & IR_SIRMODE) {
  35. pxa2xx_mfp_config(pxa2xx_mfp_sir, ARRAY_SIZE(pxa2xx_mfp_sir));
  36. } else if (mode & IR_FIRMODE) {
  37. pxa2xx_mfp_config(pxa2xx_mfp_fir, ARRAY_SIZE(pxa2xx_mfp_fir));
  38. } else
  39. BUG();
  40. }