display: JDI: continuous screen from bootloader to kernel

1. Enable display related gpio when kernel init.
2. Config PWM to .output_value = 0 in mipi_JDI_set_backlight() function
   to prevent PWM be inverted.

Change-Id: I4b9137cf482bfe760a1a1ac3eb9d03abf0100243
Signed-off-by: yetta_wu <yetta_wu@asus.com>
This commit is contained in:
yetta_wu 2013-03-29 19:54:08 +08:00 committed by Iliyan Malchev
parent c3a2d155e9
commit 2945f0907c
2 changed files with 32 additions and 5 deletions

View file

@ -128,14 +128,14 @@ struct pm8xxx_mpp_init {
/* Initial PM8921 GPIO configurations */
static struct pm8xxx_gpio_init pm8921_gpios[] __initdata = {
PM8921_GPIO_OUTPUT(14, 1, HIGH), /* HDMI Mux Selector */
PM8921_GPIO_OUTPUT(23, 0, HIGH), /* touchscreen power FET */
PM8921_GPIO_OUTPUT(23, 1, HIGH), /* touchscreen power FET */
PM8921_GPIO_OUTPUT_BUFCONF(25, 0, LOW, CMOS), /* DISP_RESET_N */
//PM8921_GPIO_OUTPUT_FUNC(26, 0, PM_GPIO_FUNC_2), /* Bl: Off, PWM mode */
//PM8921_GPIO_OUTPUT_VIN(30, 1, PM_GPIO_VIN_VPH), /* SMB349 susp line */
PM8921_GPIO_OUTPUT_FUNC_L17(26, 0, PM_GPIO_FUNC_2), /* Bl: Off, PWM mode */
/* Bl: On, PWM mode */
PM8921_GPIO_OUTPUT_FUNC_L17(26, 1, PM_GPIO_FUNC_2),
PM8921_GPIO_OUTPUT(2, 1, HIGH), /* SLIMPORT_PWR_DWN */
PM8921_GPIO_OUTPUT(1, 0, HIGH), /* SLIMPORT_RESET_N */
PM8921_GPIO_OUTPUT_BUFCONF(36, 1, LOW, OPEN_DRAIN),
PM8921_GPIO_OUTPUT_FUNC(44, 0, PM_GPIO_FUNC_2),
PM8921_GPIO_OUTPUT(33, 0, HIGH),
PM8921_GPIO_OUTPUT(20, 0, HIGH),
@ -148,10 +148,10 @@ static struct pm8xxx_gpio_init pm8921_gpios[] __initdata = {
};
static struct pm8xxx_gpio_init pm8921_gpios_display_SR1[] __initdata = {
PM8921_GPIO_OUTPUT_L17(30, 0, LOW), /* BL_EN */
PM8921_GPIO_OUTPUT_L17(30, 1, LOW), /* BL_EN */
};
static struct pm8xxx_gpio_init pm8921_gpios_display_SR2[] __initdata = {
PM8921_GPIO_OUTPUT_L17(36, 0, LOW), /* BL_EN */
PM8921_GPIO_OUTPUT_L17(36, 1, LOW), /* BL_EN */
};
static struct pm8xxx_gpio_init pm8921_mtp_kp_gpios[] __initdata = {

View file

@ -34,9 +34,13 @@
#define gpio_LCD_BL_EN_SR2 PM8921_GPIO_PM_TO_SYS(36)
#define gpio_LCM_XRES_SR1 36 /* JDI reset pin */
#define gpio_LCM_XRES_SR2 54 /* JDI reset pin */
#define gpio_PWM PM8921_GPIO_PM_TO_SYS(26)
static int gpio_LCD_BL_EN = gpio_LCD_BL_EN_SR2;
static int gpio_LCM_XRES = gpio_LCM_XRES_SR2;
static bool first = true;
static unsigned gpio;
static struct pm_gpio config;
static struct mipi_dsi_panel_platform_data *mipi_JDI_pdata;
static struct pwm_device *bl_lpm;
@ -103,6 +107,9 @@ static int mipi_JDI_lcd_on(struct platform_device *pdev)
if (mfd->key != MFD_KEY)
return -EINVAL;
if (first) /* change first in setbacklight */
return 0;
msleep(20);
pr_info("%s, JDI display on command+\n", __func__);
@ -159,6 +166,14 @@ static void mipi_JDI_set_backlight(struct msm_fb_data_type *mfd)
pr_debug("%s: back light level %d\n", __func__, mfd->bl_level);
if (first) {
ret = pm8xxx_gpio_config(gpio, &config);
if (ret)
pr_err("%s: pm8xxx_gpio_config failed: ret=%d\n",
__func__, ret);
first = false;
}
if (bl_lpm) {
if (mfd->bl_level) {
ret = pwm_config(bl_lpm, PWM_DUTY_LEVEL *
@ -294,6 +309,18 @@ static int __devinit mipi_JDI_lcd_probe(struct platform_device *pdev)
gpio_LCM_XRES = gpio_LCM_XRES_SR1;
}
/* set PWM config */
gpio = gpio_PWM;
config.direction = PM_GPIO_DIR_OUT;
config.output_buffer = PM_GPIO_OUT_BUF_CMOS;
config.output_value = 0;
config.pull = PM_GPIO_PULL_NO;
config.vin_sel = PM_GPIO_VIN_L17;
config.out_strength = PM_GPIO_STRENGTH_HIGH;
config.function = PM_GPIO_FUNC_2;
config.inv_int_pol = 0;
config.disable_pin = 0;
pr_info("%s-\n", __func__);
return 0;
}