44
43
#include <asm/delay.h>
45
44
#include <plat/usb.h>
45
#include <plat/gpmc-smsc911x.h>
47
47
#include "board-flash.h"
50
50
#include "control.h"
51
#include "common-board-devices.h"
52
53
#define LDP_SMSC911X_CS 1
53
54
#define LDP_SMSC911X_GPIO 152
54
55
#define DEBUG_BASE 0x08000000
55
56
#define LDP_ETHR_START DEBUG_BASE
57
static struct resource ldp_smsc911x_resources[] = {
59
.start = LDP_ETHR_START,
60
.end = LDP_ETHR_START + SZ_4K,
61
.flags = IORESOURCE_MEM,
66
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
70
static struct smsc911x_platform_config ldp_smsc911x_config = {
71
.irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
72
.irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
73
.flags = SMSC911X_USE_32BIT,
74
.phy_interface = PHY_INTERFACE_MODE_MII,
77
static struct platform_device ldp_smsc911x_device = {
80
.num_resources = ARRAY_SIZE(ldp_smsc911x_resources),
81
.resource = ldp_smsc911x_resources,
83
.platform_data = &ldp_smsc911x_config,
87
58
static uint32_t board_keymap[] = {
203
* @brief ads7846_dev_init : Requests & sets GPIO line for pen-irq
205
* @return - void. If request gpio fails then Flag KERN_ERR.
207
static void ads7846_dev_init(void)
209
if (gpio_request(ts_gpio, "ads7846 irq") < 0) {
210
printk(KERN_ERR "can't get ads746 pen down GPIO\n");
214
gpio_direction_input(ts_gpio);
215
gpio_set_debounce(ts_gpio, 310);
218
static int ads7846_get_pendown_state(void)
220
return !gpio_get_value(ts_gpio);
223
static struct ads7846_platform_data tsc2046_config __initdata = {
224
.get_pendown_state = ads7846_get_pendown_state,
228
static struct omap2_mcspi_device_config tsc2046_mcspi_config = {
230
.single_channel = 1, /* 0: slave, 1: master */
233
static struct spi_board_info ldp_spi_board_info[] __initdata = {
236
* TSC2046 operates at a max freqency of 2MHz, so
237
* operate slightly below at 1.5MHz
239
.modalias = "ads7846",
242
.max_speed_hz = 1500000,
243
.controller_data = &tsc2046_mcspi_config,
245
.platform_data = &tsc2046_config,
171
static struct omap_smsc911x_platform_data smsc911x_cfg = {
172
.cs = LDP_SMSC911X_CS,
173
.gpio_irq = LDP_SMSC911X_GPIO,
174
.gpio_reset = -EINVAL,
175
.flags = SMSC911X_USE_32BIT,
249
178
static inline void __init ldp_init_smsc911x(void)
252
unsigned long cs_mem_base;
255
eth_cs = LDP_SMSC911X_CS;
257
if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
258
printk(KERN_ERR "Failed to request GPMC mem for smsc911x\n");
262
ldp_smsc911x_resources[0].start = cs_mem_base + 0x0;
263
ldp_smsc911x_resources[0].end = cs_mem_base + 0xff;
266
eth_gpio = LDP_SMSC911X_GPIO;
268
ldp_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio);
270
if (gpio_request(eth_gpio, "smsc911x irq") < 0) {
271
printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
275
gpio_direction_input(eth_gpio);
180
gpmc_smsc911x_init(&smsc911x_cfg);
278
183
static struct platform_device ldp_lcd_device = {
294
199
omap2_init_common_devices(NULL, NULL);
297
static struct twl4030_usb_data ldp_usb_data = {
298
.usb_mode = T2_USB_MODE_ULPI,
301
202
static struct twl4030_gpio_platform_data ldp_gpio_data = {
302
203
.gpio_base = OMAP_MAX_GPIO_LINES,
303
204
.irq_base = TWL4030_GPIO_IRQ_BASE,
304
205
.irq_end = TWL4030_GPIO_IRQ_END,
307
static struct twl4030_madc_platform_data ldp_madc_data = {
311
208
static struct regulator_consumer_supply ldp_vmmc1_supply = {
312
209
.supply = "vmmc",
350
247
static struct twl4030_platform_data ldp_twldata = {
351
.irq_base = TWL4030_IRQ_BASE,
352
.irq_end = TWL4030_IRQ_END,
354
248
/* platform_data for children goes here */
355
.madc = &ldp_madc_data,
356
.usb = &ldp_usb_data,
357
249
.vmmc1 = &ldp_vmmc1,
358
250
.vaux1 = &ldp_vaux1,
359
251
.gpio = &ldp_gpio_data,
360
252
.keypad = &ldp_kp_twl4030_data,
363
static struct i2c_board_info __initdata ldp_i2c_boardinfo[] = {
365
I2C_BOARD_INFO("twl4030", 0x48),
366
.flags = I2C_CLIENT_WAKE,
367
.irq = INT_34XX_SYS_NIRQ,
368
.platform_data = &ldp_twldata,
372
255
static int __init omap_i2c_init(void)
374
omap_register_i2c_bus(1, 2600, ldp_i2c_boardinfo,
375
ARRAY_SIZE(ldp_i2c_boardinfo));
257
omap3_pmic_get_config(&ldp_twldata,
258
TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC, 0);
259
omap3_pmic_init("twl4030", &ldp_twldata);
376
260
omap_register_i2c_bus(2, 400, NULL, 0);
377
261
omap_register_i2c_bus(3, 400, NULL, 0);
446
323
ldp_init_smsc911x();
448
325
platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
450
ldp_spi_board_info[0].irq = gpio_to_irq(ts_gpio);
451
spi_register_board_info(ldp_spi_board_info,
452
ARRAY_SIZE(ldp_spi_board_info));
326
omap_ads7846_init(1, 54, 310, NULL);
454
327
omap_serial_init();
455
usb_musb_init(&musb_board_data);
456
329
board_nand_init(ldp_nand_partitions,
457
330
ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0);