[ARM] pxa: e740 MFP fix
[deliverable/linux.git] / arch / arm / mach-pxa / eseries.c
CommitLineData
3abcd199
IM
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
28365488 13#include <linux/kernel.h>
3abcd199 14#include <linux/init.h>
36033422
IM
15#include <linux/gpio.h>
16#include <linux/platform_device.h>
3abcd199
IM
17
18#include <asm/setup.h>
19#include <asm/mach/arch.h>
3abcd199
IM
20#include <asm/mach-types.h>
21
28365488
IM
22#include <mach/mfp-pxa25x.h>
23#include <mach/hardware.h>
ebcce7b1
IM
24#include <mach/eseries-gpio.h>
25#include <mach/udc.h>
36033422 26#include <mach/irda.h>
28365488 27
877e03d4 28#include "generic.h"
3abcd199
IM
29
30/* Only e800 has 128MB RAM */
7dc96414 31void __init eseries_fixup(struct machine_desc *desc,
67a6e80e 32 struct tag *tags, char **cmdline, struct meminfo *mi)
3abcd199
IM
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
ebcce7b1
IM
43struct 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
36033422
IM
49static 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
This page took 0.103099 seconds and 5 git commands to generate.