From patchwork Tue Feb 12 14:25:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Looijmans X-Patchwork-Id: 10808069 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A5E4D13A4 for ; Tue, 12 Feb 2019 14:33:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96DEA2861D for ; Tue, 12 Feb 2019 14:33:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9509329003; Tue, 12 Feb 2019 14:33:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7E1428A44 for ; Tue, 12 Feb 2019 14:33:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727952AbfBLOdv (ORCPT ); Tue, 12 Feb 2019 09:33:51 -0500 Received: from atl4mhfb03.myregisteredsite.com ([209.17.115.119]:40186 "EHLO atl4mhfb03.myregisteredsite.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728314AbfBLOdv (ORCPT ); Tue, 12 Feb 2019 09:33:51 -0500 X-Greylist: delayed 467 seconds by postgrey-1.27 at vger.kernel.org; Tue, 12 Feb 2019 09:33:50 EST Received: from jax4mhob14.registeredsite.com (jax4mhob14.registeredsite.com [64.69.218.102]) by atl4mhfb03.myregisteredsite.com (8.14.4/8.14.4) with ESMTP id x1CEQ2H9011869 for ; Tue, 12 Feb 2019 09:26:03 -0500 Received: from mailpod.hostingplatform.com ([10.30.71.205]) by jax4mhob14.registeredsite.com (8.14.4/8.14.4) with ESMTP id x1CEQ09A152003 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 12 Feb 2019 09:26:00 -0500 Received: (qmail 28747 invoked by uid 0); 12 Feb 2019 14:26:00 -0000 X-TCPREMOTEIP: 81.173.50.109 X-Authenticated-UID: mike@milosoftware.com Received: from unknown (HELO mikebuntu.TOPIC.LOCAL) (mike@milosoftware.com@81.173.50.109) by 0 with ESMTPA; 12 Feb 2019 14:26:00 -0000 From: Mike Looijmans To: linux-iio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, Mike Looijmans Subject: [PATCH] iio/gyro/bmg160: Use millidegrees for temperature scale Date: Tue, 12 Feb 2019 15:25:49 +0100 Message-Id: <1549981549-19786-1-git-send-email-mike.looijmans@topic.nl> X-Mailer: git-send-email 1.9.1 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/iio/gyro/bmg160_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c index 63ca316..ad7f8cb 100644 --- a/drivers/iio/gyro/bmg160_core.c +++ b/drivers/iio/gyro/bmg160_core.c @@ -585,8 +585,9 @@ static int bmg160_read_raw(struct iio_dev *indio_dev, *val = 0; switch (chan->type) { case IIO_TEMP: - *val2 = 500000; - return IIO_VAL_INT_PLUS_MICRO; + *val = 500; + *val2 = 0; + return IIO_VAL_INT; case IIO_ANGL_VEL: { int i;