lkml.org 
[lkml]   [2020]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v5 1/2] gpio: add GPO driver for PCA9570
From
Date
On 20. 7. 6. 오후 9:00, Andy Shevchenko wrote:
> On Mon, Jul 6, 2020 at 2:21 PM Bartosz Golaszewski
> <bgolaszewski@baylibre.com> wrote:>
>> On Sun, Jul 5, 2020 at 3:31 PM Sungbo Eo <mans0n@gorani.run> wrote:
>>>
>>> NXP PCA9570 is a 4-bit I2C GPO expander without interrupt functionality.
>>> Its ports are controlled only by a data byte without register address.
>>>
>
>>> Datasheet: https://www.nxp.com/docs/en/data-sheet/PCA9570.pdf
>>>
>
> No blank line here.
>
>>> Signed-off-by: Sungbo Eo <mans0n@gorani.run>
>
>> This driver looks nice now but why did you remove the mutex in v3? I
>> think when Andy commented on that, he meant not understanding why the
>> error check is protected, not the i2c operations.
>
> Right.

Oh, probably I misunderstood the comment... :(

But I don't really understand what mutex does here. The driver does not
need consecutive commands, it only sends/receives only one byte at a
time. And AFAIK each i2c_smbus function is already protected by a mutex.
So what should be exactly inside the lock? Should we protect the output
buffer as well? I'm not an expert on this so please enlighten me.

Thanks for your kind reviews, as always. :)

>
>> Are you sure you don't need this lock?
>
> It's a good point!
>

\
 
 \ /
  Last update: 2020-07-07 16:03    [W:0.068 / U:1.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site