summaryrefslogtreecommitdiffstats
path: root/u-boot/board
diff options
context:
space:
mode:
authorH. Nikolaus Schaller <hns@goldelico.com>2012-12-03 17:13:06 +0100
committerH. Nikolaus Schaller <hns@goldelico.com>2012-12-03 17:13:06 +0100
commit457702a457c3c025c8642e1473e10e8000a89397 (patch)
treeddf794e68d9e16f01f5db4f35580f1d72eeacb0c /u-boot/board
parentc7d9d4710b6d708a444d8e8ec2a8abf1f21da977 (diff)
downloadbootable_bootloader_goldelico_gta04-457702a457c3c025c8642e1473e10e8000a89397.zip
bootable_bootloader_goldelico_gta04-457702a457c3c025c8642e1473e10e8000a89397.tar.gz
bootable_bootloader_goldelico_gta04-457702a457c3c025c8642e1473e10e8000a89397.tar.bz2
harmonized I2C bus numbering code
Diffstat (limited to 'u-boot/board')
-rw-r--r--u-boot/board/goldelico/gta04/tsc2007.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/u-boot/board/goldelico/gta04/tsc2007.c b/u-boot/board/goldelico/gta04/tsc2007.c
index b2a0cfa..0df22ce 100644
--- a/u-boot/board/goldelico/gta04/tsc2007.c
+++ b/u-boot/board/goldelico/gta04/tsc2007.c
@@ -31,7 +31,7 @@
#include <i2c.h>
#include "tsc2007.h"
-#define TSC2007_BUS 2 // I2C2
+#define TSC2007_BUS (2-1) // I2C2
#define TSC2007_ADDRESS 0x48
// command byte definitions:
@@ -86,7 +86,7 @@ int tsc2007_cmd(int cmd)
int tsc2007_init(void)
{
- if(i2c_set_bus_num(TSC2007_BUS-1))
+ if(i2c_set_bus_num(TSC2007_BUS))
{
printf ("could not select I2C2\n");
return 1;
@@ -125,7 +125,7 @@ int read_adc(int adcnum)
};
if(didNotInit)
return -1;
- if(i2c_get_bus_num() != TSC2007_BUS-1 && i2c_set_bus_num(TSC2007_BUS-1))
+ if(i2c_get_bus_num() != TSC2007_BUS && i2c_set_bus_num(TSC2007_BUS))
{
printf ("could not select I2C2\n");
return -1;