summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-enterprise-panel.c
diff options
context:
space:
mode:
authorKevin Huang <kevinh@nvidia.com>2012-06-20 10:34:29 -0700
committerSimone Willett <swillett@nvidia.com>2012-06-27 17:41:50 -0700
commit8192e9996b7a32b8aef49f18b8d72cdc43b71ee3 (patch)
tree834a0335376e9224b42b23903ea4f279ec4b75a8 /arch/arm/mach-tegra/board-enterprise-panel.c
parent2706d59f63e2897959362f2f1a1be840801ada90 (diff)
arm: tegra: enterprise: Add support to externel pwm.
Bug 995402 Change-Id: I53e9f1801d3b37626abb89c67b4e63662dab8c65 Reviewed-on: http://git-master/r/111306 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/board-enterprise-panel.c')
-rw-r--r--arch/arm/mach-tegra/board-enterprise-panel.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/board-enterprise-panel.c b/arch/arm/mach-tegra/board-enterprise-panel.c
index 97a2294e6f5b..9561e5ad0406 100644
--- a/arch/arm/mach-tegra/board-enterprise-panel.c
+++ b/arch/arm/mach-tegra/board-enterprise-panel.c
@@ -26,6 +26,7 @@
#include <linux/platform_device.h>
#include <linux/earlysuspend.h>
#include <linux/tegra_pwm_bl.h>
+#include <linux/pwm_backlight.h>
#include <asm/atomic.h>
#include <linux/nvhost.h>
#include <linux/nvmap.h>
@@ -62,6 +63,8 @@
#define enterprise_lcd_te TEGRA_GPIO_PJ1
+#define enterprise_bl_pwm TEGRA_GPIO_PH3
+
#ifdef CONFIG_TEGRA_DC
static struct regulator *enterprise_dsi_reg;
static bool dsi_regulator_status;
@@ -166,6 +169,17 @@ static int enterprise_backlight_notify(struct device *unused, int brightness)
static int enterprise_disp1_check_fb(struct device *dev, struct fb_info *info);
+#if IS_EXTERNAL_PWM
+static struct platform_pwm_backlight_data enterprise_disp1_backlight_data = {
+ .pwm_id = 3,
+ .max_brightness = 255,
+ .dft_brightness = 224,
+ .pwm_period_ns = 1000000,
+ .notify = enterprise_backlight_notify,
+ /* Only toggle backlight on fb blank notifications for disp1 */
+ .check_fb = enterprise_disp1_check_fb,
+};
+#else
/*
* In case which_pwm is TEGRA_PWM_PM0,
* gpio_conf_to_sfio should be TEGRA_GPIO_PW0: set LCD_CS1_N pin to SFIO
@@ -186,9 +200,15 @@ static struct platform_tegra_pwm_backlight_data enterprise_disp1_backlight_data
/* Only toggle backlight on fb blank notifications for disp1 */
.check_fb = enterprise_disp1_check_fb,
};
+#endif
+
static struct platform_device enterprise_disp1_backlight_device = {
+#if IS_EXTERNAL_PWM
+ .name = "pwm-backlight",
+#else
.name = "tegra-pwm-bl",
+#endif
.id = -1,
.dev = {
.platform_data = &enterprise_disp1_backlight_data,
@@ -511,8 +531,11 @@ static int enterprise_dsi_panel_enable(void)
if (ret)
return ret;
-#if DSI_PANEL_RESET
+#if IS_EXTERNAL_PWM
+ tegra_gpio_disable(enterprise_bl_pwm);
+#endif
+#if DSI_PANEL_RESET
if (board_info.fab >= BOARD_FAB_A03) {
if (enterprise_lcd_reg == NULL) {
enterprise_lcd_reg = regulator_get(NULL, "lcd_vddio_en");
@@ -795,7 +818,11 @@ static struct platform_device *enterprise_gfx_devices[] __initdata = {
#if defined(CONFIG_TEGRA_NVMAP)
&enterprise_nvmap_device,
#endif
+#if IS_EXTERNAL_PWM
+ &tegra_pwfm3_device,
+#else
&tegra_pwfm0_device,
+#endif
};
static struct platform_device *enterprise_bl_devices[] = {
@@ -846,7 +873,9 @@ int __init enterprise_panel_init(void)
BUILD_BUG_ON(ARRAY_SIZE(enterprise_bl_output_measured_a02) != 256);
if (board_info.fab >= BOARD_FAB_A03) {
+#if !(IS_EXTERNAL_PWM)
enterprise_disp1_backlight_data.clk_div = 0x1D;
+#endif
bl_output = enterprise_bl_output_measured_a03;
} else
bl_output = enterprise_bl_output_measured_a02;