1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-08-31 08:12:06 +02:00

cmd: Allow to turn on backlight on demand

This commit is contained in:
Ondrej Jirman
2019-11-20 01:10:03 +01:00
parent 3219f41e7b
commit 9bb6a71b71
3 changed files with 23 additions and 2 deletions

View File

@@ -17,6 +17,7 @@ obj-$(CONFIG_CMD_AB_SELECT) += ab_select.o
obj-$(CONFIG_CMD_ADC) += adc.o
obj-$(CONFIG_CMD_ARMFLASH) += armflash.o
obj-$(CONFIG_HAVE_BLOCK_DEVICE) += blk_common.o
obj-$(CONFIG_DM_VIDEO) += backlight.o
obj-$(CONFIG_CMD_SOURCE) += source.o
obj-$(CONFIG_CMD_BCB) += bcb.o
obj-$(CONFIG_CMD_BDI) += bdinfo.o

20
cmd/backlight.c Normal file
View File

@@ -0,0 +1,20 @@
// SPDX-License-Identifier: GPL-2.0+
#include <common.h>
#include <command.h>
#include <dm.h>
#include <backlight.h>
static int do_backlight(cmd_tbl_t *cmdtp, int flag, int argc,
char *const argv[])
{
struct udevice *backlight;
int ret;
ret = uclass_get_device(UCLASS_PANEL_BACKLIGHT, 0, &backlight);
if (!ret)
backlight_enable(backlight);
return CMD_RET_SUCCESS;
}
U_BOOT_CMD(backlight_on, 1, 1, do_backlight, "Backlight", " - enable backlightpanel devices");

View File

@@ -67,11 +67,11 @@ static int sunxi_lcd_enable(struct udevice *dev, int bpp,
lcdc_tcon0_mode_set(lcdc, edid, clk_div, false,
priv->panel_bpp, CONFIG_VIDEO_LCD_DCLK_PHASE);
lcdc_enable(lcdc, priv->panel_bpp);
/*
ret = uclass_get_device(UCLASS_PANEL_BACKLIGHT, 0, &backlight);
if (!ret)
backlight_enable(backlight);
*/
return 0;
}