X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fstdio.c;h=dd402cc23d51b6ff336ee5435a3ed1e612dec080;hb=709ea543b92489e7729d2d7ddd6c9f451e52158c;hp=201188054994d9b02810d60b0a0b371517b7890a;hpb=3f4978c713255c8406875fbdf23ffed1129bc44b;p=u-boot diff --git a/common/stdio.c b/common/stdio.c index 2011880549..dd402cc23d 100644 --- a/common/stdio.c +++ b/common/stdio.c @@ -6,23 +6,7 @@ * (C) Copyright 2000 * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -34,8 +18,8 @@ #ifdef CONFIG_LOGBUFFER #include #endif -#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \ - defined(CONFIG_SYS_I2C_ADAPTERS) + +#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) #include #endif @@ -51,23 +35,43 @@ char *stdio_names[MAX_FILES] = { "stdin", "stdout", "stderr" }; #ifdef CONFIG_SYS_DEVICE_NULLDEV -void nulldev_putc(const char c) +void nulldev_putc(struct stdio_dev *dev, const char c) { /* nulldev is empty! */ } -void nulldev_puts(const char *s) +void nulldev_puts(struct stdio_dev *dev, const char *s) { /* nulldev is empty! */ } -int nulldev_input(void) +int nulldev_input(struct stdio_dev *dev) { /* nulldev is empty! */ return 0; } #endif +void stdio_serial_putc(struct stdio_dev *dev, const char c) +{ + serial_putc(c); +} + +void stdio_serial_puts(struct stdio_dev *dev, const char *s) +{ + serial_puts(s); +} + +int stdio_serial_getc(struct stdio_dev *dev) +{ + return serial_getc(); +} + +int stdio_serial_tstc(struct stdio_dev *dev) +{ + return serial_tstc(); +} + /************************************************************************** * SYSTEM DRIVERS ************************************************************************** @@ -81,10 +85,10 @@ static void drv_system_init (void) strcpy (dev.name, "serial"); dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM; - dev.putc = serial_putc; - dev.puts = serial_puts; - dev.getc = serial_getc; - dev.tstc = serial_tstc; + dev.putc = stdio_serial_putc; + dev.puts = stdio_serial_puts; + dev.getc = stdio_serial_getc; + dev.tstc = stdio_serial_tstc; stdio_register (&dev); #ifdef CONFIG_SYS_DEVICE_NULLDEV @@ -212,15 +216,10 @@ int stdio_init (void) /* Initialize the list */ INIT_LIST_HEAD(&(devs.list)); -#ifdef CONFIG_ARM_DCC - drv_arm_dcc_init (); -#endif #ifdef CONFIG_SYS_I2C -#ifdef CONFIG_SYS_I2C_ADAPTERS i2c_init_all(); -#endif #else -#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) +#if defined(CONFIG_HARD_I2C) i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); #endif #endif