blob: 07683086dbadfc112c32614d9f6a9f0d838b3290 [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
21static int nulldev_serial_input(struct udevice *dev)
22{
23 return 0;
24}
25
26static int nulldev_serial_putc(struct udevice *dev, const char ch)
27{
28 return 0;
29}
30
31static const struct udevice_id nulldev_serial_ids[] = {
32 { .compatible = "nulldev-serial" },
33 { }
34};
35
36
37const struct dm_serial_ops nulldev_serial_ops = {
38 .putc = nulldev_serial_putc,
39 .getc = nulldev_serial_getc,
40 .setbrg = nulldev_serial_setbrg,
41};
42
43U_BOOT_DRIVER(serial_nulldev) = {
44 .name = "serial_nulldev",
45 .id = UCLASS_SERIAL,
46 .of_match = nulldev_serial_ids,
47 .ops = &nulldev_serial_ops,
48};