Received: by 10.223.185.116 with SMTP id b49csp812103wrg; Sat, 3 Mar 2018 08:02:55 -0800 (PST) X-Google-Smtp-Source: AG47ELuetgnERKo4pVr9x6Ko8mbG8lopRIfORxEd5LnUlQt0FUhA0OS5MiXTmAM6blRCELjdr5qb X-Received: by 2002:a17:902:8b85:: with SMTP id ay5-v6mr8559608plb.329.1520092975742; Sat, 03 Mar 2018 08:02:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520092975; cv=none; d=google.com; s=arc-20160816; b=ZQlEHFDGvfZEM2O562I+9MqP8vA3KBQf4k/i07DGnnVJwHf2yC2MWmyMVltzhT8J1r 2ErqvqLDHjBf2cSbya8ewVDTB9B+0q/3JE2n1zAXGjlwxsM8qg9LSqy3M0XqwWHwuu9Y mOtDx2K/mY0KIw5SePsdRljYRjaG5Ca5fc/ph44wPOzNPGtjsF/Q7EN0xL/KbUW5MyE3 FzLRMSQg7UuoFKx6jGnA3zmQ74I+Y93I8HbE1S9GliTuFN3eyWLavTXamVrToT2YB5NI Kk92gEKaVqcBbRF+Wji1ZfbmCK+sHTx9F2IxK9MBPDcWE0jZRVXRT5r7qWRyccP/zm6G 9tFQ== 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 :dmarc-filter:arc-authentication-results; bh=SOBGtMmoN/bcoIjQdavKAIWwdWbcH3MPaJLwMx06tKY=; b=Wg1VpQPCH+jcpUUL3fzE9//dSSyT+CmeYUKt7hPCiDlGe8HGKXIjpoeWYRbfKb/7zV 1AngoHz4YKpC1ij8fkjw8VMgMWJhUmyDNym7IPlWMDes7TnIxqVXtZtrdLNyxRakuYeI oI/Eg70tEBmBvYrbxiQuKruvgZodQA9yxZpMzC6zG8/GBRg5AvUux+agTt90vjnhRav+ 3ZwA9Jjs324HpPGSTIWf6l80Y9qD5RoWf9K2UgcoJZCVMfmuZz7POMOtdkQnsJgOjTii IUU8KUrwVx+BIcYdm6vJNM6aYdtmyCbz29TyR0BM8I0f1S38uNGQWbyZgEgiVb4Ukc+2 y02w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1-v6si6536654pld.322.2018.03.03.08.02.40; Sat, 03 Mar 2018 08:02:55 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752140AbeCCQCC (ORCPT + 99 others); Sat, 3 Mar 2018 11:02:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:52540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751898AbeCCQCA (ORCPT ); Sat, 3 Mar 2018 11:02:00 -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 8362C2133D; Sat, 3 Mar 2018 16:01:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8362C2133D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jic23@kernel.org Date: Sat, 3 Mar 2018 16:01:55 +0000 From: Jonathan Cameron To: Shreeya Patel Cc: lars@metafoo.de, Michael.Hennerich@analog.com, 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 Subject: Re: [PATCH 5/6] Staging: iio: adis16209: Add some informatic comments Message-ID: <20180303160155.67113206@archlinux> In-Reply-To: <11a9db0dda77749c865e864c81924c0ec578dd86.1519995673.git.shreeya.patel23498@gmail.com> References: <11a9db0dda77749c865e864c81924c0ec578dd86.1519995673.git.shreeya.patel23498@gmail.com> X-Mailer: Claws Mail 3.16.0 (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 Fri, 2 Mar 2018 19:02:48 +0530 Shreeya Patel wrote: > 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. Ah - serves me right for not reading on before commenting on the previous patch. It would have been preferable to have merged at least some of this in there as they needed to be read together. One comment in here doesn't quite cover everything I think should be explained. Please fix that and merge this down with the previous patch (interactive rebase and marking it as a fixup makes this easy). Thanks, Jonathan > > 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. Not miligrams. Milli g where 1 g is the 'standard' acceleration due to gravity. > + */ > *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. */ This doesn't explain the magic 0x4FE so that needs doing as well. > *val = 25000 / -470 - 0x4FE; > return IIO_VAL_INT; > case IIO_CHAN_INFO_CALIBBIAS: