ARM: 6641/1: ep93xx: implement gpiolib set_debounce for built-in GPIOs
[deliverable/linux.git] / arch / arm / mach-ep93xx / edb93xx.c
CommitLineData
a2bd40d2
HS
1/*
2 * arch/arm/mach-ep93xx/edb93xx.c
3 * Cirrus Logic EDB93xx Development Board support.
4 *
5 * EDB93XX, EDB9301, EDB9307A
6 * Copyright (C) 2008-2009 H Hartley Sweeten <hsweeten@visionengravers.com>
7 *
8 * EDB9302
9 * Copyright (C) 2006 George Kashperko <george@chas.com.ua>
10 *
11 * EDB9302A, EDB9315, EDB9315A
12 * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
13 *
14 * EDB9307
15 * Copyright (C) 2007 Herbert Valerio Riedel <hvr@gnu.org>
16 *
17 * EDB9312
18 * Copyright (C) 2006 Infosys Technologies Limited
19 * Toufeeq Hussain <toufeeq_hussain@infosys.com>
20 *
21 * This program is free software; you can redistribute it and/or modify
22 * it under the terms of the GNU General Public License as published by
23 * the Free Software Foundation; either version 2 of the License, or (at
24 * your option) any later version.
25 */
26
27#include <linux/kernel.h>
28#include <linux/init.h>
a2bd40d2 29#include <linux/platform_device.h>
6531a991
HS
30#include <linux/gpio.h>
31#include <linux/i2c.h>
32#include <linux/i2c-gpio.h>
583ddafe 33
a2bd40d2 34#include <mach/hardware.h>
583ddafe 35
a2bd40d2
HS
36#include <asm/mach-types.h>
37#include <asm/mach/arch.h>
38
583ddafe 39
a2bd40d2
HS
40static void __init edb93xx_register_flash(void)
41{
42 if (machine_is_edb9307() || machine_is_edb9312() ||
43 machine_is_edb9315()) {
16bcf78f 44 ep93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_32M);
a2bd40d2 45 } else {
16bcf78f 46 ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
a2bd40d2
HS
47 }
48}
49
b370e082 50static struct ep93xx_eth_data __initdata edb93xx_eth_data = {
a2bd40d2
HS
51 .phy_id = 1,
52};
53
6531a991
HS
54
55/*************************************************************************
56 * EDB93xx i2c peripheral handling
57 *************************************************************************/
b370e082 58static struct i2c_gpio_platform_data __initdata edb93xx_i2c_gpio_data = {
6531a991
HS
59 .sda_pin = EP93XX_GPIO_LINE_EEDAT,
60 .sda_is_open_drain = 0,
61 .scl_pin = EP93XX_GPIO_LINE_EECLK,
62 .scl_is_open_drain = 0,
63 .udelay = 0, /* default to 100 kHz */
64 .timeout = 0, /* default to 100 ms */
65};
66
67static struct i2c_board_info __initdata edb93xxa_i2c_board_info[] = {
a2bd40d2
HS
68 {
69 I2C_BOARD_INFO("isl1208", 0x6f),
70 },
71};
72
6531a991 73static struct i2c_board_info __initdata edb93xx_i2c_board_info[] = {
a2bd40d2
HS
74 {
75 I2C_BOARD_INFO("ds1337", 0x68),
76 },
77};
78
79static void __init edb93xx_register_i2c(void)
80{
81 if (machine_is_edb9302a() || machine_is_edb9307a() ||
82 machine_is_edb9315a()) {
6531a991
HS
83 ep93xx_register_i2c(&edb93xx_i2c_gpio_data,
84 edb93xxa_i2c_board_info,
85 ARRAY_SIZE(edb93xxa_i2c_board_info));
a2bd40d2
HS
86 } else if (machine_is_edb9307() || machine_is_edb9312() ||
87 machine_is_edb9315()) {
3d977c01 88 ep93xx_register_i2c(&edb93xx_i2c_gpio_data,
6531a991
HS
89 edb93xx_i2c_board_info,
90 ARRAY_SIZE(edb93xx_i2c_board_info));
a2bd40d2
HS
91 }
92}
93
1fbd972a
HS
94
95/*************************************************************************
96 * EDB93xx pwm
97 *************************************************************************/
98static void __init edb93xx_register_pwm(void)
99{
100 if (machine_is_edb9301() ||
101 machine_is_edb9302() || machine_is_edb9302a()) {
102 /* EP9301 and EP9302 only have pwm.1 (EGPIO14) */
103 ep93xx_register_pwm(0, 1);
104 } else if (machine_is_edb9307() || machine_is_edb9307a()) {
105 /* EP9307 only has pwm.0 (PWMOUT) */
106 ep93xx_register_pwm(1, 0);
107 } else {
108 /* EP9312 and EP9315 have both */
109 ep93xx_register_pwm(1, 1);
110 }
111}
112
113
a2bd40d2
HS
114static void __init edb93xx_init_machine(void)
115{
116 ep93xx_init_devices();
117 edb93xx_register_flash();
118 ep93xx_register_eth(&edb93xx_eth_data, 1);
119 edb93xx_register_i2c();
1fbd972a 120 edb93xx_register_pwm();
a2bd40d2
HS
121}
122
123
124#ifdef CONFIG_MACH_EDB9301
125MACHINE_START(EDB9301, "Cirrus Logic EDB9301 Evaluation Board")
126 /* Maintainer: H Hartley Sweeten <hsweeten@visionengravers.com> */
a2bd40d2
HS
127 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
128 .map_io = ep93xx_map_io,
129 .init_irq = ep93xx_init_irq,
130 .timer = &ep93xx_timer,
131 .init_machine = edb93xx_init_machine,
132MACHINE_END
133#endif
134
135#ifdef CONFIG_MACH_EDB9302
136MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board")
137 /* Maintainer: George Kashperko <george@chas.com.ua> */
a2bd40d2
HS
138 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
139 .map_io = ep93xx_map_io,
140 .init_irq = ep93xx_init_irq,
141 .timer = &ep93xx_timer,
142 .init_machine = edb93xx_init_machine,
143MACHINE_END
144#endif
145
146#ifdef CONFIG_MACH_EDB9302A
147MACHINE_START(EDB9302A, "Cirrus Logic EDB9302A Evaluation Board")
148 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
a2bd40d2
HS
149 .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
150 .map_io = ep93xx_map_io,
151 .init_irq = ep93xx_init_irq,
152 .timer = &ep93xx_timer,
153 .init_machine = edb93xx_init_machine,
154MACHINE_END
155#endif
156
157#ifdef CONFIG_MACH_EDB9307
158MACHINE_START(EDB9307, "Cirrus Logic EDB9307 Evaluation Board")
159 /* Maintainer: Herbert Valerio Riedel <hvr@gnu.org> */
a2bd40d2
HS
160 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
161 .map_io = ep93xx_map_io,
162 .init_irq = ep93xx_init_irq,
163 .timer = &ep93xx_timer,
164 .init_machine = edb93xx_init_machine,
165MACHINE_END
166#endif
167
168#ifdef CONFIG_MACH_EDB9307A
169MACHINE_START(EDB9307A, "Cirrus Logic EDB9307A Evaluation Board")
170 /* Maintainer: H Hartley Sweeten <hsweeten@visionengravers.com> */
a2bd40d2
HS
171 .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
172 .map_io = ep93xx_map_io,
173 .init_irq = ep93xx_init_irq,
174 .timer = &ep93xx_timer,
175 .init_machine = edb93xx_init_machine,
176MACHINE_END
177#endif
178
179#ifdef CONFIG_MACH_EDB9312
180MACHINE_START(EDB9312, "Cirrus Logic EDB9312 Evaluation Board")
181 /* Maintainer: Toufeeq Hussain <toufeeq_hussain@infosys.com> */
a2bd40d2
HS
182 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
183 .map_io = ep93xx_map_io,
184 .init_irq = ep93xx_init_irq,
185 .timer = &ep93xx_timer,
186 .init_machine = edb93xx_init_machine,
187MACHINE_END
188#endif
189
190#ifdef CONFIG_MACH_EDB9315
191MACHINE_START(EDB9315, "Cirrus Logic EDB9315 Evaluation Board")
192 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
a2bd40d2
HS
193 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
194 .map_io = ep93xx_map_io,
195 .init_irq = ep93xx_init_irq,
196 .timer = &ep93xx_timer,
197 .init_machine = edb93xx_init_machine,
198MACHINE_END
199#endif
200
201#ifdef CONFIG_MACH_EDB9315A
202MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board")
203 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
a2bd40d2
HS
204 .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
205 .map_io = ep93xx_map_io,
206 .init_irq = ep93xx_init_irq,
207 .timer = &ep93xx_timer,
208 .init_machine = edb93xx_init_machine,
209MACHINE_END
210#endif
This page took 0.10688 seconds and 5 git commands to generate.