From: hirosh@dabui.de (Hirosh Dabui)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] davinci: tnetv107x: fix register indexing for GPIOs numbers > 31
Date: Sat, 29 Jan 2011 12:45:49 +0100 [thread overview]
Message-ID: <4D43FDED.7030008@dabui.de> (raw)
In-Reply-To: <8762t8d7jr.fsf@ti.com>
ok-super!
On 01/28/2011 10:47 PM, Kevin Hilman wrote:
> Hirosh Dabui<hirosh.dabui@snom.com> writes:
>
>
>> This patch fix a bug in the register indexing for GPIOs numbers> 31
>> to get the relevant hardware registers of tnetv107x to control the GPIOs.
>>
>> In the structure tnetv107x_gpio_regs:
>>
>> struct tnetv107x_gpio_regs {
>> u32 idver;
>> u32 data_in[3];
>> u32 data_out[3];
>> u32 direction[3];
>> u32 enable[3];
>> };
>>
>> The GPIO hardware register addresses of tnetv107x are stored.
>> The chip implements 3 registers of each entity to serve 96 GPIOs,
>> each register provides a subset of 32 GPIOs.
>> The driver provides these macros: gpio_reg_set_bit, gpio_reg_get_bit
>> and gpio_reg_clear_bit.
>>
>> The bug implied the use of macros to access the relevant hardware
>> register e.g. the driver code used the macro like this:
>> 'gpio_reg_clear_bit(®->data_out, gpio)'
>>
>> But it has to be used like this:
>> 'gpio_reg_clear_bit(reg->data_out, gpio)'.
>>
>> The different results are shown here:
>> -®->data_out + 1 (it will add the full array size of data_out i.e. 12 bytes)
>> - reg->data_out + 1 (it will increment only the size of data_out i.e. only 4 bytes)
>>
>> Acked-by: Cyril Chemparathy<cyril@ti.com>
>> Signed-off-by: Hirosh Dabui<hirosh.dabui@snom.com>
>>
> Thanks, applied and queuing for 2.6.39.
>
> Kevin
>
next prev parent reply other threads:[~2011-01-29 11:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-25 22:05 [PATCH] davinci: tnetv107x: fix register indexing for GPIOs numbers > 31 Hirosh Dabui
2011-01-26 6:14 ` [PATCH] davinci: tnetv107x: fix register indexing for GPIOs numbers >31 Jon Povey
2011-01-28 21:47 ` [PATCH] davinci: tnetv107x: fix register indexing for GPIOs numbers > 31 Kevin Hilman
2011-01-29 11:45 ` Hirosh Dabui [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-01-14 15:18 Hirosh Dabui
2011-01-18 1:41 ` Nori, Sekhar
2011-01-18 18:23 ` Kevin Hilman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D43FDED.7030008@dabui.de \
--to=hirosh@dabui.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).