From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lorenzo Bianconi Subject: Re: [PATCH v3 1/5] iio: st_sensors: add register mask for status register Date: Thu, 21 Sep 2017 17:36:10 +0200 Message-ID: References: <20170830115043.3738-1-lorenzo.bianconi@st.com> <20170830115043.3738-2-lorenzo.bianconi@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: Sender: linux-iio-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Linus Walleij Cc: Jonathan Cameron , "linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Lorenzo Bianconi , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" List-Id: devicetree@vger.kernel.org > On Wed, Aug 30, 2017 at 1:50 PM, Lorenzo Bianconi > wrote: > >> Introduce register mask for data-ready status register since >> pressure sensors (e.g. LPS22HB) export just two channels >> (BIT(0) and BIT(1)) and BIT(2) is marked reserved while in >> st_sensors_new_samples_available() value read from status register >> is masked using 0x7. >> Moreover do not mask status register using active_scan_mask since >> now status value is properly masked and if the result is not zero the >> interrupt has to be consumed by the driver. This fix an issue on LPS25H >> and LPS331AP where channel definition is swapped respect to status >> register. >> Furthermore that change allows to properly support new devices >> (e.g LIS2DW12) that report just ZYXDA (data-ready) field in status register >> to figure out if the interrupt has been generated by the device. >> >> Fixes: 97865fe41322 (iio: st_sensors: verify interrupt event to status) >> Signed-off-by: Lorenzo Bianconi > > Reviewed-by: Linus Walleij > > I'm a bit worried that we would need to use this on some of the > older sensors too, mainly because of mine and others' ignorance. > Have you looked over everything or just pressure sensors? I double-checked ds for all supported devices and just pressure sensors have 0x3 as status mask. Regards, Lorenzo > > Yours, > Linus Walleij -- UNIX is Sexy: who | grep -i blonde | talk; cd ~; wine; talk; touch; unzip; touch; strip; gasp; finger; gasp; mount; fsck; more; yes; gasp; umount; make clean; sleep