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:
@@ -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
20
cmd/backlight.c
Normal 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");
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user