From 5d9a88f44a93daf623906fee7ca20fa396460ae2 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 1 Oct 2018 12:22:40 -0600 Subject: test: panel: Add a test for the panel uclass At present this uclass has no tests. Add a simple one which checks the PWM configuration, regulator and GPIO. Signed-off-by: Simon Glass --- arch/sandbox/include/asm/test.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'arch/sandbox/include/asm/test.h') diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h index 89f3d90c73..8e60f80ae7 100644 --- a/arch/sandbox/include/asm/test.h +++ b/arch/sandbox/include/asm/test.h @@ -98,4 +98,19 @@ int sandbox_usb_keyb_add_string(struct udevice *dev, const char *str); * @buflen: length of buffer in bytes */ int sandbox_osd_get_mem(struct udevice *dev, u8 *buf, size_t buflen); + +/** + * sandbox_pwm_get_config() - get the PWM config for a channel + * + * @dev: Device to check + * @channel: Channel number to check + * @period_ns: Period of the PWM in nanoseconds + * @duty_ns: Current duty cycle of the PWM in nanoseconds + * @enable: true if the PWM is enabled + * @polarity: true if the PWM polarity is active high + * @return 0 if OK, -ENOSPC if the PWM number is invalid + */ +int sandbox_pwm_get_config(struct udevice *dev, uint channel, uint *period_nsp, + uint *duty_nsp, bool *enablep, bool *polarityp); + #endif -- cgit