|  | @@ -116,3 +116,84 @@ static int __init am3517_evm_i2c_init(void)
 | 
	
		
			
				|  |  |  	omap_register_i2c_bus(2, 400, am3517evm_i2c2_boardinfo,
 | 
	
		
			
				|  |  |  			ARRAY_SIZE(am3517evm_i2c2_boardinfo));
 | 
	
		
			
				|  |  |  	omap_register_i2c_bus(3, 400, am3517evm_i2c3_boardinfo,
 | 
	
		
			
				|  |  | +			ARRAY_SIZE(am3517evm_i2c3_boardinfo));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	return 0;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static int lcd_enabled;
 | 
	
		
			
				|  |  | +static int dvi_enabled;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
 | 
	
		
			
				|  |  | +		defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
 | 
	
		
			
				|  |  | +static struct gpio am3517_evm_dss_gpios[] __initdata = {
 | 
	
		
			
				|  |  | +	/* GPIO 182 = LCD Backlight Power */
 | 
	
		
			
				|  |  | +	{ LCD_PANEL_BKLIGHT_PWR, GPIOF_OUT_INIT_HIGH, "lcd_backlight_pwr" },
 | 
	
		
			
				|  |  | +	/* GPIO 181 = LCD Panel PWM */
 | 
	
		
			
				|  |  | +	{ LCD_PANEL_PWM,	 GPIOF_OUT_INIT_HIGH, "lcd bl enable"	  },
 | 
	
		
			
				|  |  | +	/* GPIO 176 = LCD Panel Power enable pin */
 | 
	
		
			
				|  |  | +	{ LCD_PANEL_PWR,	 GPIOF_OUT_INIT_HIGH, "dvi enable"	  },
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static void __init am3517_evm_display_init(void)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	int r;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	omap_mux_init_gpio(LCD_PANEL_PWR, OMAP_PIN_INPUT_PULLUP);
 | 
	
		
			
				|  |  | +	omap_mux_init_gpio(LCD_PANEL_BKLIGHT_PWR, OMAP_PIN_INPUT_PULLDOWN);
 | 
	
		
			
				|  |  | +	omap_mux_init_gpio(LCD_PANEL_PWM, OMAP_PIN_INPUT_PULLDOWN);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	r = gpio_request_array(am3517_evm_dss_gpios,
 | 
	
		
			
				|  |  | +			       ARRAY_SIZE(am3517_evm_dss_gpios));
 | 
	
		
			
				|  |  | +	if (r) {
 | 
	
		
			
				|  |  | +		printk(KERN_ERR "failed to get DSS panel control GPIOs\n");
 | 
	
		
			
				|  |  | +		return;
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	printk(KERN_INFO "Display initialized successfully\n");
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +#else
 | 
	
		
			
				|  |  | +static void __init am3517_evm_display_init(void) {}
 | 
	
		
			
				|  |  | +#endif
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static int am3517_evm_panel_enable_lcd(struct omap_dss_device *dssdev)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	if (dvi_enabled) {
 | 
	
		
			
				|  |  | +		printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
 | 
	
		
			
				|  |  | +		return -EINVAL;
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +	gpio_set_value(LCD_PANEL_PWR, 1);
 | 
	
		
			
				|  |  | +	lcd_enabled = 1;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	return 0;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	gpio_set_value(LCD_PANEL_PWR, 0);
 | 
	
		
			
				|  |  | +	lcd_enabled = 0;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct panel_generic_dpi_data lcd_panel = {
 | 
	
		
			
				|  |  | +	.name			= "sharp_lq",
 | 
	
		
			
				|  |  | +	.platform_enable	= am3517_evm_panel_enable_lcd,
 | 
	
		
			
				|  |  | +	.platform_disable	= am3517_evm_panel_disable_lcd,
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct omap_dss_device am3517_evm_lcd_device = {
 | 
	
		
			
				|  |  | +	.type			= OMAP_DISPLAY_TYPE_DPI,
 | 
	
		
			
				|  |  | +	.name			= "lcd",
 | 
	
		
			
				|  |  | +	.driver_name		= "generic_dpi_panel",
 | 
	
		
			
				|  |  | +	.data			= &lcd_panel,
 | 
	
		
			
				|  |  | +	.phy.dpi.data_lines 	= 16,
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static int am3517_evm_panel_enable_tv(struct omap_dss_device *dssdev)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	return 0;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static void am3517_evm_panel_disable_tv(struct omap_dss_device *dssdev)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 |