]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | // SPDX-License-Identifier: GPL-2.0+ |
cac73f20 KSC |
2 | /* |
3 | * Copyright (c) 2015 National Instruments | |
cac73f20 KSC |
4 | */ |
5 | ||
6 | #include <common.h> | |
7 | #include <dm.h> | |
8 | #include <serial.h> | |
9 | ||
10 | static int nulldev_serial_setbrg(struct udevice *dev, int baudrate) | |
11 | { | |
12 | return 0; | |
13 | } | |
14 | ||
15 | static int nulldev_serial_getc(struct udevice *dev) | |
16 | { | |
17 | return -EAGAIN; | |
18 | } | |
19 | ||
b12907f2 WL |
20 | static int nulldev_serial_pending(struct udevice *dev, bool input) |
21 | { | |
22 | return 0; | |
23 | } | |
24 | ||
cac73f20 KSC |
25 | static int nulldev_serial_input(struct udevice *dev) |
26 | { | |
27 | return 0; | |
28 | } | |
29 | ||
30 | static int nulldev_serial_putc(struct udevice *dev, const char ch) | |
31 | { | |
32 | return 0; | |
33 | } | |
34 | ||
35 | static const struct udevice_id nulldev_serial_ids[] = { | |
36 | { .compatible = "nulldev-serial" }, | |
37 | { } | |
38 | }; | |
39 | ||
40 | ||
41 | const struct dm_serial_ops nulldev_serial_ops = { | |
42 | .putc = nulldev_serial_putc, | |
b12907f2 | 43 | .pending = nulldev_serial_pending, |
cac73f20 KSC |
44 | .getc = nulldev_serial_getc, |
45 | .setbrg = nulldev_serial_setbrg, | |
46 | }; | |
47 | ||
48 | U_BOOT_DRIVER(serial_nulldev) = { | |
49 | .name = "serial_nulldev", | |
50 | .id = UCLASS_SERIAL, | |
51 | .of_match = nulldev_serial_ids, | |
52 | .ops = &nulldev_serial_ops, | |
53 | }; |