From: Grygorii Strashko <grygorii.strashko@ti.com>
To: "Linus Walleij" <linus.walleij@linaro.org>,
"Janusz Użycki" <j.uzycki@elpromaelectronics.com>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"Joshua Scott" <joshua.scott@alliedtelesis.co.nz>,
"Toby Smith" <toby@tismith.id.au>,
"Gregory Clement" <gregory.clement@free-electrons.com>
Cc: Grant Likely <grant.likely@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Krzysztof Borgulski <k.borgulski@elproma.com.pl>
Subject: Re: [RFC PATCH] gpio-pca953x driver and PCA9536 chip
Date: Mon, 7 Sep 2015 15:36:10 +0300 [thread overview]
Message-ID: <55ED84BA.9090202@ti.com> (raw)
In-Reply-To: <CACRpkdZcju7tpoi9+R4Bb98FEJNSfmYaRyLp7YF2ZT+hjkAMVA@mail.gmail.com>
On 09/06/2015 12:15 AM, Linus Walleij wrote:
> Adding linux-gpio and some people that have been patching
> this driver to TO-line.
>
> Grygorii et al, does this look correct? Anyone who can test and
> send a patch for mainline?
>
> Yours,
> Linus Walleij
>
> On Mon, Aug 31, 2015 at 4:26 PM, Janusz Użycki
> <j.uzycki@elpromaelectronics.com> wrote:
>> Hi,
>>
>> The driver sets register #02 (inversion) to 0x01 instead of 0x00 on my
>> board.
>> Reason: device_pca953x_init() does not initialize val buffer because NBANK()
>> returns
>> for PCA9536 ngpio=4 value 0 instead of 1.
>>
>> My proposed code-patch for 3.14.17 is below.
>> Because I don't work on stable/next I can't deliver complete/ready patch.
>> Please for comments.
>>
>> best regards
>> Janusz
>>
>> --- a/drivers/gpio/gpio-pca953x.c
>> +++ b/drivers/gpio/gpio-pca953x.c
>> @@ -75,7 +75,7 @@ MODULE_DEVICE_TABLE(i2c, pca953x_id);
>> #define MAX_BANK 5
>> #define BANK_SZ 8
>>
>> -#define NBANK(chip) (chip->gpio_chip.ngpio / BANK_SZ)
>> +#define NBANK(chip) DIV_ROUND_UP(chip->gpio_chip.ngpio, BANK_SZ)
>>
>> struct pca953x_chip {
>> unsigned gpio_start;
Seems yes, but I can't test it - have no such HW now.
As per code, NBANK(chip) expected to return number of 8-bit banks, but now
it returns NBANK-1.
Additional info:
- Corresponding code was changed by Gregory CLEMENT
commit: f5f0b7aa897ebf6b0d077356a787526212460dd7
--
regards,
-grygorii
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2015-09-07 12:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-31 14:26 [RFC PATCH] gpio-pca953x driver and PCA9536 chip Janusz Użycki
[not found] ` <55E4641D.7050603-cjVIcFy54eMe9JSWTWOYM+658FiBabzs@public.gmane.org>
2015-09-04 9:33 ` [RFC] " Janusz Użycki
2015-09-05 21:15 ` [RFC PATCH] " Linus Walleij
2015-09-07 12:36 ` Grygorii Strashko [this message]
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=55ED84BA.9090202@ti.com \
--to=grygorii.strashko@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@linaro.org \
--cc=gregory.clement@free-electrons.com \
--cc=j.uzycki@elpromaelectronics.com \
--cc=joshua.scott@alliedtelesis.co.nz \
--cc=k.borgulski@elproma.com.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=toby@tismith.id.au \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.