]> git.baikalelectronics.ru Git - uboot.git/commit
sandbox: cros-ec: Add tests for the Chromium OS EC PWM driver
authorAlper Nebi Yasak <alpernebiyasak@gmail.com>
Wed, 19 May 2021 16:33:31 +0000 (19:33 +0300)
committerSimon Glass <sjg@chromium.org>
Tue, 6 Jul 2021 16:38:03 +0000 (10:38 -0600)
commitaf524d0676ec2eb94814ddd589ef53d0396fb631
treeaceedee89f30d6b0a9dc7bbdc25fbd65d647e4de
parent9f4885a5797155417ced2d3cd2aae6d4174426fe
sandbox: cros-ec: Add tests for the Chromium OS EC PWM driver

This patch adds a limited pulse-width modulator to sandbox's Chromium OS
Embedded Controller emulation. The emulated PWM device supports multiple
channels but can only set a duty cycle for each, as the actual EC
doesn't expose any functionality or information other than that. Though
the EC supports specifying the PWM channel by its type (e.g. display
backlight, keyboard backlight), this is not implemented in the emulation
as nothing in U-Boot uses this type specification.

This emulated PWM device is then used to test the Chromium OS PWM driver
in sandbox. Adding the required device node to the sandbox test
device-tree unfortunately makes it the first PWM device, so this also
touches some other tests to make sure they still use the sandbox PWM.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
13 files changed:
arch/sandbox/dts/test.dts
arch/sandbox/include/asm/test.h
configs/sandbox64_defconfig
configs/sandbox_defconfig
configs/sandbox_flattree_defconfig
configs/sandbox_noinst_defconfig
configs/sandbox_spl_defconfig
drivers/misc/cros_ec_sandbox.c
test/cmd/pwm.c
test/dm/Makefile
test/dm/cros_ec_pwm.c [new file with mode: 0644]
test/dm/panel.c
test/dm/pwm.c