Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753478AbcKGQrT (ORCPT ); Mon, 7 Nov 2016 11:47:19 -0500 Received: from smtpo.poczta.interia.pl ([217.74.65.206]:34701 "EHLO smtpo.poczta.interia.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750791AbcKGQrR (ORCPT ); Mon, 7 Nov 2016 11:47:17 -0500 X-Interia-R: Interia X-Interia-R-IP: 188.121.17.172 X-Interia-R-Helo: Date: Mon, 7 Nov 2016 17:46:41 +0100 From: Slawomir Stepien To: Peter Rosin Cc: Daniel Baluta , Linux Kernel Mailing List , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Rob Herring , Mark Rutland , "linux-iio@vger.kernel.org" , Devicetree List Subject: Re: [PATCH v3 1/8] iio:core: add a callback to allow drivers to provide _available attributes Message-ID: <20161107164641.GA29162@x220.localdomain> References: <1477262381-7800-1-git-send-email-peda@axentia.se> <1477262381-7800-2-git-send-email-peda@axentia.se> <62f150ba-abc0-8e45-1355-8a61354ee3e1@axentia.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <62f150ba-abc0-8e45-1355-8a61354ee3e1@axentia.se> User-Agent: Mutt/1.7.1 (2016-10-04) X-Interia-Antivirus: OK Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1350 Lines: 32 On Nov 07, 2016 12:57, Peter Rosin wrote: > On 2016-11-07 12:37, Daniel Baluta wrote: > > On Mon, Oct 24, 2016 at 1:39 AM, Peter Rosin wrote: > >> From: Jonathan Cameron > >> > >> A large number of attributes can only take a limited range of values. > >> Currently in IIO this is handled by directly registering additional > >> *_available attributes thus providing this information to userspace. > >> > >> It is desirable to provide this information via the core for much the same > >> reason this was done for the actual channel information attributes in the > >> first place. If it isn't there, then it can only really be accessed from > >> userspace. Other in kernel IIO consumers have no access to what valid > >> parameters are. > >> > >> Two forms are currently supported: > >> * list of values in one particular IIO_VAL_* format. > >> e.g. 1.300000 1.500000 1.730000 > >> * range specification with a step size: > >> e.g. [1.000000 0.500000 2.500000] > >> equivalent to 1.000000 1.5000000 2.000000 2.500000 > > > > Is there any driver using this format? :) > > Yes, soon. Hopefully. See patch 3/8 > iio: mcp4531: provide range of available raw values > https://patchwork.kernel.org/patch/9391283/ I would also like to add this to mcp4131.c and ds1803.c. -- Slawomir Stepien