From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Wed, 19 May 2021 09:32:20 -0600 Subject: [PATCH] sandbox: cros-ec: Add tests for the cros-ec-pwm driver In-Reply-To: <20210516154144.141945-1-alpernebiyasak@gmail.com> References: <20210516154144.141945-1-alpernebiyasak@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sun, 16 May 2021 at 09:42, Alper Nebi Yasak wrote: > > This patch lets sandbox-cros-ec emulate a limited pwm device which has > 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. > Mapping non-generic EC_PWM_TYPE_* values to these emulated pwm channels > is not implemented as nothing in U-Boot uses these types. > > This emulated pwm is then used to test the cros-ec-pwm driver in > sandbox. Adding the cros-ec-pwm 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 > --- > This depends on a small fix [1] for cros-ec-pwm which otherwise fails to > build. > > [1] https://patchwork.ozlabs.org/project/uboot/patch/20210514134840.19380-1-alpernebiyasak at gmail.com/ > > arch/sandbox/dts/test.dts | 6 +++ > arch/sandbox/include/asm/test.h | 10 +++++ > configs/sandbox64_defconfig | 1 + > configs/sandbox_defconfig | 1 + > configs/sandbox_flattree_defconfig | 1 + > configs/sandbox_noinst_defconfig | 1 + > configs/sandbox_spl_defconfig | 1 + > drivers/misc/cros_ec_sandbox.c | 47 +++++++++++++++++++++++ > test/cmd/pwm.c | 32 +++++++++++++++- > test/dm/Makefile | 1 + > test/dm/cros_ec_pwm.c | 60 ++++++++++++++++++++++++++++++ > test/dm/panel.c | 2 +- > test/dm/pwm.c | 6 ++- > 13 files changed, 164 insertions(+), 5 deletions(-) > create mode 100644 test/dm/cros_ec_pwm.c Reviewed-by: Simon Glass