From: Dan Murphy Date: Thu, 20 May 2010 20:38:33 +0000 (-0500) Subject: [ARM] tegra: stingray: Add backlight to the panel board file X-Git-Tag: firefly_0821_release~9834^2~900 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=455c9f88bdccca1722276738b565041a51dc085d;p=firefly-linux-kernel-4.4.55.git [ARM] tegra: stingray: Add backlight to the panel board file The current display is GPIO driven for the display backlight. There will be newer displays that will no longer need this mechanism. This code can be tagged for future removal Change-Id: Id8d9fc7699172e7a8bbfd889302af76b6a370a11 Signed-off-by: Dan Murphy --- diff --git a/arch/arm/mach-tegra/board-stingray-panel.c b/arch/arm/mach-tegra/board-stingray-panel.c index 93a6d6553314..52b06f398543 100644 --- a/arch/arm/mach-tegra/board-stingray-panel.c +++ b/arch/arm/mach-tegra/board-stingray-panel.c @@ -14,6 +14,8 @@ * */ +#include +#include #include #include #include @@ -21,6 +23,10 @@ #include #include +#include "gpio-names.h" + +#define STINGRAY_AUO_DISP_BL TEGRA_GPIO_PD0 + /* Framebuffer */ static struct resource fb_resource[] = { [0] = { @@ -49,16 +55,49 @@ static struct tegra_fb_lcd_data tegra_fb_lcd_platform_data = { }; static struct platform_device tegra_fb_device = { - .name = "tegrafb", - .id = 0, - .resource = fb_resource, - .num_resources = ARRAY_SIZE(fb_resource), + .name = "tegrafb", + .id = 0, + .resource = fb_resource, + .num_resources = ARRAY_SIZE(fb_resource), .dev = { .platform_data = &tegra_fb_lcd_platform_data, }, }; -int __init stingray_panel_init(void) { +static void stingray_backlight_enable(void) +{ + gpio_set_value(STINGRAY_AUO_DISP_BL, 1); +} + +static void stingray_backlight_disable(void) +{ + gpio_set_value(STINGRAY_AUO_DISP_BL, 0); +} + +struct auo_panel_bl_platform_data stingray_auo_backlight_data = { + .bl_enable = stingray_backlight_enable, + .bl_disable = stingray_backlight_disable, + .pwm_enable = NULL, + .pwm_disable = NULL, +}; + +static struct platform_device stingray_panel_bl_driver = { + .name = LD_AUO_PANEL_BL_NAME, + .id = -1, + .dev = { + .platform_data = &stingray_auo_backlight_data, + }, +}; + +int __init stingray_panel_init(void) +{ + /* Display backlight control */ + tegra_gpio_enable(STINGRAY_AUO_DISP_BL); + gpio_request(STINGRAY_AUO_DISP_BL, "auo_disp_bl"); + gpio_direction_output(STINGRAY_AUO_DISP_BL, 1); + + platform_device_register(&stingray_panel_bl_driver); + return platform_device_register(&tegra_fb_device); }