diff options
| author | Stefano Babic <sbabic@denx.de> | 2013-07-31 11:30:38 +0200 |
|---|---|---|
| committer | Stefano Babic <sbabic@denx.de> | 2013-07-31 11:30:38 +0200 |
| commit | 326ea986ac150acdc7656d57fca647db80b50158 (patch) | |
| tree | 15724288b8b6da3a98d934db8330bb964cdfdf36 /common/cmd_dtt.c | |
| parent | 4acb4d391f005c0c72f7b84041b3884e4260a5a4 (diff) | |
| parent | fdce7b633a1de24456226b18527cc7900c34282a (diff) | |
| download | olio-uboot-2014.01-326ea986ac150acdc7656d57fca647db80b50158.tar.xz olio-uboot-2014.01-326ea986ac150acdc7656d57fca647db80b50158.zip | |
Merge git://git.denx.de/u-boot-arm
Conflicts:
board/freescale/mx6qsabrelite/Makefile
board/freescale/mx6qsabrelite/mx6qsabrelite.c
include/configs/mx6qsabrelite.h
Signed-off-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'common/cmd_dtt.c')
| -rw-r--r-- | common/cmd_dtt.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/common/cmd_dtt.c b/common/cmd_dtt.c index edbd4a83c..7257f10fb 100644 --- a/common/cmd_dtt.c +++ b/common/cmd_dtt.c @@ -2,23 +2,7 @@ * (C) Copyright 2001 * Erik Theisen, Wave 7 Optics, etheisen@mindspring.com * - * 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 <common.h> @@ -73,8 +57,13 @@ int dtt_i2c(void) /* Force a compilation error, if there are more then 32 sensors */ BUILD_BUG_ON(sizeof(sensors) > 32); /* switch to correct I2C bus */ +#ifdef CONFIG_SYS_I2C + old_bus = i2c_get_bus_num(); + i2c_set_bus_num(CONFIG_SYS_DTT_BUS_NUM); +#else old_bus = I2C_GET_BUS(); I2C_SET_BUS(CONFIG_SYS_DTT_BUS_NUM); +#endif _initialize_dtt(); @@ -86,8 +75,12 @@ int dtt_i2c(void) printf("DTT%d: %i C\n", i + 1, dtt_get_temp(sensors[i])); /* switch back to original I2C bus */ +#ifdef CONFIG_SYS_I2C + i2c_set_bus_num(old_bus); +#else I2C_SET_BUS(old_bus); #endif +#endif return 0; } |