summaryrefslogtreecommitdiff
path: root/test/dm
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-11-20 23:52:33 +0200
committerSimon Glass <sjg@chromium.org>2018-12-05 06:08:31 -0700
commitd5bb4f862b47ad9112132071ad18f9936494e307 (patch)
treeba4c615f53874d52b17a25dbf02c10b357c31789 /test/dm
parentac7f5db9dc690901d99fe0afbcb3d4241c3cab8e (diff)
dm: serial: Introduce ->getinfo() callback
New callback will give a necessary information to fill up ACPI SPCR table, for example. Maybe used later for other purposes. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org> Change ADR_SPACE_SYSTEM_IO to SERIAL_ADDRESS_SPACE_IO to fix build error: Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/dm')
-rw-r--r--test/dm/serial.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/dm/serial.c b/test/dm/serial.c
index 7a1a1526a4..19a15d5d95 100644
--- a/test/dm/serial.c
+++ b/test/dm/serial.c
@@ -11,6 +11,7 @@
static int dm_test_serial(struct unit_test_state *uts)
{
+ struct serial_device_info info_serial = {0};
struct udevice *dev_serial;
uint value_serial;
@@ -25,10 +26,14 @@ static int dm_test_serial(struct unit_test_state *uts)
ut_assertok(serial_setconfig(SERIAL_DEFAULT_CONFIG));
ut_assertok(serial_getconfig(&value_serial));
ut_assert(value_serial == SERIAL_DEFAULT_CONFIG);
+ ut_assertok(serial_getinfo(&info_serial));
+ ut_assert(info_serial.type == SERIAL_CHIP_UNKNOWN);
+ ut_assert(info_serial.addr == SERIAL_DEFAULT_ADDRESS);
/*
* test with a parameter which is NULL pointer
*/
ut_asserteq(-EINVAL, serial_getconfig(NULL));
+ ut_asserteq(-EINVAL, serial_getinfo(NULL));
/*
* test with a serial config which is not supported by
* sandbox_serial driver: test with wrong parity