Message ID | 20230605103223.1400980-1-sean@geanix.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2591223vqr; Mon, 5 Jun 2023 03:51:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4P1guNvc235O180Hq4fGfE6KuWovsB86AAWc89rZf5/FO0ggv8+Z3AFOMVAbtDcVOKOyk4 X-Received: by 2002:a92:b106:0:b0:338:b485:baf9 with SMTP id t6-20020a92b106000000b00338b485baf9mr16674379ilh.15.1685962290261; Mon, 05 Jun 2023 03:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685962290; cv=none; d=google.com; s=arc-20160816; b=L/PlWejUVdEeim3700byTnsrvpuLhUn2E+fuMMIOXheHz5+K0oDM4Ynrkd0eHjmHm/ ON6Sch7FN8EmGh/RoZs/F0+Aga/IOyZmd/ZpDRaXudsqbxkp8Jubm9MNTpRUqBTfZhx5 Kdpm4V0SDB8FyPCLhkXqbEMsFJCED962QlhbcDpkwevAmsgdUhvzxikITHIPqeRVclsm BY+diCyw+UO9GrDRUD5Sh0l3wHeeTIfkR790zqJGPFLtEL5ZqeyACNIyh07Q7N9Go5Tl wxBKdeP5e3eMYlxR+cmId/j5OR0jv1munN9k7gkgttJitI+TIT92K1DzrMnxIvg+Uo5A y2sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=XZiVldLWqdwbMBBgGYgkQEvrIRfRmGDyyFJop1yZS/U=; b=HIC02d3x6E/AZxaTYurxhRiq7E8jCFcIaBln05Esc85k3LFi8l3X1DIlBHxPZHIFz2 UZnreGmMM4O1FRK/0mu7M0MmBg8CVqQJ0kFZ3V7zNZWTqYL5K0ks4TyLWxsDQcadez+6 fBrpwY7cPh1dZGqlo4BLotjGXqnKpXAfSreHfqiOWiRXAq+I4+YhPCZuSOd3OsTtrMMc QEYQRNrQ6YrrSTyFkP6XW8CXAj0jLd402VIt2agLwnISMTKJa0EkMwDGn80mE8JOudul 9p0Fr1WHzEK3f33FH7kU3yl3Vo8P2I7nl9yf1V2z7P7Lx079G9Hl1etWODY1DD6uAh4C 24JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@geanix.com header.s=default2211 header.b=T7hQUR5j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bu21-20020a632955000000b0053f0cdab80csi5358408pgb.338.2023.06.05.03.51.17; Mon, 05 Jun 2023 03:51:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@geanix.com header.s=default2211 header.b=T7hQUR5j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229996AbjFEKc4 (ORCPT <rfc822;pavtiger@gmail.com> + 99 others); Mon, 5 Jun 2023 06:32:56 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <sean@geanix.com>) 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 <sean@geanix.com>) id 1q67W6-000Ns0-NU; Mon, 05 Jun 2023 12:32:50 +0200 From: Sean Nyekjaer <sean@geanix.com> To: Jonathan Cameron <jic23@kernel.org>, Lars-Peter Clausen <lars@metafoo.de>, Sean Nyekjaer <sean@geanix.com>, Andy Shevchenko <andy.shevchenko@gmail.com> Cc: stable@vger.kernel.org, Jonathan Cameron <Jonathan.Cameron@huawei.com>, 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 Content-Transfer-Encoding: 8bit X-Authenticated-Sender: sean@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.8/26929/Mon Jun 5 09:34:01 2023) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767859594885903980?= X-GMAIL-MSGID: =?utf-8?q?1767859594885903980?= |
Series |
[1/2] iio: accel: fxls8962af: fixup buffer scan element type
|
|
Commit Message
Sean Nyekjaer
June 5, 2023, 10:32 a.m. UTC
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 <sean@geanix.com>
Cc: stable@vger.kernel.org
---
drivers/iio/accel/fxls8962af-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Mon, 5 Jun 2023 12:32:21 +0200 Sean Nyekjaer <sean@geanix.com> wrote: > 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 <sean@geanix.com> > Cc: stable@vger.kernel.org Hmm. I'm not going to ask how this didn't come up in testing before now... > --- > 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, \ We'd normally not explicitly specify shift = 0 as that's both the obvious default and what C will give us for free. I'll tidy that up whilst applying. Applied to the fixes-togreg branch of iio.git. Thanks, Jonathan > + .endianness = IIO_LE, \ > }, \ > .event_spec = fxls8962af_event, \ > .num_event_specs = ARRAY_SIZE(fxls8962af_event), \
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), \