blob: 17b2310ee3785675639f3f0066821a7e3b4c372f [file] [log] [blame]
Keng Soon Cheah755e2d02017-08-24 20:29:07 -07001/*
2 * Copyright (c) 2015 National Instruments
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <dm.h>
9#include <serial.h>
10
11static int nulldev_serial_setbrg(struct udevice *dev, int baudrate)
12{
13 return 0;
14}
15
16static int nulldev_serial_getc(struct udevice *dev)
17{
18 return -EAGAIN;
19}
20
Wilson Lee7f69f682017-11-02 23:39:51 -070021static int nulldev_serial_pending(struct udevice *dev, bool input)
22{
23 return 0;
24}
25
Keng Soon Cheah755e2d02017-08-24 20:29:07 -070026static int nulldev_serial_input(struct udevice *dev)
27{
28 return 0;
29}
30
31static int nulldev_serial_putc(struct udevice *dev, const char ch)
32{
33 return 0;
34}
35
36static const struct udevice_id nulldev_serial_ids[] = {
37 { .compatible = "nulldev-serial" },
38 { }
39};
40
41
42const struct dm_serial_ops nulldev_serial_ops = {
43 .putc = nulldev_serial_putc,
Wilson Lee7f69f682017-11-02 23:39:51 -070044 .pending = nulldev_serial_pending,
Keng Soon Cheah755e2d02017-08-24 20:29:07 -070045 .getc = nulldev_serial_getc,
46 .setbrg = nulldev_serial_setbrg,
47};
48
49U_BOOT_DRIVER(serial_nulldev) = {
50 .name = "serial_nulldev",
51 .id = UCLASS_SERIAL,
52 .of_match = nulldev_serial_ids,
53 .ops = &nulldev_serial_ops,
54};