diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2018-11-20 23:52:32 +0200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-12-05 06:06:44 -0700 |
commit | ac7f5db9dc690901d99fe0afbcb3d4241c3cab8e (patch) | |
tree | ac1c22f82a9aa1b481142490623ad1aed5feb555 /test/dm | |
parent | 4f86a724e82c0b74d9ffb7b65f8ae4b011dd0b03 (diff) | |
download | u-boot-ac7f5db9dc690901d99fe0afbcb3d4241c3cab8e.tar.gz u-boot-ac7f5db9dc690901d99fe0afbcb3d4241c3cab8e.tar.xz u-boot-ac7f5db9dc690901d99fe0afbcb3d4241c3cab8e.zip |
dm: serial: Add ->getconfig() callback
In some cases it would be good to know the settings, such as parity,
of current serial console. One example might be an ACPI SPCR table
to generate using these parameters.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/dm')
-rw-r--r-- | test/dm/serial.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/dm/serial.c b/test/dm/serial.c index 5c603e1f42..7a1a1526a4 100644 --- a/test/dm/serial.c +++ b/test/dm/serial.c @@ -12,6 +12,7 @@ static int dm_test_serial(struct unit_test_state *uts) { struct udevice *dev_serial; + uint value_serial; ut_assertok(uclass_get_device_by_name(UCLASS_SERIAL, "serial", &dev_serial)); @@ -22,6 +23,12 @@ static int dm_test_serial(struct unit_test_state *uts) * sandbox_serial driver */ ut_assertok(serial_setconfig(SERIAL_DEFAULT_CONFIG)); + ut_assertok(serial_getconfig(&value_serial)); + ut_assert(value_serial == SERIAL_DEFAULT_CONFIG); + /* + * test with a parameter which is NULL pointer + */ + ut_asserteq(-EINVAL, serial_getconfig(NULL)); /* * test with a serial config which is not supported by * sandbox_serial driver: test with wrong parity |