Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932400AbcKGPbl (ORCPT ); Mon, 7 Nov 2016 10:31:41 -0500 Received: from mail-ve1eur01on0139.outbound.protection.outlook.com ([104.47.1.139]:42740 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932224AbcKGPbh (ORCPT ); Mon, 7 Nov 2016 10:31:37 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Subject: Re: [PATCH v3 1/8] iio:core: add a callback to allow drivers to provide _available attributes To: Daniel Baluta References: <1477262381-7800-1-git-send-email-peda@axentia.se> <1477262381-7800-2-git-send-email-peda@axentia.se> CC: 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 From: Peter Rosin Organization: Axentia Technologies AB Message-ID: <62f150ba-abc0-8e45-1355-8a61354ee3e1@axentia.se> Date: Mon, 7 Nov 2016 12:57:43 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [217.210.101.82] X-ClientProxiedBy: DB6PR0601CA0025.eurprd06.prod.outlook.com (10.169.209.11) To VI1PR0201MB2317.eurprd02.prod.outlook.com (10.168.63.19) X-MS-Office365-Filtering-Correlation-Id: 76beaba0-96b7-41a4-1591-08d407054bf3 X-Microsoft-Exchange-Diagnostics: 1;VI1PR0201MB2317;2:K3e/bGsZyUYnVV/QIOC1OEvtCgcR5I8x7zeTwexeto3aHnoYwNxHr1xFgZYlLJiV5w+sr04wqgtg7o3SGJNe3AT15g4nXXm2u9PccTpH+yHWKi1tHzaa0W7eDjKS3hCj9RYqUYV6mgoi5gvxcXX6DHb6vOpF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mP+u0wLPaEprUHHR1fRzxKVhlCbrcpRNh46v0qiD+zv64EJWkphTlWhT7CNfAGoBUOPvCku53uetvt9Xk1XBMMDdRw2Yr7lJQBJx2cZZJwaClLY+tF1L2V/BBOd1ikbO+LxReoOZu2Biwgr/K43IIGmRt21tac2GTcLINdWJ+70OnbYe7emB0c07mm/T2wh1Qli9hwSBWU3yUyOdk01LnWDZHotmrXl8OgkmeJax6nMxLYB0d9pmikniamOzk6INj4sGDyyK1whXGnngu0EwmZLPHeAnwFmmtXZ451yjjU4rtoM52/8u2GI7vl9eoFNkzDIktuVzPAJmCybI7PMw17/u4+FdbI0vFgCbtmocScX1sE9UBN4BmRg1Bi6gTnvIGxGEbN81ZyeHRNZbhVHX8HDZzE X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6043046)(6042046);SRVR:VI1PR0201MB2317;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0201MB2317; X-Forefront-PRVS: 0119DC3B5E X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(6049001)(7916002)(199003)(189002)(377424004)(377454003)(24454002)(19580405001)(31686004)(65826007)(76176999)(54356999)(42186005)(8676002)(110136003)(50986999)(7736002)(6916009)(2950100002)(7846002)(4326007)(23676002)(81166006)(81156014)(15975445007)(105586002)(50466002)(106356001)(5660300001)(77096005)(305945005)(64126003)(36756003)(101416001)(7416002)(3846002)(65956001)(83506001)(65806001)(586003)(47776003)(92566002)(66066001)(6116002)(33646002)(8666005)(74482002)(230700001)(189998001)(97736004)(86362001)(31696002)(6666003)(2906002)(19580395003)(68736007)(4001350100001)(117156001)(7059030)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0201MB2317;H:[192.168.0.125];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microso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QzNjVBWWE1S3hnYlkrQ1NTdFJH?= =?utf-8?B?QXdsaWgzZW5QTW1YeU14a3liTG9DbS9Zbi9STTF3QlAzbm9XZEpWMTQ5Kyto?= =?utf-8?B?RHovTmZuSnBDNDVuWTZwL2cxUU03RGlpaGtDb29lVmp2NG4raG5TTDRpZ0FE?= =?utf-8?B?ckI1NmxHUkxaVE9RMzZLWU12anVyV01Nbm1ZRDVWTWovSG1pdmJzYWx4UDZJ?= =?utf-8?Q?kArslaOL?= X-Microsoft-Exchange-Diagnostics: 1;VI1PR0201MB2317;6:SpZiQO9oKhzLGrWFym4kZODQwf+iE65mr0fYZjF163VmO+Pfxeqh61OiiWjfB8FLar0FONKCP63BQypvS8cbJtephVJ8KwEGBKCcEfbhCHId1wjrpoHAeSKT5MlHRgN1NjPuB1FCxXDWB1NE+0unwu98mCOlp05A7PSa2C03NXBwbvo1nxZmwwYe6udwbps3gPhHXitpaS2uVwN5numlLS6yKB7AsIWJm7b9zCsOdSZPmrMvUfopR6NrbP90aScPC5sFFcSRNtlyeH1frXi+G3oTVVPi4w4J5wLwlBUXFpCC55DzOtHdnVoCWzM55cuYCNMjF2jIU9IW748Jw9NICA==;5:A0nSFIjsrBP/qoYTsst2AETn1YnxU9zZZqFQJtsADZIg3ItkgpJyJELLfuVD53d+0QdcwcoBCYMoRQVcdvw/v/r0Ohh3yTNQc8/trsdjXgzUznmECF8Cm+0fSjKzqJIbKc/gfqgvejnGrBmlh1WgK8aLZlaXDpyFqJaYT8QTZAo=;24:uPgxfe36I5OYrrFd5uczasUKQbmxg9d1kX8idIp//Qv+g5ztLTK6qiNFCSLMq2yRuywcBivPNjoL0JRh3+L8eL7ThB/9tyZpqp47RVyda6Y= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0201MB2317;7:qa+FjGWTJ95T05rdLOAQ8dyCAscde/eJBukIRMJ1/X1WTcYiHEoNl+UY8auXxwoXEtXNASbrKYuqu7YB6bD+wtxWZKkfcF3vM8K528RA8jS6FUQq7hL9WbvFYyFxB3sy4mqgC9xm2GxR/ArTf/A7sTY2JVGbTB6FZJBv/gRbjRNroJpfbtKXTvNHvEWejPuWx1Brs/EnUxFYi9DhGx/61pFo/povTnlLYH81ajI0zRvcRUWpaHH1vWtT3Mp39P8qr2rZkbIxw1peQv5OROGoR3zcB7uWiWFEIE/jeWlRTQe+IYSAfpk30SmhAlzefQAZYRNmU7UOlFPCWY/dTAwad1QTTxkAYH07Hanc2zrlz2Y= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2016 11:57:48.1923 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0201MB2317 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1877 Lines: 51 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/ >> >> An addition set of masks are used to allow different sharing rules for the >> *_available attributes generated. >> >> This allows for example: >> >> in_accel_x_offset >> in_accel_y_offset >> in_accel_offset_available. >> >> We could have gone with having a specification for each and every >> info_mask element but that would have meant changing the existing userspace >> ABI. This approach does not. >> >> Signed-off-by: Jonathan Cameron >> [forward ported, added some docs and fixed buffer overflows /peda] >> Signed-off-by: Peter Rosin > > The patch looks good to me at a first glance. Thanks, may I add your acked-by if/when I respin? Cheers, Peter