]>
Commit | Line | Data |
---|---|---|
fea03459 PD |
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 | ||
fea03459 | 8 | #include <command.h> |
891ec35a | 9 | #include <dm.h> |
fea03459 PD |
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 | { | |
891ec35a MV |
16 | struct udevice *dev; |
17 | ||
18 | ut_assertok(uclass_get_device(UCLASS_LED, 2, &dev)); | |
19 | ||
fea03459 PD |
20 | /* Test that 'pinmux status <pinname>' displays the selected pin. */ |
21 | console_record_reset(); | |
22 | run_command("pinmux status a5", 0); | |
72675b06 | 23 | ut_assert_nextlinen("a5 : gpio output ."); |
fea03459 PD |
24 | ut_assert_console_end(); |
25 | ||
26 | console_record_reset(); | |
27 | run_command("pinmux status P7", 0); | |
57d820da | 28 | ut_assert_nextlinen("P7 : GPIO2 bias-pull-down input-enable."); |
fea03459 PD |
29 | ut_assert_console_end(); |
30 | ||
31 | console_record_reset(); | |
32 | run_command("pinmux status P9", 0); | |
57d820da MS |
33 | ut_assert_nextlinen("single-pinctrl pinctrl-single-no-width: missing register width"); |
34 | ut_assert_nextlinen("P9 not found"); | |
fea03459 PD |
35 | ut_assert_console_end(); |
36 | ||
37 | return 0; | |
38 | } | |
0e77c2b6 SG |
39 | DM_TEST(dm_test_cmd_pinmux_status_pinname, UTF_SCAN_PDATA | UTF_SCAN_FDT | |
40 | UTF_CONSOLE); |