Patrick Delaunay | b40399c | 2021-05-21 09:47:32 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Executes tests for pinmux command |
| 4 | * |
| 5 | * Copyright (C) 2021, STMicroelectronics - All Rights Reserved |
| 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | #include <command.h> |
| 10 | #include <dm/test.h> |
| 11 | #include <test/test.h> |
| 12 | #include <test/ut.h> |
| 13 | |
| 14 | static int dm_test_cmd_pinmux_status_pinname(struct unit_test_state *uts) |
| 15 | { |
| 16 | /* Test that 'pinmux status <pinname>' displays the selected pin. */ |
| 17 | console_record_reset(); |
| 18 | run_command("pinmux status a5", 0); |
| 19 | ut_assert_nextline("a5 : gpio input . "); |
| 20 | ut_assert_console_end(); |
| 21 | |
| 22 | console_record_reset(); |
| 23 | run_command("pinmux status P7", 0); |
| 24 | ut_assert_nextline("P7 : GPIO2 bias-pull-down input-enable. "); |
| 25 | ut_assert_console_end(); |
| 26 | |
| 27 | console_record_reset(); |
| 28 | run_command("pinmux status P9", 0); |
| 29 | ut_assert_nextline("single-pinctrl pinctrl-single-no-width: missing register width"); |
| 30 | ut_assert_nextline("P9 not found"); |
| 31 | ut_assert_console_end(); |
| 32 | |
| 33 | return 0; |
| 34 | } |
| 35 | |
| 36 | DM_TEST(dm_test_cmd_pinmux_status_pinname, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); |