diff options
author | Alex Odorovic <aodorovic@nvidia.com> | 2011-05-23 03:42:27 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:47:05 -0800 |
commit | 4d6c8d91a95eecb14b1e76a3b2a9a14f42541bb2 (patch) | |
tree | 2d60a46a2fe5701662bc1eaf390070fc8c8a4453 /arch/arm/mach-tegra/board-enterprise-panel.c | |
parent | 6709402a95f00e4ecc08a3f369080509c5867b95 (diff) |
arm: tegra: enterprise: Controls for 3d barrier
Adds userspace control for 3d barrier on 3d panel found on enterprise.
Provides 2 sysfs files:
/sys/devices/nvhost/tergradc/stereo_mode
/sys/devices/nvhost/tergradc/stereo_orientation
These are used to enable/disable 3d barrier and control it's
orientation, respectively.
Original-Change-Id: I580f0992c19cbee9a695bac9bef503c9888abc83
Reviewed-on: http://git-master/r/32575
Reviewed-by: Niket Sirsi <nsirsi@nvidia.com>
Tested-by: Niket Sirsi <nsirsi@nvidia.com>
Rebase-Id: Rf97ba4335f3f79697159c574ef00cbdd8330b1b6
Diffstat (limited to 'arch/arm/mach-tegra/board-enterprise-panel.c')
-rw-r--r-- | arch/arm/mach-tegra/board-enterprise-panel.c | 60 |
1 files changed, 53 insertions, 7 deletions
diff --git a/arch/arm/mach-tegra/board-enterprise-panel.c b/arch/arm/mach-tegra/board-enterprise-panel.c index d87264a9a9d5..3cf20f022e7e 100644 --- a/arch/arm/mach-tegra/board-enterprise-panel.c +++ b/arch/arm/mach-tegra/board-enterprise-panel.c @@ -43,15 +43,21 @@ #define DSI_PANEL_RESET 0 #define enterprise_lvds_shutdown TEGRA_GPIO_PL2 -#define enterprise_bl_enb TEGRA_GPIO_PH2 -#define enterprise_bl_pwm TEGRA_GPIO_PH0 #define enterprise_hdmi_hpd TEGRA_GPIO_PN7 #define enterprise_dsi_panel_reset TEGRA_GPIO_PW0 -static struct regulator *enterprise_hdmi_reg = NULL; -static struct regulator *enterprise_hdmi_pll = NULL; -static struct regulator *enterprise_hdmi_vddio = NULL; +#define enterprise_lcd_2d_3d TEGRA_GPIO_PH1 +#define ENTERPRISE_STEREO_3D 0 +#define ENTERPRISE_STEREO_2D 1 + +#define enterprise_lcd_swp_pl TEGRA_GPIO_PH2 +#define ENTERPRISE_STEREO_LANDSCAPE 0 +#define ENTERPRISE_STEREO_PORTRAIT 1 + +static struct regulator *enterprise_hdmi_reg; +static struct regulator *enterprise_hdmi_pll; +static struct regulator *enterprise_hdmi_vddio; static atomic_t sd_brightness = ATOMIC_INIT(255); @@ -292,6 +298,30 @@ static int enterprise_dsi_panel_disable(void) return 0; } +static void enterprise_stereo_set_mode(int mode) +{ + switch (mode) { + case TEGRA_DC_STEREO_MODE_2D: + gpio_set_value(TEGRA_GPIO_PH1, ENTERPRISE_STEREO_2D); + break; + case TEGRA_DC_STEREO_MODE_3D: + gpio_set_value(TEGRA_GPIO_PH1, ENTERPRISE_STEREO_3D); + break; + } +} + +static void enterprise_stereo_set_orientation(int mode) +{ + switch (mode) { + case TEGRA_DC_STEREO_LANDSCAPE: + gpio_set_value(TEGRA_GPIO_PH2, ENTERPRISE_STEREO_LANDSCAPE); + break; + case TEGRA_DC_STEREO_PORTRAIT: + gpio_set_value(TEGRA_GPIO_PH2, ENTERPRISE_STEREO_PORTRAIT); + break; + } +} + static struct tegra_dsi_cmd dsi_init_cmd[]= { DSI_CMD_SHORT(0x05, 0x11, 0x00), DSI_DLY_MS(150), @@ -313,6 +343,11 @@ struct tegra_dsi_out enterprise_dsi = { .video_data_type = TEGRA_DSI_VIDEO_TYPE_COMMAND_MODE, }; +static struct tegra_stereo_out enterprise_stereo = { + .set_mode = &enterprise_stereo_set_mode, + .set_orientation = &enterprise_stereo_set_orientation, +}; + static struct tegra_dc_mode enterprise_dsi_modes[] = { { .pclk = 10000000, @@ -345,10 +380,11 @@ static struct tegra_dc_out enterprise_disp1_out = { .type = TEGRA_DC_OUT_DSI, - .modes = enterprise_dsi_modes, - .n_modes = ARRAY_SIZE(enterprise_dsi_modes), + .modes = enterprise_dsi_modes, + .n_modes = ARRAY_SIZE(enterprise_dsi_modes), .dsi = &enterprise_dsi, + .stereo = &enterprise_stereo, .enable = enterprise_dsi_panel_enable, .disable = enterprise_dsi_panel_disable, @@ -425,6 +461,16 @@ int __init enterprise_panel_init(void) gpio_request(enterprise_hdmi_hpd, "hdmi_hpd"); gpio_direction_input(enterprise_hdmi_hpd); + tegra_gpio_enable(enterprise_lcd_2d_3d); + gpio_request(enterprise_lcd_2d_3d, "lcd_2d_3d"); + gpio_direction_output(enterprise_lcd_2d_3d, 0); + enterprise_stereo_set_mode(enterprise_stereo.mode_2d_3d); + + tegra_gpio_enable(enterprise_lcd_swp_pl); + gpio_request(enterprise_lcd_swp_pl, "lcd_swp_pl"); + gpio_direction_output(enterprise_lcd_swp_pl, 0); + enterprise_stereo_set_orientation(enterprise_stereo.orientation); + tegra_gpio_disable(TEGRA_GPIO_PW1); err = platform_add_devices(enterprise_gfx_devices, |