diff mbox

[11/40] Input: atmel_mxt_ts - Bootloader addresses for mXT1664/mXT1188S

Message ID 1361555907-19840-12-git-send-email-nick.dyer@itdev.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Nick Dyer Feb. 22, 2013, 5:57 p.m. UTC
The mXT1664S family chips use different mappings for bootloader addresses.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
---
 drivers/input/touchscreen/atmel_mxt_ts.c |    5 +++++
 1 file changed, 5 insertions(+)

Comments

Benson Leung Feb. 22, 2013, 7:06 p.m. UTC | #1
This is disappointing that Atmel decided to change the bootloader
address scheme for the 1664S family. Unfortunately, this ifdef won't
work for situations where there are more than one Atmel device of a
different kind on a system using this same driver.

For the Chromebook Pixel, we use the same atmel_mxt_ts driver for a
1664S device and a 224SL.

The 1664S has the pair 0x26 and 0x4a, while the 224SL has 0x25 and 0x4b.

Benson

On Fri, Feb 22, 2013 at 9:57 AM, Nick Dyer <nick.dyer@itdev.co.uk> wrote:
> The mXT1664S family chips use different mappings for bootloader addresses.
>
> Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
> ---
>  drivers/input/touchscreen/atmel_mxt_ts.c |    5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
> index 16af68d..903ff54 100644
> --- a/drivers/input/touchscreen/atmel_mxt_ts.c
> +++ b/drivers/input/touchscreen/atmel_mxt_ts.c
> @@ -281,12 +281,17 @@ struct mxt_i2c_address_pair {
>  };
>
>  static const struct mxt_i2c_address_pair mxt_i2c_addresses[] = {
> +#ifdef BOOTLOADER_1664_1188
> +       { 0x26, 0x4a },
> +       { 0x27, 0x4b },
> +#else
>         { 0x24, 0x4a },
>         { 0x25, 0x4b },
>         { 0x26, 0x4c },
>         { 0x27, 0x4d },
>         { 0x34, 0x5a },
>         { 0x35, 0x5b },
> +#endif
>  };
>
>  static bool mxt_object_readable(unsigned int type)
> --
> 1.7.10.4
>



--
Benson Leung
Software Engineer, Chrom* OS
bleung@chromium.org
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nick Dyer Feb. 22, 2013, 7:51 p.m. UTC | #2
Benson Leung wrote:
> This is disappointing that Atmel decided to change the bootloader 
> address scheme for the 1664S family. Unfortunately, this ifdef won't 
> work for situations where there are more than one Atmel device of a 
> different kind on a system using this same driver.
> 
> For the Chromebook Pixel, we use the same atmel_mxt_ts driver for a 
> 1664S device and a 224SL.
> 
> The 1664S has the pair 0x26 and 0x4a, while the 224SL has 0x25 and
> 0x4b.

If I put a bootloader address override in the platform data will that meet
your requirements?
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Benson Leung Feb. 22, 2013, 11:09 p.m. UTC | #3
We've moved away from using platform data in our project because it's
clunky, and because we implemented the config loading that's similar
to what you submitted elsewhere in this series.

Furthermore, for our ARM projects specifically, we are using flattened
device trees to describe our board and instantiate devices. The upside
is that it means that we no longer have to modify the kernel to bring
up a new board with some varied hardware.

The downside is that it's impossible to setup platform data for i2c
devices from the device tree. drivers/of/of_i2c.c instantiates i2c
devices including the atmel touch device, and it doesn't and shouldn't
know about how atmel_mxt_ts's platform data is structured. All it does
is i2c_new_device on the right adapter, at the right address, and
optionally pass in an irq #.



On Fri, Feb 22, 2013 at 11:51 AM, Nick Dyer <nick.dyer@itdev.co.uk> wrote:
> Benson Leung wrote:
>> This is disappointing that Atmel decided to change the bootloader
>> address scheme for the 1664S family. Unfortunately, this ifdef won't
>> work for situations where there are more than one Atmel device of a
>> different kind on a system using this same driver.
>>
>> For the Chromebook Pixel, we use the same atmel_mxt_ts driver for a
>> 1664S device and a 224SL.
>>
>> The 1664S has the pair 0x26 and 0x4a, while the 224SL has 0x25 and
>> 0x4b.
>
> If I put a bootloader address override in the platform data will that meet
> your requirements?



--
Benson Leung
Software Engineer, Chrom* OS
bleung@chromium.org
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 16af68d..903ff54 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -281,12 +281,17 @@  struct mxt_i2c_address_pair {
 };
 
 static const struct mxt_i2c_address_pair mxt_i2c_addresses[] = {
+#ifdef BOOTLOADER_1664_1188
+	{ 0x26, 0x4a },
+	{ 0x27, 0x4b },
+#else
 	{ 0x24, 0x4a },
 	{ 0x25, 0x4b },
 	{ 0x26, 0x4c },
 	{ 0x27, 0x4d },
 	{ 0x34, 0x5a },
 	{ 0x35, 0x5b },
+#endif
 };
 
 static bool mxt_object_readable(unsigned int type)