Ian Molton | 3abcd19 | 2007-11-19 13:16:56 +0100 | [diff] [blame] | 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 | |
Ian Molton | 2836548 | 2008-08-09 21:48:45 +0100 | [diff] [blame] | 13 | #include <linux/kernel.h> |
Ian Molton | 3abcd19 | 2007-11-19 13:16:56 +0100 | [diff] [blame] | 14 | #include <linux/init.h> |
Ian Molton | 3603342 | 2008-08-24 19:21:26 +0100 | [diff] [blame^] | 15 | #include <linux/gpio.h> |
| 16 | #include <linux/platform_device.h> |
Ian Molton | 3abcd19 | 2007-11-19 13:16:56 +0100 | [diff] [blame] | 17 | |
| 18 | #include <asm/setup.h> |
| 19 | #include <asm/mach/arch.h> |
Ian Molton | 3abcd19 | 2007-11-19 13:16:56 +0100 | [diff] [blame] | 20 | #include <asm/mach-types.h> |
| 21 | |
Ian Molton | 2836548 | 2008-08-09 21:48:45 +0100 | [diff] [blame] | 22 | #include <mach/mfp-pxa25x.h> |
| 23 | #include <mach/hardware.h> |
Ian Molton | ebcce7b | 2008-08-19 13:34:56 +0100 | [diff] [blame] | 24 | #include <mach/eseries-gpio.h> |
| 25 | #include <mach/udc.h> |
Ian Molton | 3603342 | 2008-08-24 19:21:26 +0100 | [diff] [blame^] | 26 | #include <mach/irda.h> |
Ian Molton | 2836548 | 2008-08-09 21:48:45 +0100 | [diff] [blame] | 27 | |
Ian Molton | 877e03d | 2008-06-25 22:22:49 +0100 | [diff] [blame] | 28 | #include "generic.h" |
Ian Molton | 3abcd19 | 2007-11-19 13:16:56 +0100 | [diff] [blame] | 29 | |
| 30 | /* Only e800 has 128MB RAM */ |
Ian Molton | 7dc9641 | 2008-08-19 12:14:21 +0100 | [diff] [blame] | 31 | void __init eseries_fixup(struct machine_desc *desc, |
Ian Molton | 67a6e80 | 2008-07-26 00:51:12 +0100 | [diff] [blame] | 32 | struct tag *tags, char **cmdline, struct meminfo *mi) |
Ian Molton | 3abcd19 | 2007-11-19 13:16:56 +0100 | [diff] [blame] | 33 | { |
| 34 | mi->nr_banks=1; |
| 35 | mi->bank[0].start = 0xa0000000; |
| 36 | mi->bank[0].node = 0; |
| 37 | if (machine_is_e800()) |
| 38 | mi->bank[0].size = (128*1024*1024); |
| 39 | else |
| 40 | mi->bank[0].size = (64*1024*1024); |
| 41 | } |
| 42 | |
Ian Molton | ebcce7b | 2008-08-19 13:34:56 +0100 | [diff] [blame] | 43 | struct pxa2xx_udc_mach_info e7xx_udc_mach_info = { |
| 44 | .gpio_vbus = GPIO_E7XX_USB_DISC, |
| 45 | .gpio_pullup = GPIO_E7XX_USB_PULLUP, |
| 46 | .gpio_pullup_inverted = 1 |
| 47 | }; |
| 48 | |
Ian Molton | 3603342 | 2008-08-24 19:21:26 +0100 | [diff] [blame^] | 49 | static void e7xx_irda_transceiver_mode(struct device *dev, int mode) |
| 50 | { |
| 51 | if (mode & IR_OFF) { |
| 52 | gpio_set_value(GPIO_E7XX_IR_OFF, 1); |
| 53 | pxa2xx_transceiver_mode(dev, mode); |
| 54 | } else { |
| 55 | pxa2xx_transceiver_mode(dev, mode); |
| 56 | gpio_set_value(GPIO_E7XX_IR_OFF, 0); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | int e7xx_irda_init(void) |
| 61 | { |
| 62 | int ret; |
| 63 | |
| 64 | ret = gpio_request(GPIO_E7XX_IR_OFF, "IrDA power"); |
| 65 | if (ret) |
| 66 | goto out; |
| 67 | |
| 68 | ret = gpio_direction_output(GPIO_E7XX_IR_OFF, 0); |
| 69 | if (ret) |
| 70 | goto out; |
| 71 | |
| 72 | e7xx_irda_transceiver_mode(NULL, IR_SIRMODE | IR_OFF); |
| 73 | out: |
| 74 | return ret; |
| 75 | } |
| 76 | |
| 77 | static void e7xx_irda_shutdown(struct device *dev) |
| 78 | { |
| 79 | e7xx_irda_transceiver_mode(dev, IR_SIRMODE | IR_OFF); |
| 80 | gpio_free(GPIO_E7XX_IR_OFF); |
| 81 | } |
| 82 | |
| 83 | struct pxaficp_platform_data e7xx_ficp_platform_data = { |
| 84 | .transceiver_cap = IR_SIRMODE | IR_OFF, |
| 85 | .transceiver_mode = e7xx_irda_transceiver_mode, |
| 86 | .shutdown = e7xx_irda_shutdown, |
| 87 | }; |
| 88 | |