blob: e2c6dec5e322a73422b9613d00b7998ee03e04cc [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Keng Soon Cheah755e2d02017-08-24 20:29:07 -07002/*
3 * Copyright (c) 2015 National Instruments
Keng Soon Cheah755e2d02017-08-24 20:29:07 -07004 */
5
Keng Soon Cheah755e2d02017-08-24 20:29:07 -07006#include <dm.h>
7#include <serial.h>
8
9static int nulldev_serial_setbrg(struct udevice *dev, int baudrate)
10{
11 return 0;
12}
13
14static int nulldev_serial_getc(struct udevice *dev)
15{
16 return -EAGAIN;
17}
18
Wilson Lee7f69f682017-11-02 23:39:51 -070019static int nulldev_serial_pending(struct udevice *dev, bool input)
20{
21 return 0;
22}
23
Keng Soon Cheah755e2d02017-08-24 20:29:07 -070024static int nulldev_serial_putc(struct udevice *dev, const char ch)
25{
26 return 0;
27}
28
29static const struct udevice_id nulldev_serial_ids[] = {
30 { .compatible = "nulldev-serial" },
31 { }
32};
33
Keng Soon Cheah755e2d02017-08-24 20:29:07 -070034const struct dm_serial_ops nulldev_serial_ops = {
35 .putc = nulldev_serial_putc,
Wilson Lee7f69f682017-11-02 23:39:51 -070036 .pending = nulldev_serial_pending,
Keng Soon Cheah755e2d02017-08-24 20:29:07 -070037 .getc = nulldev_serial_getc,
38 .setbrg = nulldev_serial_setbrg,
39};
40
41U_BOOT_DRIVER(serial_nulldev) = {
42 .name = "serial_nulldev",
43 .id = UCLASS_SERIAL,
44 .of_match = nulldev_serial_ids,
45 .ops = &nulldev_serial_ops,
46};