Re: [PATCH 5/8] gpio: exar: Fix reading of directions and values

2017-05-18 Thread Jan Kiszka
On 2017-05-18 12:23, Andy Shevchenko wrote: > On Thu, May 18, 2017 at 1:16 PM, Jan Kiszka wrote: >> On 2017-05-18 12:11, Andy Shevchenko wrote: >>> On Thu, May 18, 2017 at 8:20 AM, Jan Kiszka wrote: > >>> Full picture: >>> >>> val = exar_get(chip, addr) & BIT(offset % 8); >>> >>> return !!val;

Re: [PATCH 5/8] gpio: exar: Fix reading of directions and values

2017-05-18 Thread Andy Shevchenko
On Thu, May 18, 2017 at 1:16 PM, Jan Kiszka wrote: > On 2017-05-18 12:11, Andy Shevchenko wrote: >> On Thu, May 18, 2017 at 8:20 AM, Jan Kiszka wrote: >> Full picture: >> >> val = exar_get(chip, addr) & BIT(offset % 8); >> >> return !!val; >> >> How it could be non-(1 or 0)? >> > > Right - but

Re: [PATCH 5/8] gpio: exar: Fix reading of directions and values

2017-05-18 Thread Jan Kiszka
On 2017-05-18 12:11, Andy Shevchenko wrote: > On Thu, May 18, 2017 at 8:20 AM, Jan Kiszka wrote: >> On 2017-05-13 15:36, Andy Shevchenko wrote: >>> On Sat, May 13, 2017 at 10:29 AM, Jan Kiszka wrote: First, the logic for translating a register bit to the return code of exar_get_directio

Re: [PATCH 5/8] gpio: exar: Fix reading of directions and values

2017-05-18 Thread Andy Shevchenko
On Thu, May 18, 2017 at 8:20 AM, Jan Kiszka wrote: > On 2017-05-13 15:36, Andy Shevchenko wrote: >> On Sat, May 13, 2017 at 10:29 AM, Jan Kiszka wrote: >>> First, the logic for translating a register bit to the return code of >>> exar_get_direction and exar_get_value were wrong. And second, there

Re: [PATCH 5/8] gpio: exar: Fix reading of directions and values

2017-05-17 Thread Jan Kiszka
On 2017-05-13 15:36, Andy Shevchenko wrote: > On Sat, May 13, 2017 at 10:29 AM, Jan Kiszka wrote: >> First, the logic for translating a register bit to the return code of >> exar_get_direction and exar_get_value were wrong. And second, there was >> a flip regarding the register bank in exar_get_di

Re: [PATCH 5/8] gpio: exar: Fix reading of directions and values

2017-05-13 Thread Andy Shevchenko
On Sat, May 13, 2017 at 10:29 AM, Jan Kiszka wrote: > First, the logic for translating a register bit to the return code of > exar_get_direction and exar_get_value were wrong. And second, there was > a flip regarding the register bank in exar_get_direction. Again, I wish it was tested in the firs