Received: by 10.223.185.116 with SMTP id b49csp818907wrg; Sat, 3 Mar 2018 08:10:52 -0800 (PST) X-Google-Smtp-Source: AG47ELuuGO+fvK1aQzh1MGiCuoFHWBc+cXEn9zbBOepUVENDkVLrpfaoacrhzyeXJ+Vd01OmBY74 X-Received: by 10.98.138.66 with SMTP id y63mr9511155pfd.12.1520093452831; Sat, 03 Mar 2018 08:10:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520093452; cv=none; d=google.com; s=arc-20160816; b=QquUt7wV2uy8bnw4VxyHDMXni8I6EDhacp+Ujjh4q9+Ewk1nOQ6Y7R4kCppYGT7JQU XIIxKO3TSQrtLsNle3C2aojLcivdhuCG5CO3q/xWxhHQwTaXcDNQV3GTMIuJefhX6Pms QYuZj+jrxXjkKey1n31Q6LCYkQ6PnQbCglQ0BNxiYaVq1iqe6yh6qAJ61WAEqmZMhPtM mpQfRTiTsZ7Hvp4Ccpn4gOA6Yq0olCmPKtnONS6Iuc/skDIaIHqtBy7OmOhusgWytN++ 4GYeejI4sdXkVutJT7Vls0q15hEvMAehg6nxFfmF5CXWkP+q1Pey/gMp8P29bjOHwCL0 OWfw== 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:date:cc:to:from:subject:message-id :dkim-signature:arc-authentication-results; bh=+J/v1w2i+pq/P4Va9aceR3oWfG4mG/1E/3Jtyh6bvf4=; b=KtfoYRa4ZwEIAo7zTxtmZLw7QjoH0Xn7tCdqrL6IfAxrb5m+jqRz3QKfhLkrLVZdCQ vz6+FhShYiBrziTT2d2DeVGxcKWUCb0hlDfR0OqA8U7+uxgoErY9h6oHlLHO8L4WJlQ0 ETxX/ztFm6jIYnQlMmoGYKhl+5aQwLcAQUuOCLRPwABVV6XqXK70cjAz/iZX2JpXiGJL GHmgQWP86E5ky04/nY8Lwia7mzws5YLehGrxYAco8VL39oSE9i/YF/84ndtlkpuEiAAc i9AxCiOytuYOXwMS7eX/uNrB9ytpCw2eyYlOcGfnyVWQf7wtoTvWi0l98Q/U84ODhxUq AJYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=A2xTbr0p; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j91-v6si6530295pld.485.2018.03.03.08.10.37; Sat, 03 Mar 2018 08:10:52 -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=@gmail.com header.s=20161025 header.b=A2xTbr0p; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752164AbeCCQJ7 (ORCPT + 99 others); Sat, 3 Mar 2018 11:09:59 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:43234 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751898AbeCCQJ4 (ORCPT ); Sat, 3 Mar 2018 11:09:56 -0500 Received: by mail-pf0-f193.google.com with SMTP id j2so3181254pff.10; Sat, 03 Mar 2018 08:09:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=+J/v1w2i+pq/P4Va9aceR3oWfG4mG/1E/3Jtyh6bvf4=; b=A2xTbr0pPHBSVo2YIuO2VrsMLIkusg7F/wA2seV3dW3dwqE6TqW3ONvpOYOQb8Hz0J 2R2o64zPODzdbDhLuZB/REZtD6iuq4uRLiaCofH2Sh3vcFJb3hD1VIPZVM/PZArB+/sI cEDdKWV36thdWhPd50oDw30Zh/V6S5gveAycrkRDu4cCZPaWiWx3xYXWW72bB+okJ6fz GdrUd7v14tVgXoV+AgOXqMiiL7kZE2Pl1Y2Nt0hONa0aovFz0Ds7PcqYKjGtSzor9SQB loYxS0oo6u0sp/O+1PpHEszjP4e8iuCK3Q1SSwe+XLY5TpklG3tbF1yCfF2qv1HTmnnF 8FZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=+J/v1w2i+pq/P4Va9aceR3oWfG4mG/1E/3Jtyh6bvf4=; b=LvlUC8t8cgyla0gAYv8C2PoS5Ig3E3PybvRABNLcJuNRAYOkoYBRF5rPNIy8mDRCY4 yAW4e8tnbHa+XG3ggtq/vopLLNkVszod8jhBc1M3vWfq5Vd30TRHfnNl2Ly466j5H4+J ryPPqE2G9mhRFDDE2nn1yM7YtzQ5PSih96F+avIwZdvs6LTS1V42VDGajS8jkIDHAbxB Om4vbz4Ss1GY58nHg5QS310BWyo66rOaViA2CHdqpk7WQP3hVtDVx7FSp4vSBqNyltzK ES5+71+v5dyfbBjAjiXpryaq3SENI98NocOLYDZTWFWp91h6A4Kd8dDaV40uD5Vox3wp eAAw== X-Gm-Message-State: APf1xPC4ulp/aeICjg+pI04++MjDq+16G1NbQj90SFVXiwv4Gb6sZdlt e1mwmVn6p1YoqJEfI3F4TxY= X-Received: by 10.101.101.10 with SMTP id x10mr7736120pgv.223.1520093395633; Sat, 03 Mar 2018 08:09:55 -0800 (PST) Received: from [10.0.2.15] ([103.212.140.151]) by smtp.googlemail.com with ESMTPSA id y124sm15053306pgb.29.2018.03.03.08.09.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Mar 2018 08:09:55 -0800 (PST) Message-ID: <1520091212.3137.1.camel@gmail.com> Subject: Re: [PATCH 5/6] Staging: iio: adis16209: Add some informatic comments From: Shreeya Patel To: Jonathan Cameron 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 Date: Sat, 03 Mar 2018 21:03:32 +0530 In-Reply-To: <20180303160155.67113206@archlinux> References: <11a9db0dda77749c865e864c81924c0ec578dd86.1519995673.git.shreeya.patel23498@gmail.com> <20180303160155.67113206@archlinux> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2-0ubuntu3.2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2018-03-03 at 16:01 +0000, Jonathan Cameron wrote: > 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. Ah!! Should have used my common sense here :( Sorry for such mistake. > > > > > +  */ > >   *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: