2 * Hardware definitions for the Toshiba eseries PDAs
4 * Copyright (c) 2003 Ian Molton <spyro@f2s.com>
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
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/gpio.h>
16 #include <linux/delay.h>
17 #include <linux/platform_device.h>
19 #include <asm/setup.h>
20 #include <asm/mach/arch.h>
21 #include <asm/mach-types.h>
23 #include <mach/pxa25x.h>
24 #include <mach/eseries-gpio.h>
26 #include <mach/irda.h>
31 /* Only e800 has 128MB RAM */
32 void __init
eseries_fixup(struct machine_desc
*desc
,
33 struct tag
*tags
, char **cmdline
, struct meminfo
*mi
)
36 mi
->bank
[0].start
= 0xa0000000;
38 if (machine_is_e800())
39 mi
->bank
[0].size
= (128*1024*1024);
41 mi
->bank
[0].size
= (64*1024*1024);
44 struct pxa2xx_udc_mach_info e7xx_udc_mach_info
= {
45 .gpio_vbus
= GPIO_E7XX_USB_DISC
,
46 .gpio_pullup
= GPIO_E7XX_USB_PULLUP
,
47 .gpio_pullup_inverted
= 1
50 static void e7xx_irda_transceiver_mode(struct device
*dev
, int mode
)
53 gpio_set_value(GPIO_E7XX_IR_OFF
, 1);
54 pxa2xx_transceiver_mode(dev
, mode
);
56 pxa2xx_transceiver_mode(dev
, mode
);
57 gpio_set_value(GPIO_E7XX_IR_OFF
, 0);
61 int e7xx_irda_init(void)
65 ret
= gpio_request(GPIO_E7XX_IR_OFF
, "IrDA power");
69 ret
= gpio_direction_output(GPIO_E7XX_IR_OFF
, 0);
73 e7xx_irda_transceiver_mode(NULL
, IR_SIRMODE
| IR_OFF
);
78 static void e7xx_irda_shutdown(struct device
*dev
)
80 e7xx_irda_transceiver_mode(dev
, IR_SIRMODE
| IR_OFF
);
81 gpio_free(GPIO_E7XX_IR_OFF
);
84 struct pxaficp_platform_data e7xx_ficp_platform_data
= {
85 .transceiver_cap
= IR_SIRMODE
| IR_OFF
,
86 .transceiver_mode
= e7xx_irda_transceiver_mode
,
87 .shutdown
= e7xx_irda_shutdown
,
90 int eseries_tmio_enable(struct platform_device
*dev
)
92 /* Reset - bring SUSPEND high before PCLR */
93 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND
, 0);
94 gpio_set_value(GPIO_ESERIES_TMIO_PCLR
, 0);
96 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND
, 1);
98 gpio_set_value(GPIO_ESERIES_TMIO_PCLR
, 1);
103 int eseries_tmio_disable(struct platform_device
*dev
)
105 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND
, 0);
106 gpio_set_value(GPIO_ESERIES_TMIO_PCLR
, 0);
110 int eseries_tmio_suspend(struct platform_device
*dev
)
112 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND
, 0);
116 int eseries_tmio_resume(struct platform_device
*dev
)
118 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND
, 1);
123 void eseries_get_tmio_gpios(void)
125 gpio_request(GPIO_ESERIES_TMIO_SUSPEND
, NULL
);
126 gpio_request(GPIO_ESERIES_TMIO_PCLR
, NULL
);
127 gpio_direction_output(GPIO_ESERIES_TMIO_SUSPEND
, 0);
128 gpio_direction_output(GPIO_ESERIES_TMIO_PCLR
, 0);
131 /* TMIO controller uses the same resources on all e-series machines. */
132 struct resource eseries_tmio_resources
[] = {
134 .start
= PXA_CS4_PHYS
,
135 .end
= PXA_CS4_PHYS
+ 0x1fffff,
136 .flags
= IORESOURCE_MEM
,
139 .start
= IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ
),
140 .end
= IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ
),
141 .flags
= IORESOURCE_IRQ
,
145 /* Some e-series hardware cannot control the 32K clock */
146 static void clk_32k_dummy(struct clk
*clk
)
150 static const struct clkops clk_32k_dummy_ops
= {
151 .enable
= clk_32k_dummy
,
152 .disable
= clk_32k_dummy
,
155 static struct clk tmio_dummy_clk
= {
156 .ops
= &clk_32k_dummy_ops
,
160 static struct clk_lookup eseries_clkregs
[] = {
161 INIT_CLKREG(&tmio_dummy_clk
, NULL
, "CLK_CK32K"),
164 void eseries_register_clks(void)
166 clks_register(eseries_clkregs
, ARRAY_SIZE(eseries_clkregs
));