mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
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>
This commit is contained in:
committed by
Simon Glass
parent
4f86a724e8
commit
ac7f5db9dc
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user