Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp4836717pxb; Mon, 28 Mar 2022 04:20:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4L9GtEneGECEopryPjKcinX6NIz5DQTi8OgW0oIlKpYAOV5QOYI1kOzm9mqcioY3Ja1BX X-Received: by 2002:a05:6402:2216:b0:419:25d2:3652 with SMTP id cq22-20020a056402221600b0041925d23652mr15299806edb.277.1648466417008; Mon, 28 Mar 2022 04:20:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648466417; cv=none; d=google.com; s=arc-20160816; b=rgCjJI5yX2WXpBsq11xypzowzUkB1cEOY5qAQbLpIFOJ9fvgQr2KTAymQo3l2cYIs/ 5AlHsAjbeOoYQc8b/3MUnyqHeDlhSIIedDtHqfjX3rWwBpjf/vvHqBdJstNE7YD/Azx0 5VSnArDnR6HUu3/PYtRfDio3NCSK3DcNq+9BAJ1Q80CvroqrBhgJ470jmc2mKUuOntyc MCvero0jI8k7YJd6I3nfqaqSbGJmRk+W7GYODUwKtxAMNt7oxslC/6AuV5H+PKP7EIKA nqcX+D3uth5+7rxUXq1iFqXDQpTLlSxbeRwsPJDc8EHoOuVHxdABMLbO8dzHhCaU/B2p 5m9Q== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=hxAhZxm3heloqNsdiM/ATbQ/3+QULG5rKuH+qpgAivg=; b=w9MHH+rHoJwGBeZWGtEAvnQVAcLj0Pdz4TS3uKUvff2O3BIifZqPGcLdPvC9pCZRa2 W0KsZvfWQo27I8RWiySJNqjBgHqbP0iNnW8oVWlCwWBy2Y6/NZSzP1PjFBaBsn0NaA2g xx8m/dOieLMiEMxsftmmCy5gnBt/3dos8iSWKPMsjE4Bmc20/q8A2lx6hniYmw0/xtkm zrwroIRmWW/FIx6F/uAae9HRGePGwgo3E8bsdDHhcgp1wtVTVL6Y/eIdnqNhRVR/FYGE 9eIzUIJZqq8Mm7BbR2HUVPXTN8wOKFrDe38yRSzbB5TnHJlJV3dpK0r/sskTdaH+n0AD VbkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Kf2cFa0w; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h8-20020a170906854800b006df86288387si12753051ejy.162.2022.03.28.04.19.51; Mon, 28 Mar 2022 04:20:16 -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=@kernel.org header.s=k20201202 header.b=Kf2cFa0w; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235973AbiC0QZ3 (ORCPT + 99 others); Sun, 27 Mar 2022 12:25:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230418AbiC0QZ2 (ORCPT ); Sun, 27 Mar 2022 12:25:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF3AE4C40C; Sun, 27 Mar 2022 09:23:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 90A9861090; Sun, 27 Mar 2022 16:23:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1471EC340EC; Sun, 27 Mar 2022 16:23:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648398228; bh=YkDb6E6VtnXov8jHR1w8NK/7WAyUsl5XyV+mYViI/iE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Kf2cFa0wjjny3JaXVOXkLznTZSEzTiJG74AgLuspd+sBI6qwCUs6j+1HJZmiPVKEo AQegVXVtLyP0vibmflnZhuY77ZgkvWLVe4QS1n7k+SdcWYLz4EfhinS4mdJlmLy9+N zAvJCUxVDpG59aISHiO26KDh8flWqCA3ljekS4RFHUCwnCWlx9MrQUyiMKfLc+C7Zj vhlvL3TDjgXdo65htGao+nYkEGyyaue5J75HM/OXp7+t1RBXHmgDSd/HdbKxtu2lUo lVzSIFznum8jc0na+LePshZjhTt72aOS85Yd9JQ9+k5I9GauKgRgJHthh32klFnKtM Y4Kizvk4vbRRg== Date: Sun, 27 Mar 2022 17:31:20 +0100 From: Jonathan Cameron To: Jagath Jog J Cc: dan@dlrobertson.com, andy.shevchenko@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/5] iio: accel: bma400: Fix the scale min and max macro values Message-ID: <20220327173120.78fd5148@jic23-huawei> In-Reply-To: <20220326194146.15549-2-jagathjog1996@gmail.com> References: <20220326194146.15549-1-jagathjog1996@gmail.com> <20220326194146.15549-2-jagathjog1996@gmail.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 27 Mar 2022 01:11:42 +0530 Jagath Jog J wrote: > Changing the scale macro values to match the bma400 sensitivity > for 1 LSB of all the available ranges. > > Signed-off-by: Jagath Jog J Hi Jagath, > --- > drivers/iio/accel/bma400.h | 22 ++++++++++++++++++++-- > 1 file changed, 20 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/accel/bma400.h b/drivers/iio/accel/bma400.h > index c4c8d74155c2..190366debdb3 100644 > --- a/drivers/iio/accel/bma400.h > +++ b/drivers/iio/accel/bma400.h > @@ -83,8 +83,26 @@ > #define BMA400_ACC_ODR_MIN_WHOLE_HZ 25 > #define BMA400_ACC_ODR_MIN_HZ 12 > > -#define BMA400_SCALE_MIN 38357 > -#define BMA400_SCALE_MAX 306864 > +/* BMA400_SCALE_MIN macro value represents m/s^2 for 1 LSB before Multiline comment syntax in IIO is /* * BMA400.... > + * converting to micro values for +-2g range. > + * > + * For +-2g - 1 LSB = 0.976562 milli g = 0.009576 m/s^2 > + * For +-4g - 1 LSB = 1.953125 milli g = 0.019153 m/s^2 > + * For +-16g - 1 LSB = 7.8125 milli g = 0.076614 m/s^2 > + * > + * The raw value which is used to select the different ranges is determined > + * by the first bit set position from the scale value, so BMA400_SCALE_MIN > + * should be odd. > + * > + * Scale values for +-2g, +-4g, +-8g and +-16g is populated into bma400_scales > + * array by left shifting BMA400_SCALE_MIN. > + * eg: > + * To select +-2g = 9577 << 0 = raw value to write is 0. > + * To select +-8g = 9577 << 2 = raw value to write is 2. > + * To select +-16g = 9677 << 3 = raw value to write is 3. 9667? > + */ > +#define BMA400_SCALE_MIN 9577 > +#define BMA400_SCALE_MAX 76617 > > #define BMA400_NUM_REGULATORS 2 > #define BMA400_VDD_REGULATOR 0