From 0d4dcdd079a463b21a09d5e9db5513cc61ea93da Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 6 Jul 2014 08:03:34 -0600 Subject: [PATCH] maXTouch: Fix I2C address, errors when debug enable, reorganize some data --- configs/sama5d4-ek/src/sam_maxtouch.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/configs/sama5d4-ek/src/sam_maxtouch.c b/configs/sama5d4-ek/src/sam_maxtouch.c index 7a8fb396543..b6a4f6030d4 100644 --- a/configs/sama5d4-ek/src/sam_maxtouch.c +++ b/configs/sama5d4-ek/src/sam_maxtouch.c @@ -70,9 +70,10 @@ # define CONFIG_SAMA5D4EK_MXT_DEVMINOR 0 #endif -/* The touchscreen communicates on TWI0 */ +/* The touchscreen communicates on TWI0, I2C address 0x4c */ -#define MXT_BUSNUM 0 +#define MXT_TWI_BUS 0 +#define MXT_I2C_ADDRESS 0x4c /**************************************************************************** * Private Types @@ -128,7 +129,7 @@ static struct sama5d4ek_tscinfo_s g_mxtinfo = { .lower = { - .address = (0x4c >> 1), + .address = MXT_I2C_ADDRESS, .frequency = CONFIG_SAMA5D4EK_MXT_I2CFREQUENCY, .attach = mxt_attach, @@ -259,10 +260,10 @@ int arch_tcinitialize(int minor) /* Get an instance of the I2C interface for the touchscreen chip select */ - i2c = up_i2cinitialize(MXT_BUSNUM); + i2c = up_i2cinitialize(MXT_TWI_BUS); if (!i2c) { - idbg("Failed to initialize I2C%d\n", MXT_BUSNUM); + idbg("Failed to initialize I2C%d\n", MXT_TWI_BUS); return -ENODEV; }