]> git.ipfire.org Git - thirdparty/u-boot.git/blame - test/dm/i2s.c
test: Remove <common.h> and add needed includes
[thirdparty/u-boot.git] / test / dm / i2s.c
CommitLineData
e96fa6c9
SG
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2018 Google LLC
4 * Written by Simon Glass <sjg@chromium.org>
5 */
6
e96fa6c9
SG
7#include <dm.h>
8#include <i2s.h>
0e1fad43 9#include <asm/test.h>
e96fa6c9 10#include <dm/test.h>
0e1fad43 11#include <test/test.h>
e96fa6c9 12#include <test/ut.h>
e96fa6c9
SG
13
14/* Basic test of the i2s codec uclass */
15static int dm_test_i2s(struct unit_test_state *uts)
16{
17 struct udevice *dev;
18 u8 data[3];
19
20 /* check probe success */
21 ut_assertok(uclass_first_device_err(UCLASS_I2S, &dev));
22 data[0] = 1;
23 data[1] = 4;
24 data[2] = 6;
25 ut_assertok(i2s_tx_data(dev, data, ARRAY_SIZE(data)));
26 ut_asserteq(11, sandbox_get_i2s_sum(dev));
27 ut_assertok(i2s_tx_data(dev, data, 1));
28 ut_asserteq(12, sandbox_get_i2s_sum(dev));
29
30 return 0;
31}
e180c2b1 32DM_TEST(dm_test_i2s, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);