veyron: move backlight gpio control to mainboard.c
we use the devicetree to pass the backlight control gpio before, but if there have different board version, and use different io to control backlight, it will hard to distinguish it. so we move the backlight control to mainboard, and we can through board_id to distinguish the backlight control. BUG=None TEST=emerge veyron_pinky and Boot the pinky board BRANCH=None Change-Id: I1ec8e04f4982c3a8c7e31d8dc2c75311b7199ffc Signed-off-by: huang lin <hl@rock-chips.com> Reviewed-on: https://chromium-review.googlesource.com/234711 Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
parent
4b5515bd00
commit
2ff7f65134
10 changed files with 39 additions and 24 deletions
|
|
@ -22,9 +22,5 @@ chip soc/rockchip/rk3288
|
|||
device cpu_cluster 0 on end
|
||||
register "vop_id" = "1"
|
||||
register "framebuffer_bits_per_pixel" = "16"
|
||||
register "lcd_bl_pwm_gpio" = "GPIO(7, A, 0)"
|
||||
register "lcd_bl_en_gpio" = "GPIO(7, A, 2)"
|
||||
register "lcd_power_on_udelay" = "200000"
|
||||
register "bl_power_on_udelay" = "1000"
|
||||
register "bl_pwm_to_enable_udelay" = "1000"
|
||||
end
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include <device/i2c.h>
|
||||
#include <edid.h>
|
||||
#include <gpio.h>
|
||||
#include <soc/display.h>
|
||||
#include <soc/grf.h>
|
||||
#include <soc/soc.h>
|
||||
#include <soc/pmu.h>
|
||||
|
|
@ -129,3 +130,11 @@ void lb_board(struct lb_header *header)
|
|||
dma->range_start = (uintptr_t)_dma_coherent;
|
||||
dma->range_size = _dma_coherent_size;
|
||||
}
|
||||
|
||||
void mainboard_power_on_backlight(void)
|
||||
{
|
||||
gpio_output(GPIO(7, A, 0), 0); /* BL_EN */
|
||||
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
|
||||
mdelay(10);
|
||||
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,9 +22,5 @@ chip soc/rockchip/rk3288
|
|||
device cpu_cluster 0 on end
|
||||
register "vop_id" = "1"
|
||||
register "framebuffer_bits_per_pixel" = "16"
|
||||
register "lcd_bl_pwm_gpio" = "GPIO(7, A, 0)"
|
||||
register "lcd_bl_en_gpio" = "GPIO(7, A, 2)"
|
||||
register "lcd_power_on_udelay" = "200000"
|
||||
register "bl_power_on_udelay" = "1000"
|
||||
register "bl_pwm_to_enable_udelay" = "1000"
|
||||
end
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include <device/i2c.h>
|
||||
#include <edid.h>
|
||||
#include <gpio.h>
|
||||
#include <soc/display.h>
|
||||
#include <soc/grf.h>
|
||||
#include <soc/soc.h>
|
||||
#include <soc/pmu.h>
|
||||
|
|
@ -129,3 +130,11 @@ void lb_board(struct lb_header *header)
|
|||
dma->range_start = (uintptr_t)_dma_coherent;
|
||||
dma->range_size = _dma_coherent_size;
|
||||
}
|
||||
|
||||
void mainboard_power_on_backlight(void)
|
||||
{
|
||||
gpio_output(GPIO(7, A, 0), 0); /* BL_EN */
|
||||
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
|
||||
mdelay(10);
|
||||
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,9 +22,5 @@ chip soc/rockchip/rk3288
|
|||
device cpu_cluster 0 on end
|
||||
register "vop_id" = "1"
|
||||
register "framebuffer_bits_per_pixel" = "16"
|
||||
register "lcd_bl_pwm_gpio" = "GPIO(7, A, 0)"
|
||||
register "lcd_bl_en_gpio" = "GPIO(7, A, 2)"
|
||||
register "lcd_power_on_udelay" = "200000"
|
||||
register "bl_power_on_udelay" = "1000"
|
||||
register "bl_pwm_to_enable_udelay" = "1000"
|
||||
end
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include <device/i2c.h>
|
||||
#include <edid.h>
|
||||
#include <gpio.h>
|
||||
#include <soc/display.h>
|
||||
#include <soc/grf.h>
|
||||
#include <soc/soc.h>
|
||||
#include <soc/pmu.h>
|
||||
|
|
@ -176,3 +177,11 @@ void lb_board(struct lb_header *header)
|
|||
dma->range_start = (uintptr_t)_dma_coherent;
|
||||
dma->range_size = _dma_coherent_size;
|
||||
}
|
||||
|
||||
void mainboard_power_on_backlight(void)
|
||||
{
|
||||
gpio_output(GPIO(7, A, 0), 0); /* BL_EN */
|
||||
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
|
||||
mdelay(10);
|
||||
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,9 +22,5 @@ chip soc/rockchip/rk3288
|
|||
device cpu_cluster 0 on end
|
||||
register "vop_id" = "1"
|
||||
register "framebuffer_bits_per_pixel" = "16"
|
||||
register "lcd_bl_pwm_gpio" = "GPIO(7, A, 0)"
|
||||
register "lcd_bl_en_gpio" = "GPIO(7, A, 2)"
|
||||
register "lcd_power_on_udelay" = "200000"
|
||||
register "bl_power_on_udelay" = "1000"
|
||||
register "bl_pwm_to_enable_udelay" = "1000"
|
||||
end
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include <device/i2c.h>
|
||||
#include <edid.h>
|
||||
#include <gpio.h>
|
||||
#include <soc/display.h>
|
||||
#include <soc/grf.h>
|
||||
#include <soc/soc.h>
|
||||
#include <soc/pmu.h>
|
||||
|
|
@ -128,3 +129,11 @@ void lb_board(struct lb_header *header)
|
|||
dma->range_start = (uintptr_t)_dma_coherent;
|
||||
dma->range_size = _dma_coherent_size;
|
||||
}
|
||||
|
||||
void mainboard_power_on_backlight(void)
|
||||
{
|
||||
gpio_output(GPIO(7, A, 0), 0); /* BL_EN */
|
||||
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
|
||||
mdelay(10);
|
||||
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,8 +82,5 @@ void rk_display_init(device_t dev, u32 lcdbase,
|
|||
}
|
||||
|
||||
set_vbe_mode_info_valid(&edid, (uintptr_t)lcdbase);
|
||||
gpio_output(conf->lcd_bl_pwm_gpio, 0);
|
||||
gpio_output(conf->lcd_bl_en_gpio, 1); /* LCD_BL */
|
||||
udelay(conf->bl_power_on_udelay);
|
||||
gpio_output(conf->lcd_bl_pwm_gpio, 1); /* BL_EN */
|
||||
mainboard_power_on_backlight();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,8 +23,6 @@
|
|||
void rk_display_init(device_t dev, u32 lcdbase,
|
||||
unsigned long fb_size);
|
||||
|
||||
void mainboard_power_on_backlight(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue