blob: ee79e33b17488d95def055f43a8b98f5ed391ff1 [file] [log] [blame]
Ian Molton3abcd192007-11-19 13:16:56 +01001/*
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 Molton28365482008-08-09 21:48:45 +010013#include <linux/kernel.h>
Ian Molton3abcd192007-11-19 13:16:56 +010014#include <linux/init.h>
Ian Molton36033422008-08-24 19:21:26 +010015#include <linux/gpio.h>
16#include <linux/platform_device.h>
Ian Molton3abcd192007-11-19 13:16:56 +010017
18#include <asm/setup.h>
19#include <asm/mach/arch.h>
Ian Molton3abcd192007-11-19 13:16:56 +010020#include <asm/mach-types.h>
21
Ian Molton28365482008-08-09 21:48:45 +010022#include <mach/mfp-pxa25x.h>
23#include <mach/hardware.h>
Ian Moltonebcce7b2008-08-19 13:34:56 +010024#include <mach/eseries-gpio.h>
25#include <mach/udc.h>
Ian Molton36033422008-08-24 19:21:26 +010026#include <mach/irda.h>
Ian Molton28365482008-08-09 21:48:45 +010027
Ian Molton877e03d2008-06-25 22:22:49 +010028#include "generic.h"
Ian Molton3abcd192007-11-19 13:16:56 +010029
30/* Only e800 has 128MB RAM */
Ian Molton7dc96412008-08-19 12:14:21 +010031void __init eseries_fixup(struct machine_desc *desc,
Ian Molton67a6e802008-07-26 00:51:12 +010032 struct tag *tags, char **cmdline, struct meminfo *mi)
Ian Molton3abcd192007-11-19 13:16:56 +010033{
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 Moltonebcce7b2008-08-19 13:34:56 +010043struct 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 Molton36033422008-08-24 19:21:26 +010049static 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
60int 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);
73out:
74 return ret;
75}
76
77static 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
83struct 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