1
2
3
4
5
6
7
8
9
10#include "qemu/osdep.h"
11#include "libqtest-single.h"
12
13#define HDA_ID "hda0"
14#define CODEC_DEVICES " -device hda-output,bus=" HDA_ID ".0" \
15 " -device hda-micro,bus=" HDA_ID ".0" \
16 " -device hda-duplex,bus=" HDA_ID ".0"
17
18
19static void ich6_test(void)
20{
21 qtest_start("-device intel-hda,id=" HDA_ID CODEC_DEVICES);
22 qtest_end();
23}
24
25static void ich9_test(void)
26{
27 qtest_start("-machine q35 -device ich9-intel-hda,bus=pcie.0,addr=1b.0,id="
28 HDA_ID CODEC_DEVICES);
29 qtest_end();
30}
31
32int main(int argc, char **argv)
33{
34 g_test_init(&argc, &argv, NULL);
35 qtest_add_func("/intel-hda/ich6", ich6_test);
36 qtest_add_func("/intel-hda/ich9", ich9_test);
37
38 return g_test_run();
39}
40