Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp505279imp; Wed, 20 Feb 2019 04:11:26 -0800 (PST) X-Google-Smtp-Source: AHgI3Iblo0j3y06o68AcU03GVrevQU7Ifn+B0eNfqlpxt++QPHTowfuqeBIRXsrnCvsrng9Q7wRn X-Received: by 2002:a17:902:5a42:: with SMTP id f2mr26382910plm.157.1550664686627; Wed, 20 Feb 2019 04:11:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550664686; cv=none; d=google.com; s=arc-20160816; b=E++YKtxnWW+WQ14umbttgx5NfvWC+qSiBhbxyOmTgP9BoVRhN7A7Ah9JGWKpoUOyGt s9Qmt+5EojCITbSyHH39RYNcg5KDNr/Rvnzb/6DFFQxwYI5mqDkS8SNXaaw0c5xIMoSS o8inPUw6r8VVPGNbBLE3gyinR/RWTUbNw9eUO3qvv672mibJLBS84DnQUoW7ObqVuivF g/71aMChh7Ec0cINwT9kLusuIt+8jOLX8bo1HW+M40sKpTpHlBuKqNDSvPRJLa5uzB+l nyiqQHrSK8uZHDw6F/2aIe/UQbF53WmjJ3DOBoL3F87j+SRjBSp8/aW1GJ8SwdCieMsl 2jgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=e/Db3b4X85nwKl8JLxuLKs3/9sxlGb7TfuNuK0YayDk=; b=R1saMXgjCh0M9d1/GlxWEMqjL4sbMmrTPxFgUPZkHMp+WzUDF7qnphnBIS2a0Ue3ub mdexHZ7KWjaTz1i1GDv5qDwokwTVbvETN5YABzVDLQgrvjCyrUXEv7HCHP7Rzqxu6feh HYhN2meatcr+uwxmLDNprqpMRjAzjJNb+t9/aN4XdilOtSjFApogAvX0C+keEGjukJP6 pHTdQtqlVLzPxcgm2XV5xPW22xq8QcUhcFEE2RQxc0kSlQhUji1tTN3HTInjjDCNff+c OBL2C2j3XI4lzi/pa3QcjGAcowT9Y8wX8pwDbFWWDdg6bjABZtHa3+pQ6bSjS9UuvKo+ UOvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=n+ow22Bq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t71si18116805pfa.244.2019.02.20.04.11.10; Wed, 20 Feb 2019 04:11:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=n+ow22Bq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726693AbfBTMKt (ORCPT + 99 others); Wed, 20 Feb 2019 07:10:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:58468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725812AbfBTMKt (ORCPT ); Wed, 20 Feb 2019 07:10:49 -0500 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D8B2C20C01; Wed, 20 Feb 2019 12:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550664648; bh=kBLIvt+BwNMZ4NXB6/DD8Fp6ceWVWnGpEWpSzWOwy3o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=n+ow22Bqizka1zeQmAKyFap3i3zFXA6F2YLx5WxRP4MfV13ekD33j7ZVl20gc+/9F 9y+ErFSLy1B3C0uGcbHGMpiZXAPdWixn8ze3etaF07UGyYdWONlya8QWIJtbP58sAC 8IgiPp3MVeLUCrfstmyFWgHTSxvNOki9WCC+vDvY= Date: Wed, 20 Feb 2019 12:10:42 +0000 From: Jonathan Cameron To: Mike Looijmans Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net Subject: Re: [PATCH v2] iio/gyro/bmg160: Use millidegrees for temperature scale Message-ID: <20190220121042.6459176b@archlinux> In-Reply-To: <1550043707-13040-1-git-send-email-mike.looijmans@topic.nl> References: <1549981549-19786-1-git-send-email-mike.looijmans@topic.nl> <1550043707-13040-1-git-send-email-mike.looijmans@topic.nl> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 13 Feb 2019 08:41:47 +0100 Mike Looijmans wrote: > Standard unit for temperature is millidegrees Celcius, whereas this driver > was reporting in degrees. Fix the scale factor in the driver. > > Signed-off-by: Mike Looijmans Applied to the fixes-togreg branch of iio.git and marked for stable. Thanks, Jonathan > --- > v2: Don't touch val2 when returning IIO_VAL_INT > Only touch val when returning a value > > drivers/iio/gyro/bmg160_core.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c > index 63ca316..92c07ab 100644 > --- a/drivers/iio/gyro/bmg160_core.c > +++ b/drivers/iio/gyro/bmg160_core.c > @@ -582,11 +582,10 @@ static int bmg160_read_raw(struct iio_dev *indio_dev, > case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY: > return bmg160_get_filter(data, val); > case IIO_CHAN_INFO_SCALE: > - *val = 0; > switch (chan->type) { > case IIO_TEMP: > - *val2 = 500000; > - return IIO_VAL_INT_PLUS_MICRO; > + *val = 500; > + return IIO_VAL_INT; > case IIO_ANGL_VEL: > { > int i; > @@ -594,6 +593,7 @@ static int bmg160_read_raw(struct iio_dev *indio_dev, > for (i = 0; i < ARRAY_SIZE(bmg160_scale_table); ++i) { > if (bmg160_scale_table[i].dps_range == > data->dps_range) { > + *val = 0; > *val2 = bmg160_scale_table[i].scale; > return IIO_VAL_INT_PLUS_MICRO; > }