From patchwork Mon Jun 5 10:32:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Nyekjaer X-Patchwork-Id: 13267178 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4C76C77B73 for ; Mon, 5 Jun 2023 10:32:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229611AbjFEKcz (ORCPT ); Mon, 5 Jun 2023 06:32:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbjFEKcy (ORCPT ); Mon, 5 Jun 2023 06:32:54 -0400 Received: from www530.your-server.de (www530.your-server.de [188.40.30.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60486EA; Mon, 5 Jun 2023 03:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=geanix.com; s=default2211; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=XZiVldLWqdwbMBBgGYgkQEvrIRfRmGDyyFJop1yZS/U=; b=T7hQUR5j7ZMGcj3VvxAv/jjgxa efGQdSYUlFpmkdeGq0/zd8M5006USx0Lu+zG/mgORNGqrBp2DWQ61O4ngGmQBLvUqNHaDey2pbNI1 jxzYu3LCJizcb05nRnIdFDBgsbXQxDfdhH0B8kDc/Yx4b7ZTWYr57pZJchokQQ8aaX303k5oSiTVI FwHVsxDd+cUGBUZZ6VvZcs5ubcc28Fvi9LrcvvS6nATXZigL/7VbocfQPjTn2dRA4JldmqR2cOnED RIwoGPPaepMDH+oCH0nzABNaqyTGT1tx6v/M/6zFrOf/+XVIyG8benio5DWSwKdoEJ0Dt4CC9Kso7 YCIHGu5g==; Received: from sslproxy02.your-server.de ([78.47.166.47]) by www530.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q67W7-000FPw-2h; Mon, 05 Jun 2023 12:32:51 +0200 Received: from [185.17.218.86] (helo=zen..) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q67W6-000Ns0-NU; Mon, 05 Jun 2023 12:32:50 +0200 From: Sean Nyekjaer To: Jonathan Cameron , Lars-Peter Clausen , Sean Nyekjaer , Andy Shevchenko Cc: stable@vger.kernel.org, Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] iio: accel: fxls8962af: fixup buffer scan element type Date: Mon, 5 Jun 2023 12:32:21 +0200 Message-Id: <20230605103223.1400980-1-sean@geanix.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Authenticated-Sender: sean@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.8/26929/Mon Jun 5 09:34:01 2023) Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Scan elements for x,y,z channels is little endian and requires no bit shifts. LE vs. BE is controlled in register SENS_CONFIG2 and bit LE_BE, default value is LE. Fixes: a3e0b51884ee ("iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers") Signed-off-by: Sean Nyekjaer Cc: stable@vger.kernel.org --- drivers/iio/accel/fxls8962af-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/accel/fxls8962af-core.c b/drivers/iio/accel/fxls8962af-core.c index 0d672b1469e8..bf7949e51e6c 100644 --- a/drivers/iio/accel/fxls8962af-core.c +++ b/drivers/iio/accel/fxls8962af-core.c @@ -724,8 +724,8 @@ static const struct iio_event_spec fxls8962af_event[] = { .sign = 's', \ .realbits = 12, \ .storagebits = 16, \ - .shift = 4, \ - .endianness = IIO_BE, \ + .shift = 0, \ + .endianness = IIO_LE, \ }, \ .event_spec = fxls8962af_event, \ .num_event_specs = ARRAY_SIZE(fxls8962af_event), \ From patchwork Mon Jun 5 10:32:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Nyekjaer X-Patchwork-Id: 13267179 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BED3BC7EE2A for ; Mon, 5 Jun 2023 10:32:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229701AbjFEKc4 (ORCPT ); Mon, 5 Jun 2023 06:32:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbjFEKcy (ORCPT ); Mon, 5 Jun 2023 06:32:54 -0400 Received: from www530.your-server.de (www530.your-server.de [188.40.30.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60FA0EC; Mon, 5 Jun 2023 03:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=geanix.com; s=default2211; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=Kmh6Q+En4QAQCaRsLzaEanf4GOSbnJbhi38Sn/xlHv0=; b=Wh/DWcCzpVQD50rALlJTjxkC7w WAjloqSEfWAbDDoD++9ZZIr1tei6gpqOEvsBYqaK856XCMAG7L+UJNn6+Wm5bFEdc7A31t+Tm1So4 G7TwY1jomDgyMglxGAvJQ++EIzuz2hfsir8StzS/+7G0O8Nn+1+8KOLOd+KQfCZhBa2OA/9ngY1+8 5jQZ7lQvOKhrPFGHOInvnQVQtijkcgFzf27YZ6kh4YifExj2vVOWW29x4x79rv7+gidcQSTrQPrAk dvL0JR5qNdrqq/QQ5soNBV5vZB+2HyoAumQmEGwrI+Bc8EVRXZZrNQiCqF4/ojC8wdZCN1MrvWV8K je6xEUEA==; Received: from sslproxy02.your-server.de ([78.47.166.47]) by www530.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q67W7-000FQ5-Jy; Mon, 05 Jun 2023 12:32:51 +0200 Received: from [185.17.218.86] (helo=zen..) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q67W7-000Ns0-A8; Mon, 05 Jun 2023 12:32:51 +0200 From: Sean Nyekjaer To: Jonathan Cameron , Lars-Peter Clausen , Sean Nyekjaer Cc: stable@vger.kernel.org, Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] iio: accel: fxls8962af: errata bug only applicable for FXLS8962AF Date: Mon, 5 Jun 2023 12:32:22 +0200 Message-Id: <20230605103223.1400980-2-sean@geanix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230605103223.1400980-1-sean@geanix.com> References: <20230605103223.1400980-1-sean@geanix.com> MIME-Version: 1.0 X-Authenticated-Sender: sean@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.8/26929/Mon Jun 5 09:34:01 2023) Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Remove special errata handling if FXLS8964AF is used. Fixes: af959b7b96b8 ("iio: accel: fxls8962af: fix errata bug E3 - I2C burst reads") Signed-off-by: Sean Nyekjaer Cc: stable@vger.kernel.org --- drivers/iio/accel/fxls8962af-core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/iio/accel/fxls8962af-core.c b/drivers/iio/accel/fxls8962af-core.c index bf7949e51e6c..3f27834ef04c 100644 --- a/drivers/iio/accel/fxls8962af-core.c +++ b/drivers/iio/accel/fxls8962af-core.c @@ -904,9 +904,10 @@ static int fxls8962af_fifo_transfer(struct fxls8962af_data *data, int total_length = samples * sample_length; int ret; - if (i2c_verify_client(dev)) + if (i2c_verify_client(dev) && + data->chip_info->chip_id == FXLS8962AF_DEVICE_ID) /* - * Due to errata bug: + * Due to errata bug (only applicable on fxls8962af): * E3: FIFO burst read operation error using I2C interface * We have to avoid burst reads on I2C.. */