From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Ripard Subject: Re: [PATCH v3 21/30] iio: adc: sun4i-gpadc-iio: add support for H3 thermal sensor Date: Mon, 3 Sep 2018 12:20:22 +0200 Message-ID: <20180903102022.fkxfkxadkt4vpbmb@flea> References: <20180830154518.29507-1-embed3d@gmail.com> <20180830154518.29507-22-embed3d@gmail.com> <20180831091137.wkbbipssyd6mqfbt@flea> Reply-To: maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="572ywfuqjxaaxz76" Return-path: Sender: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Content-Disposition: inline In-Reply-To: List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: Icenowy Zheng Cc: Philipp Rossak , mark.rutland-5wv7dgnIgG8@public.gmane.org, geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org, linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org, clabbe.montjoie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org, lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org, quentin.schulz-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org, linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org, wens-jdAy2FN1RRM@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, arnd-r2nGTMty4D4@public.gmane.org, vilhelm.gray-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, rdunlap-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org, arnaud.pouliquen-qxv4g6HH51o@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org, knaack.h-Mmb7MZpHnFY@public.gmane.org, eugen.hristev-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org, jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org List-Id: devicetree@vger.kernel.org --572ywfuqjxaaxz76 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline On Fri, Aug 31, 2018 at 05:51:41PM +0800, Icenowy Zheng wrote: > Personally I suggest to leave out all SID or calibration related > patches here. > > Currently we seems to be wrongly converting SID to big endian, however, > the orgnization of the THS calibration data on H6 shows that it's > surely little endian: > > It consists a temperature value in 1/10 celsuis as unit, and some > thermal register readout values, which are the values read out at the > given temperature, and every value here (the temperature and the > readout) are all half word length. > > Let the temperature value be AABB, the two readout values be XXYY and > ZZWW, the oragnization is: > BB AA YY XX WW ZZ ** ** . > > When converting the SID to big endian, it becomes: > XX YY AA BB ** ** ZZ WW , > which is non-sense, and not able to do sub-word cell addressing. > > Maxime, should I drop the LE2BE conversion in SID driver? (I doubt > whether it will break compatibility.) This is exposed to the userspace, so no. Maxime > -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --572ywfuqjxaaxz76--