|  | @@ -161,3 +161,187 @@ static struct regulator_init_data omap3stalker_vmmc1 = {
 | 
	
		
			
				|  |  |  	.num_consumer_supplies	= ARRAY_SIZE(omap3stalker_vmmc1_supply),
 | 
	
		
			
				|  |  |  	.consumer_supplies	= omap3stalker_vmmc1_supply,
 | 
	
		
			
				|  |  |  };
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */
 | 
	
		
			
				|  |  | +static struct regulator_init_data omap3stalker_vsim = {
 | 
	
		
			
				|  |  | +	.constraints		= {
 | 
	
		
			
				|  |  | +		.min_uV			= 1800000,
 | 
	
		
			
				|  |  | +		.max_uV			= 3000000,
 | 
	
		
			
				|  |  | +		.valid_modes_mask	= REGULATOR_MODE_NORMAL
 | 
	
		
			
				|  |  | +		| REGULATOR_MODE_STANDBY,
 | 
	
		
			
				|  |  | +		.valid_ops_mask		= REGULATOR_CHANGE_VOLTAGE
 | 
	
		
			
				|  |  | +		| REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,
 | 
	
		
			
				|  |  | +	},
 | 
	
		
			
				|  |  | +	.num_consumer_supplies	= ARRAY_SIZE(omap3stalker_vsim_supply),
 | 
	
		
			
				|  |  | +	.consumer_supplies	= omap3stalker_vsim_supply,
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct omap2_hsmmc_info mmc[] = {
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +		.mmc		= 1,
 | 
	
		
			
				|  |  | +		.caps		= MMC_CAP_4_BIT_DATA,
 | 
	
		
			
				|  |  | +		.gpio_cd	= -EINVAL,
 | 
	
		
			
				|  |  | +		.gpio_wp	= 23,
 | 
	
		
			
				|  |  | +		.deferred	= true,
 | 
	
		
			
				|  |  | +	 },
 | 
	
		
			
				|  |  | +	{}			/* Terminator */
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct gpio_keys_button gpio_buttons[] = {
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +	 .code		= BTN_EXTRA,
 | 
	
		
			
				|  |  | +	 .gpio		= 18,
 | 
	
		
			
				|  |  | +	 .desc		= "user",
 | 
	
		
			
				|  |  | +	 .wakeup	= 1,
 | 
	
		
			
				|  |  | +	 },
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct gpio_keys_platform_data gpio_key_info = {
 | 
	
		
			
				|  |  | +	.buttons	= gpio_buttons,
 | 
	
		
			
				|  |  | +	.nbuttons	= ARRAY_SIZE(gpio_buttons),
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct platform_device keys_gpio = {
 | 
	
		
			
				|  |  | +	.name		= "gpio-keys",
 | 
	
		
			
				|  |  | +	.id		= -1,
 | 
	
		
			
				|  |  | +	.dev		= {
 | 
	
		
			
				|  |  | +		.platform_data	= &gpio_key_info,
 | 
	
		
			
				|  |  | +	},
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct gpio_led gpio_leds[] = {
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +	 .name			= "stalker:D8:usr0",
 | 
	
		
			
				|  |  | +	 .default_trigger	= "default-on",
 | 
	
		
			
				|  |  | +	 .gpio			= 126,
 | 
	
		
			
				|  |  | +	 },
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +	 .name			= "stalker:D9:usr1",
 | 
	
		
			
				|  |  | +	 .default_trigger	= "default-on",
 | 
	
		
			
				|  |  | +	 .gpio			= 127,
 | 
	
		
			
				|  |  | +	 },
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +	 .name			= "stalker:D3:mmc0",
 | 
	
		
			
				|  |  | +	 .gpio			= -EINVAL,	/* gets replaced */
 | 
	
		
			
				|  |  | +	 .active_low		= true,
 | 
	
		
			
				|  |  | +	 .default_trigger	= "mmc0",
 | 
	
		
			
				|  |  | +	 },
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +	 .name			= "stalker:D4:heartbeat",
 | 
	
		
			
				|  |  | +	 .gpio			= -EINVAL,	/* gets replaced */
 | 
	
		
			
				|  |  | +	 .active_low		= true,
 | 
	
		
			
				|  |  | +	 .default_trigger	= "heartbeat",
 | 
	
		
			
				|  |  | +	 },
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct gpio_led_platform_data gpio_led_info = {
 | 
	
		
			
				|  |  | +	.leds		= gpio_leds,
 | 
	
		
			
				|  |  | +	.num_leds	= ARRAY_SIZE(gpio_leds),
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct platform_device leds_gpio = {
 | 
	
		
			
				|  |  | +	.name	= "leds-gpio",
 | 
	
		
			
				|  |  | +	.id	= -1,
 | 
	
		
			
				|  |  | +	.dev	= {
 | 
	
		
			
				|  |  | +		.platform_data	= &gpio_led_info,
 | 
	
		
			
				|  |  | +	},
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static int
 | 
	
		
			
				|  |  | +omap3stalker_twl_gpio_setup(struct device *dev,
 | 
	
		
			
				|  |  | +			    unsigned gpio, unsigned ngpio)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	/* gpio + 0 is "mmc0_cd" (input/IRQ) */
 | 
	
		
			
				|  |  | +	mmc[0].gpio_cd = gpio + 0;
 | 
	
		
			
				|  |  | +	omap_hsmmc_late_init(mmc);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	/*
 | 
	
		
			
				|  |  | +	 * Most GPIOs are for USB OTG.  Some are mostly sent to
 | 
	
		
			
				|  |  | +	 * the P2 connector; notably LEDA for the LCD backlight.
 | 
	
		
			
				|  |  | +	 */
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	/* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */
 | 
	
		
			
				|  |  | +	gpio_request_one(gpio + TWL4030_GPIO_MAX, GPIOF_OUT_INIT_LOW,
 | 
	
		
			
				|  |  | +			 "EN_LCD_BKL");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	/* gpio + 7 == DVI Enable */
 | 
	
		
			
				|  |  | +	gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "EN_DVI");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	/* TWL4030_GPIO_MAX + 1 == ledB (out, mmc0) */
 | 
	
		
			
				|  |  | +	gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
 | 
	
		
			
				|  |  | +	/* GPIO + 13 == ledsync (out, heartbeat) */
 | 
	
		
			
				|  |  | +	gpio_leds[3].gpio = gpio + 13;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	platform_device_register(&leds_gpio);
 | 
	
		
			
				|  |  | +	return 0;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct twl4030_gpio_platform_data omap3stalker_gpio_data = {
 | 
	
		
			
				|  |  | +	.use_leds	= true,
 | 
	
		
			
				|  |  | +	.setup		= omap3stalker_twl_gpio_setup,
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static uint32_t board_keymap[] = {
 | 
	
		
			
				|  |  | +	KEY(0, 0, KEY_LEFT),
 | 
	
		
			
				|  |  | +	KEY(0, 1, KEY_DOWN),
 | 
	
		
			
				|  |  | +	KEY(0, 2, KEY_ENTER),
 | 
	
		
			
				|  |  | +	KEY(0, 3, KEY_M),
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	KEY(1, 0, KEY_RIGHT),
 | 
	
		
			
				|  |  | +	KEY(1, 1, KEY_UP),
 | 
	
		
			
				|  |  | +	KEY(1, 2, KEY_I),
 | 
	
		
			
				|  |  | +	KEY(1, 3, KEY_N),
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	KEY(2, 0, KEY_A),
 | 
	
		
			
				|  |  | +	KEY(2, 1, KEY_E),
 | 
	
		
			
				|  |  | +	KEY(2, 2, KEY_J),
 | 
	
		
			
				|  |  | +	KEY(2, 3, KEY_O),
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	KEY(3, 0, KEY_B),
 | 
	
		
			
				|  |  | +	KEY(3, 1, KEY_F),
 | 
	
		
			
				|  |  | +	KEY(3, 2, KEY_K),
 | 
	
		
			
				|  |  | +	KEY(3, 3, KEY_P)
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct matrix_keymap_data board_map_data = {
 | 
	
		
			
				|  |  | +	.keymap		= board_keymap,
 | 
	
		
			
				|  |  | +	.keymap_size	= ARRAY_SIZE(board_keymap),
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct twl4030_keypad_data omap3stalker_kp_data = {
 | 
	
		
			
				|  |  | +	.keymap_data	= &board_map_data,
 | 
	
		
			
				|  |  | +	.rows		= 4,
 | 
	
		
			
				|  |  | +	.cols		= 4,
 | 
	
		
			
				|  |  | +	.rep		= 1,
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct twl4030_platform_data omap3stalker_twldata = {
 | 
	
		
			
				|  |  | +	/* platform_data for children goes here */
 | 
	
		
			
				|  |  | +	.keypad		= &omap3stalker_kp_data,
 | 
	
		
			
				|  |  | +	.gpio		= &omap3stalker_gpio_data,
 | 
	
		
			
				|  |  | +	.vmmc1		= &omap3stalker_vmmc1,
 | 
	
		
			
				|  |  | +	.vsim		= &omap3stalker_vsim,
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct at24_platform_data fram_info = {
 | 
	
		
			
				|  |  | +	.byte_len	= (64 * 1024) / 8,
 | 
	
		
			
				|  |  | +	.page_size	= 8192,
 | 
	
		
			
				|  |  | +	.flags		= AT24_FLAG_ADDR16 | AT24_FLAG_IRUGO,
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct i2c_board_info __initdata omap3stalker_i2c_boardinfo3[] = {
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +	 I2C_BOARD_INFO("24c64", 0x50),
 | 
	
		
			
				|  |  | +	 .flags		= I2C_CLIENT_WAKE,
 | 
	
		
			
				|  |  | +	 .platform_data	= &fram_info,
 | 
	
		
			
				|  |  | +	 },
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static int __init omap3_stalker_i2c_init(void)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	omap3_pmic_get_config(&omap3stalker_twldata,
 | 
	
		
			
				|  |  | +			TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC |
 | 
	
		
			
				|  |  | +			TWL_COMMON_PDATA_AUDIO,
 | 
	
		
			
				|  |  | +			TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	omap3stalker_twldata.vdac->constraints.apply_uV = true;
 |