linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Hennerich <michael.hennerich@analog.com>
To: "Guido Martínez" <guido@vanguardiasur.com.ar>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>
Cc: "Mike Frysinger" <vapier@gentoo.org>,
	linux-input@vger.kernel.org,
	device-drivers-devel@blackfin.uclinux.org,
	"Ezequiel García" <ezequiel@vanguardiasur.com.ar>
Subject: Re: [PATCH 2/3] Input: adp5589-keys: fix pull mask setting
Date: Tue, 21 Apr 2015 16:35:20 +0200	[thread overview]
Message-ID: <55366028.2010105@analog.com> (raw)
In-Reply-To: <1429626090-29022-3-git-send-email-guido@vanguardiasur.com.ar>

On 04/21/2015 04:21 PM, Guido Martínez wrote:
> The pull mask is created by looping each row (column) and building an
> 8-bit integer with the configuration. It is written byte-by-byte, when
> we reach the end of the rows (columns) or we're at the 3rd line (which
> finishes the first byte, since each pin is 2bits on the mask).
>
> However, this only works if we have at most 8 pins (2 bytes), which is
> not the case for the ADP5589. So, write the byte at each boundary (every
> 4 rows/columns).
>
> Fixes: 9d2e173644bb ('Input: ADP5589 - new driver for I2C Keypad Decoder and I/O Expander')
> Signed-off-by: Guido Martínez <guido@vanguardiasur.com.ar>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> ---
>   drivers/input/keyboard/adp5589-keys.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/keyboard/adp5589-keys.c b/drivers/input/keyboard/adp5589-keys.c
> index 19edd2d..8709a7f 100644
> --- a/drivers/input/keyboard/adp5589-keys.c
> +++ b/drivers/input/keyboard/adp5589-keys.c
> @@ -729,7 +729,7 @@ static int adp5589_setup(struct adp5589_kpad *kpad)
>   
>   		pull_mask |= val << (2 * (i & 0x3));
>   
> -		if (i == 3 || i == kpad->var->max_row_num) {
> +		if (i % 4 == 3 || i == kpad->var->max_row_num) {
>   			ret |= adp5589_write(client, reg(ADP5585_RPULL_CONFIG_A)
>   					     + (i >> 2), pull_mask);
>   			pull_mask = 0;
> @@ -749,7 +749,7 @@ static int adp5589_setup(struct adp5589_kpad *kpad)
>   
>   		pull_mask |= val << (2 * (i & 0x3));
>   
> -		if (i == 3 || i == kpad->var->max_col_num) {
> +		if (i % 4 == 3 || i == kpad->var->max_col_num) {
>   			ret |= adp5589_write(client,
>   					     reg(ADP5585_RPULL_CONFIG_C) +
>   					     (i >> 2), pull_mask);


-- 
Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
Margaret Seif

--
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

  reply	other threads:[~2015-04-21 14:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21 14:21 [PATCH 0/3] adp5589 fixes Guido Martínez
2015-04-21 14:21 ` [PATCH 1/3] Input: adp5589-keys: handle i2c errors on the irq handler Guido Martínez
     [not found]   ` <55366018.8050807@analog.com>
2015-05-06 23:33     ` Dmitry Torokhov
2015-05-09 19:48       ` Guido Martínez
2015-04-21 14:21 ` [PATCH 2/3] Input: adp5589-keys: fix pull mask setting Guido Martínez
2015-04-21 14:35   ` Michael Hennerich [this message]
2015-05-06 23:34     ` Dmitry Torokhov
2015-04-21 14:21 ` [PATCH 3/3] Input: adp5589-keys: fix event count mask Guido Martínez
2015-04-21 14:36   ` Michael Hennerich
2015-05-06 23:36     ` Dmitry Torokhov
2015-10-02 21:28       ` Ezequiel Garcia
2015-10-06  0:29         ` Dmitry Torokhov
2015-10-08 14:21           ` Ezequiel Garcia
2015-05-06 14:04 ` [PATCH 0/3] adp5589 fixes Guido Martínez

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=55366028.2010105@analog.com \
    --to=michael.hennerich@analog.com \
    --cc=device-drivers-devel@blackfin.uclinux.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=guido@vanguardiasur.com.ar \
    --cc=linux-input@vger.kernel.org \
    --cc=vapier@gentoo.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).