diff options
Diffstat (limited to 'arch/arm/mach-tegra/board-enterprise-panel.c')
-rw-r--r-- | arch/arm/mach-tegra/board-enterprise-panel.c | 58 |
1 files changed, 37 insertions, 21 deletions
diff --git a/arch/arm/mach-tegra/board-enterprise-panel.c b/arch/arm/mach-tegra/board-enterprise-panel.c index 8ac2e665addb..837635bf0731 100644 --- a/arch/arm/mach-tegra/board-enterprise-panel.c +++ b/arch/arm/mach-tegra/board-enterprise-panel.c @@ -26,9 +26,10 @@ #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 <mach/nvmap.h> +#include <linux/nvmap.h> #include <mach/irqs.h> #include <mach/iomap.h> #include <mach/dc.h> @@ -39,6 +40,7 @@ #include "board-enterprise.h" #include "devices.h" #include "gpio-names.h" +#include "tegra3_host1x_devices.h" #define DC_CTRL_MODE TEGRA_DC_OUT_ONE_SHOT_MODE @@ -61,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; @@ -165,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 @@ -175,7 +190,6 @@ static struct platform_tegra_pwm_backlight_data enterprise_disp1_backlight_data .which_dc = 0, .which_pwm = TEGRA_PWM_PM1, .gpio_conf_to_sfio = TEGRA_GPIO_PW1, - .switch_to_sfio = &tegra_gpio_disable, .max_brightness = 255, .dft_brightness = 224, .notify = enterprise_backlight_notify, @@ -185,9 +199,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, @@ -510,8 +530,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"); @@ -541,7 +564,6 @@ static int enterprise_dsi_panel_enable(void) gpio_free(enterprise_dsi_panel_reset); return ret; } - tegra_gpio_enable(enterprise_dsi_panel_reset); gpio_set_value(enterprise_dsi_panel_reset, 0); udelay(2000); @@ -560,7 +582,6 @@ static int enterprise_dsi_panel_disable(void) #if DSI_PANEL_RESET if (kernel_1st_panel_init != true) { - tegra_gpio_disable(enterprise_dsi_panel_reset); gpio_free(enterprise_dsi_panel_reset); } else kernel_1st_panel_init = false; @@ -796,7 +817,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[] = { @@ -816,17 +841,10 @@ static void enterprise_panel_early_suspend(struct early_suspend *h) fb_blank(registered_fb[0], FB_BLANK_POWERDOWN); if (num_registered_fb > 1) fb_blank(registered_fb[1], FB_BLANK_NORMAL); -#ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND - cpufreq_save_default_governor(); - cpufreq_set_conservative_governor(); - cpufreq_set_conservative_governor_param("up_threshold", - SET_CONSERVATIVE_GOVERNOR_UP_THRESHOLD); - - cpufreq_set_conservative_governor_param("down_threshold", - SET_CONSERVATIVE_GOVERNOR_DOWN_THRESHOLD); - cpufreq_set_conservative_governor_param("freq_step", - SET_CONSERVATIVE_GOVERNOR_FREQ_STEP); +#ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND + cpufreq_store_default_gov(); + cpufreq_change_gov(cpufreq_conservative_gov); #endif } @@ -835,7 +853,7 @@ static void enterprise_panel_late_resume(struct early_suspend *h) unsigned i; #ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND - cpufreq_restore_default_governor(); + cpufreq_restore_default_gov(); #endif for (i = 0; i < num_registered_fb; i++) fb_blank(registered_fb[i], FB_BLANK_UNBLANK); @@ -854,7 +872,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; @@ -867,22 +887,18 @@ int __init enterprise_panel_init(void) enterprise_carveouts[1].size = tegra_carveout_size; #endif - tegra_gpio_enable(enterprise_hdmi_hpd); 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); #if !(DC_CTRL_MODE & TEGRA_DC_OUT_ONE_SHOT_MODE) - tegra_gpio_enable(enterprise_lcd_te); gpio_request(enterprise_lcd_swp_pl, "lcd_te"); gpio_direction_input(enterprise_lcd_te); #endif @@ -895,7 +911,7 @@ int __init enterprise_panel_init(void) #endif #ifdef CONFIG_TEGRA_GRHOST - err = nvhost_device_register(&tegra_grhost_device); + err = tegra3_register_host1x_devices(); if (err) return err; #endif |