Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1578972

Re: [PATCH 3/7] staging: iio: isl29028: fix incorrect sampling frequency value

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Jonathan Cameron <jic23@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 3/7] staging: iio: isl29028: fix incorrect sampling frequency value
Date Sat, 11 Feb 2017 10:50:01 +0100
Message-ID <t9Ctz-7ty-9@gated-at.bofh.it> (permalink)
References <t8MbD-81G-3@gated-at.bofh.it> <t8MbE-81G-17@gated-at.bofh.it>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0
MIME-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 36
Organization linux.* mail to news gateway
X-Original-Cc gregkh@linuxfoundation.org, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, linux-kernel@vger.kernel.org, ldewangan@nvidia.com
X-Original-Date Sat, 11 Feb 2017 09:44:39 +0000
X-Original-Message-ID <75a21997-0a63-bff5-441c-838db3bce3b8@kernel.org>
X-Original-References <20170209015431.17380-1-masneyb@onstation.org> <20170209015431.17380-4-masneyb@onstation.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1578972

Show key headers only | View raw


On 09/02/17 01:54, Brian Masney wrote:
> The sysfs attribute in_proximity_sampling_frequency_available currently
> shows the values 1 3 5 10 13 20 83 100. These values are supposed to
> correspond to the sleep values 800 400 200 100 75 50 12 0 (all in ms).
> When passing in a sampling frequency of 3, it actually uses a sleep
> time of 200ms instead of the expected 400ms value. This patch changes
> the 3 supported sampling frequency to 2 so that the proximity sleep
> time of 400ms can be used.
> 
> Signed-off-by: Brian Masney <masneyb@onstation.org>
Given there is no real difficulty in supporting fixed point numbers, could
we move this over to:
1, 2.5, 5 etc

Will clearly require more changes than you have with the fixup here, but
would represent what is going on more accurately for minimal cost.

Jonathan
> ---
>  drivers/staging/iio/light/isl29028.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio/light/isl29028.c
> index 177dced..b63fdf70 100644
> --- a/drivers/staging/iio/light/isl29028.c
> +++ b/drivers/staging/iio/light/isl29028.c
> @@ -471,7 +471,7 @@ static int isl29028_read_raw(struct iio_dev *indio_dev,
>  }
>  
>  static IIO_CONST_ATTR(in_proximity_sampling_frequency_available,
> -				"1 3 5 10 13 20 83 100");
> +				"1 2 5 10 13 20 83 100");
>  static IIO_CONST_ATTR(in_illuminance_scale_available, "125 2000");
>  
>  #define ISL29028_CONST_ATTR(name) (&iio_const_attr_##name.dev_attr.attr)
> 

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH 3/7] staging: iio: isl29028: fix incorrect sampling frequency value Brian Masney <masneyb@onstation.org> - 2017-02-09 03:00 +0100
  Re: [PATCH 3/7] staging: iio: isl29028: fix incorrect sampling  frequency value Jonathan Cameron <jic23@kernel.org> - 2017-02-11 10:50 +0100

csiph-web