lkml.org 
[lkml]   [2019]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/3] iio: light: Add driver for ap3216c
On Sun, Feb 10, 2019 at 3:39 PM Robert Eshleman <bobbyeshleman@gmail.com> wrote:
>
> This patch adds support for the ap3216c ambient light and proximity
> sensor.

PS

Why not use the chip in the mode where the interrupt is automatically cleared by
reading the data? This could work if you read the data in the
interrupt routine, store
it in a buffer, then send the event to iio. Then when userspace wants
to read out the
value, don't actually touch the hardware, but return the buffered value.

I don't think you then need any synchronization primitives to
accomplish this, such as
mutexes, spin locks, etc. Because the interrupt routine is single-threaded.

You don't even need a memory barrier for the buffered value,
because the iio core uses a waitqueue internally, which automatically issues
an mb(). As far as I know.

\
 
 \ /
  Last update: 2019-02-11 20:31    [W:0.129 / U:12.760 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site