eseries.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * Hardware definitions for the Toshiba eseries PDAs
  3. *
  4. * Copyright (c) 2003 Ian Molton <spyro@f2s.com>
  5. *
  6. * This file is licensed under
  7. * the terms of the GNU General Public License version 2. This program
  8. * is licensed "as is" without any warranty of any kind, whether express
  9. * or implied.
  10. *
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/init.h>
  14. #include <linux/gpio.h>
  15. #include <linux/platform_device.h>
  16. #include <asm/setup.h>
  17. #include <asm/mach/arch.h>
  18. #include <asm/mach-types.h>
  19. #include <mach/mfp-pxa25x.h>
  20. #include <mach/hardware.h>
  21. #include <mach/eseries-gpio.h>
  22. #include <mach/udc.h>
  23. #include <mach/irda.h>
  24. #include "generic.h"
  25. /* Only e800 has 128MB RAM */
  26. void __init eseries_fixup(struct machine_desc *desc,
  27. struct tag *tags, char **cmdline, struct meminfo *mi)
  28. {
  29. mi->nr_banks=1;
  30. mi->bank[0].start = 0xa0000000;
  31. mi->bank[0].node = 0;
  32. if (machine_is_e800())
  33. mi->bank[0].size = (128*1024*1024);
  34. else
  35. mi->bank[0].size = (64*1024*1024);
  36. }
  37. struct pxa2xx_udc_mach_info e7xx_udc_mach_info = {
  38. .gpio_vbus = GPIO_E7XX_USB_DISC,
  39. .gpio_pullup = GPIO_E7XX_USB_PULLUP,
  40. .gpio_pullup_inverted = 1
  41. };
  42. static void e7xx_irda_transceiver_mode(struct device *dev, int mode)
  43. {
  44. if (mode & IR_OFF) {
  45. gpio_set_value(GPIO_E7XX_IR_OFF, 1);
  46. pxa2xx_transceiver_mode(dev, mode);
  47. } else {
  48. pxa2xx_transceiver_mode(dev, mode);
  49. gpio_set_value(GPIO_E7XX_IR_OFF, 0);
  50. }
  51. }
  52. int e7xx_irda_init(void)
  53. {
  54. int ret;
  55. ret = gpio_request(GPIO_E7XX_IR_OFF, "IrDA power");
  56. if (ret)
  57. goto out;
  58. ret = gpio_direction_output(GPIO_E7XX_IR_OFF, 0);
  59. if (ret)
  60. goto out;
  61. e7xx_irda_transceiver_mode(NULL, IR_SIRMODE | IR_OFF);
  62. out:
  63. return ret;
  64. }
  65. static void e7xx_irda_shutdown(struct device *dev)
  66. {
  67. e7xx_irda_transceiver_mode(dev, IR_SIRMODE | IR_OFF);
  68. gpio_free(GPIO_E7XX_IR_OFF);
  69. }
  70. struct pxaficp_platform_data e7xx_ficp_platform_data = {
  71. .transceiver_cap = IR_SIRMODE | IR_OFF,
  72. .transceiver_mode = e7xx_irda_transceiver_mode,
  73. .shutdown = e7xx_irda_shutdown,
  74. };