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 <sjg@chromium.org>
This commit is contained in:
@@ -60,7 +60,7 @@
|
||||
regulator-max-microvolt = <3300000>;
|
||||
};
|
||||
|
||||
ldo1 {
|
||||
ldo_1: ldo1 {
|
||||
regulator-name = "VDD_EMMC_1.8V";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
eth0 = "/eth@10002000";
|
||||
eth3 = ð_3;
|
||||
eth5 = ð_5;
|
||||
gpio1 = &gpio_a;
|
||||
gpio2 = &gpio_b;
|
||||
i2c0 = "/i2c@0";
|
||||
mmc0 = "/mmc0";
|
||||
mmc1 = "/mmc1";
|
||||
@@ -91,6 +93,15 @@
|
||||
reg = <2 1>;
|
||||
};
|
||||
|
||||
backlight: backlight {
|
||||
compatible = "pwm-backlight";
|
||||
enable-gpios = <&gpio_a 1>;
|
||||
power-supply = <&ldo_1>;
|
||||
pwms = <&pwm 0 1000>;
|
||||
default-brightness-level = <5>;
|
||||
brightness-levels = <0 16 32 64 128 170 202 234 255>;
|
||||
};
|
||||
|
||||
bind-test {
|
||||
bind-test-child1 {
|
||||
compatible = "sandbox,phy";
|
||||
@@ -441,12 +452,14 @@
|
||||
power-domains = <&pwrdom 2>;
|
||||
};
|
||||
|
||||
pwm {
|
||||
pwm: pwm {
|
||||
compatible = "sandbox,pwm";
|
||||
#pwm-cells = <2>;
|
||||
};
|
||||
|
||||
pwm2 {
|
||||
compatible = "sandbox,pwm";
|
||||
#pwm-cells = <2>;
|
||||
};
|
||||
|
||||
ram {
|
||||
@@ -483,6 +496,11 @@
|
||||
remoteproc-name = "remoteproc-test-dev2";
|
||||
};
|
||||
|
||||
panel {
|
||||
compatible = "simple-panel";
|
||||
backlight = <&backlight 0 100>;
|
||||
};
|
||||
|
||||
smem@0 {
|
||||
compatible = "sandbox,smem";
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user