From patchwork Fri Mar 2 13:32:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreeya Patel X-Patchwork-Id: 10254633 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3F280602B5 for ; Fri, 2 Mar 2018 13:32:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CC7127E01 for ; Fri, 2 Mar 2018 13:32:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EA152871E; Fri, 2 Mar 2018 13:32:56 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 B3D0027E01 for ; Fri, 2 Mar 2018 13:32:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424096AbeCBNcz (ORCPT ); Fri, 2 Mar 2018 08:32:55 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:39452 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423276AbeCBNcy (ORCPT ); Fri, 2 Mar 2018 08:32:54 -0500 Received: by mail-pg0-f67.google.com with SMTP id w16so2890182pgv.6; Fri, 02 Mar 2018 05:32:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RInYshlfT2srVgM0w4YAEPSRHwoW7W9k3PaSLcMsxvQ=; b=B08kgiEqkxCwgaYaMTfslC1M1ytPRgIjVyyLrDPR0A3EbCttqjufak6u0j7C8MMP3K dt1W9Lk2Y8S3GNTyFtwHQPp77XvimboIhwy4qZnnBNRXP81OZQeCkpt5tTyeTycttF4v /vLWCRcnwH606RLyrBHz5O/AlELtDQ34pp1Df2YBLRCOVHr2BMjOJeBPVbfSzLUFzgmE loms6K3qF2s5Ea1JrigGU2J98Xn0iBjYlMYqFGzIEIhft3V7gPxgpHOFQ4gg318xCSGR Gkoj7dlElWo4i8Scmr9Bw1jBof0xfB7pk71hbNKT6NGUv4MzDg10vDDN8QCxbq0/K4bZ lusQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RInYshlfT2srVgM0w4YAEPSRHwoW7W9k3PaSLcMsxvQ=; b=bivKdNxEA2huqa4DGOr3DHFFkpQ/D1UbR4McvTe3mXgJjNnIC7qdGB0dMNcUdB+Opr oh0NHdhxGQayzAljB+pHDfIsCOB9fEmyrXRzwm5YEi4YRGtFTV3xRVWQ9iWPvO9o/4HS JlQ8rMIBTZduGbucMcO9SoW1JGX2w9Ua2aOp6+J8hEPLNn36XrlAA+c0iG5WCSmAYD+h 7gH/5/Zg3c6tcys8ZtJTM3YfoZJ7yhq7ib6FiauHiOJfifKe8P6rsagohbRgJunbEUma 8CdDayrfmhQYI1VEdLeP0lp5UkFALHD0aLiKiYBkeV/jwghEkA7Lx55eLJb5xQxq0yP6 nHlA== X-Gm-Message-State: APf1xPBDdjJhmRTsxaftgpk/kPajchymfT9WtftUVT/9AfCdvjNVRaAw MUuOjDMzT7rPiux6XnJJoDA= X-Google-Smtp-Source: AG47ELstQB/2dlszEf9RRwrgwrY/ML9WldwKgtdlhJzt7vst3JYpsw1wCWDTNX3ybjMa0uQSjM567g== X-Received: by 10.99.182.76 with SMTP id v12mr4504206pgt.158.1519997573608; Fri, 02 Mar 2018 05:32:53 -0800 (PST) Received: from shreeya-VirtualBox ([103.212.140.150]) by smtp.gmail.com with ESMTPSA id a66sm13525228pfc.21.2018.03.02.05.32.52 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Mar 2018 05:32:53 -0800 (PST) From: Shreeya Patel To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, daniel.baluta@gmail.com Cc: Shreeya Patel Subject: [PATCH 5/6] Staging: iio: adis16209: Add some informatic comments Date: Fri, 2 Mar 2018 19:02:48 +0530 Message-Id: <11a9db0dda77749c865e864c81924c0ec578dd86.1519995673.git.shreeya.patel23498@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: 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 Some of the register names does not make it's puporse very clear and hence, add some comments for more information. Also there are certain unit based comments which are not providing sufficient information, so expand those comments. Signed-off-by: Shreeya Patel --- drivers/staging/iio/accel/adis16209.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/staging/iio/accel/adis16209.c b/drivers/staging/iio/accel/adis16209.c index d2d1254..7363fd0 100644 --- a/drivers/staging/iio/accel/adis16209.c +++ b/drivers/staging/iio/accel/adis16209.c @@ -27,13 +27,18 @@ #define ADIS16209_SUPPLY_OUT_REG 0x02 #define ADIS16209_XACCL_OUT_REG 0x04 #define ADIS16209_YACCL_OUT_REG 0x06 +/* Output, auxiliary ADC */ #define ADIS16209_AUX_ADC_REG 0x08 +/* Output, temperature */ #define ADIS16209_TEMP_OUT_REG 0x0A +/* Output, +/- 90 degrees X-axis inclination */ #define ADIS16209_XINCL_OUT_REG 0x0C #define ADIS16209_YINCL_OUT_REG 0x0E #define ADIS16209_ROT_OUT_REG 0x10 -/* Calibration Register Definitions */ +/* Calibration Register Definitions. + * Acceleration, inclination or rotation offset null. + */ #define ADIS16209_XACCL_NULL_REG 0x12 #define ADIS16209_YACCL_NULL_REG 0x14 #define ADIS16209_XINCL_NULL_REG 0x16 @@ -155,19 +160,29 @@ static int adis16209_read_raw(struct iio_dev *indio_dev, *val2 = 0; return IIO_VAL_INT_PLUS_MICRO; case IIO_ACCEL: + /* + * IIO base unit for sensitivity of accelerometer + * is milligram. + * 1 LSB represents 0.244 milligrams. + */ *val = 0; - *val2 = IIO_G_TO_M_S_2(244140); /* 0.244140 mg */ + *val2 = IIO_G_TO_M_S_2(244140); return IIO_VAL_INT_PLUS_NANO; case IIO_INCLI: case IIO_ROT: + /* + * IIO base units for rotation are degrees. + * 1 LSB represents 0.025 milli degrees. + */ *val = 0; - *val2 = 25000; /* 0.025 degree */ + *val2 = 25000; return IIO_VAL_INT_PLUS_MICRO; default: return -EINVAL; } break; case IIO_CHAN_INFO_OFFSET: + /* TEMP_OUT_REG has a scale factor of -0.47 degrees celcius. */ *val = 25000 / -470 - 0x4FE; return IIO_VAL_INT; case IIO_CHAN_INFO_CALIBBIAS: