Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752160AbcJVFcl (ORCPT ); Sat, 22 Oct 2016 01:32:41 -0400 Received: from mail-db5eur01on0133.outbound.protection.outlook.com ([104.47.2.133]:55270 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751414AbcJVFci (ORCPT ); Sat, 22 Oct 2016 01:32:38 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Subject: Re: [PATCH 0/4] IIO wrapper drivers, dpot-dac and envelope-detector To: References: <1476955562-13673-1-git-send-email-peda@axentia.se> <9b8c0789-566d-67a3-b4f5-dbe4c69f6932@metafoo.de> <8B9238AE-D53C-4A22-84CF-EC42FDA2DFB2@jic23.retrosnub.co.uk> <736c146284d93633a4692b1102eaadaf@jic23.retrosnub.co.uk> CC: Jonathan Cameron , Lars-Peter Clausen , , Hartmut Knaack , Peter Meerwald-Stadler , Rob Herring , Mark Rutland , , , From: Peter Rosin Organization: Axentia Technologies AB Message-ID: <58b9c20d-6c3c-4693-b073-e5a8f9c4cb94@axentia.se> Date: Sat, 22 Oct 2016 00:58:27 +0200 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: <736c146284d93633a4692b1102eaadaf@jic23.retrosnub.co.uk> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [217.210.101.82] X-ClientProxiedBy: HE1PR06CA0067.eurprd06.prod.outlook.com (10.164.28.163) To HE1PR0201MB2313.eurprd02.prod.outlook.com (10.168.145.148) X-MS-Office365-Filtering-Correlation-Id: 81344213-bb4a-4d39-c3be-08d3fa05c892 X-Microsoft-Exchange-Diagnostics: 1;HE1PR0201MB2313;2:6wZbocGKMKbPh3pnhFmQX62TUxZbTDpYl/KiBKKk++nBbhKF+U/V5KSo+Q3dBprc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vFas7zzalVN+VQ1A16kJiQDB8ypvSP3FnBwU56n7LRC7dSZEpSPvUlF593wFlAgtgZOiGfwrvQKuyrFFNLfHEGkOWgFezIQZY+a5yKXpiwaJDpIwrlR/aLNRDFlGOHoipgr+VZxz3J5e3/H9wJ0l1LAz2 X-Microsoft-Exchange-Diagnostics: 1;HE1PR0201MB2313;31:3fMzAWuWXgLW4Rfd909v1cBKn4go2RGR6ur51YdrAbFi9k/IQ37/26j7SDhH7ML6HNtJkqzszMVg0v464tekQKvuF9bxkVNlUdem9FxbXCZPvXif40vLBr9zC3vCqsoNkEeG1LtJSMjmqvYH7kJHMGvIf0QNcAfmstAwIMoKIz65lhwfkvhW4/GO+JjJ1ok1w/xF1HsrghrsT07hDD7jjmqeELll02f4g1l9PGyAh42Y9rv4RhzaANZWZtDwueYDGaXbJXlXsuqmfUy9cwzZww==;4:eE812WqTl+YMHjj6MBukq2ZRJN7pbbHPlWvN28b0yZ15rHOKUen36xm3P5ejZjncjxb0+shAR9fO/fI4PQnTci11f3jtMGvxFaFPeJQ/+h4unPSrjsOXVGwLSVPb2vnOPPCY32eXTP+bIwRSMQOaqa1yoy7BCisXqNMGEp4JRuC0NHdAdH7/ufDECHLf06jXmhJspulSKaNtEnR22DUtHo2dODx0DSZ2Y3ZPQIrlGmIP8fZ7t9I1KXsE6R2QkvfPKTGjyRqNBUlGhNG/VcpPhoYAAsBJcMVw0KvX27pkVlGkwYVrhBF6z6E+pBDJxH3LbeHaeDd8Gq8kyTYT/AfewzTaMPv1RP3BgDr3QcaBYjGEtPo9p7yb7SwbuBXX0JcedlLW19ko4DsmRJqulVbL7jUlyqo/T6rqu+7IDNazdtwQwreTL5j95hpCe4dTI2We 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)(3002001)(10201501046)(6043046)(6042046);SRVR:HE1PR0201MB2313;BCL:0;PCL:0;RULEID:;SRVR:HE1PR0201MB2313; X-Forefront-PRVS: 01026E1310 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6049001)(6009001)(7916002)(209900001)(189002)(199003)(24454002)(377454003)(377424004)(230700001)(68736007)(586003)(8676002)(81166006)(6916009)(189998001)(5660300001)(2351001)(106356001)(81156014)(97736004)(2950100002)(92566002)(4001350100001)(2906002)(6666003)(7846002)(4326007)(8666005)(110136003)(83506001)(305945005)(4001150100001)(65826007)(50986999)(54356999)(76176999)(7736002)(7416002)(3846002)(65806001)(117156001)(19580405001)(77096005)(93886004)(15975445007)(64126003)(33646002)(19580395003)(101416001)(36756003)(74482002)(31696002)(50466002)(86362001)(42186005)(105586002)(6116002)(47776003)(66066001)(31686004)(15395725005)(23746002)(65956001)(7059030)(42262002)(6606295002);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR0201MB2313;H:[192.168.0.125];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;HE1PR0201MB2313;23:jGhwmfkwYxGetbNdlYTi3LD/CdEMAGEaS6Q?= =?Windows-1252?Q?E9yTu/Lwb3V3Vqw0TJB+B10S/8onRP+nmRLrXGqjmnbtvz5nrflvjK3t?= =?Windows-1252?Q?UlnohYYZdk67QDJSxOZXu38w+c5t9wUDkihs9SuQoT0KVltrA+JdPDkP?= =?Windows-1252?Q?/LvRcbbF6sMGd0QdIgt2sRUdj1aPR/PkYj8Dvxeyf5WbGl4/ClwJnsJS?= =?Windows-1252?Q?Mgw/+xrMziUk+1+Z1611Neu33OFaluwJQmLbbpqPSby95ZmoEWZIbzNP?= =?Windows-1252?Q?7tP5FYcY9tYOMztqdVQ/MErHJQIHhK0ym23VUIEvxbKjNDM4X4hGFrD1?= =?Windows-1252?Q?h61tgrKsSTI6zJ4cPXaZLKaPj2kSXHt7WTew3LVaU7vuIWYfyrZDNkDa?= =?Windows-1252?Q?jEQWDMXWevQOqluydeLhQTyAtzh0YwHoJU3XgS39bIydHqug1D0Ml+Eb?= =?Windows-1252?Q?aIHO8nvCxtb2ksokDAQlC1XWZFa80OpniFb+IaGu/m2K+Upn5c1Rjf3w?= =?Windows-1252?Q?SFygn6y5rCSGrxy41kicYglaLDkFfsZCXHgjjR3QlwukVcp1cE5EZtUv?= =?Windows-1252?Q?U/hU1/1bsuVlq6Ks+lsLEK7nvBGZ7NYy+XQ6ccYNmbN0m6Pt9CCqYqAT?= =?Windows-1252?Q?zPxihMsp+hiCUP432c6rs6l6qdvyW8niKhegD9HAbCdPbbEvUVOzWPgA?= =?Windows-1252?Q?hTVCCSoxhJUBcg93wQiMkeBLjOjoZncf1H60oHufHIDfE2HOrFa47Azu?= =?Windows-1252?Q?luwTf4zcqJ+qlQiMNduzP6IonBxF0KSkOe3SP8ZnB/vJunkpeV+2OiKK?= =?Windows-1252?Q?7hLmi2K6Bo4R0bL7TFnMJRwCsPGQRlMwllG0SOhMV5w4+SzUGflzVijM?= =?Windows-1252?Q?SkITEV6OanwuMN1/nmHEZ3uERuqMMs+wSG67KnXazAXd0pyZUe4ahHL+?= =?Windows-1252?Q?OIclQl2BjgDapFgXLQPwwv9vD+pWXO9yj4JHKOx5DLQ9WfoUoKHkl7aA?= =?Windows-1252?Q?pxWHSvyf1FatSAf64uquxHuV5wZD6e7P2CInhuYGFNU0nmF7jxTJsr0L?= =?Windows-1252?Q?XtPIzjiDp7alaJtxfGB76QWrGzzUgFLwfR13vHfjE5h+Jmc8GyLjRo7L?= =?Windows-1252?Q?EPa6C41HSiz9NTKmD6+sP9bIfKQ/zIXDPx6FaOBgbBCGVVQumy99yxms?= =?Windows-1252?Q?ZGwt+S/RvIz0WR0r9UD7TNvfVDD/xXXHhQHQ34swlTw8x408+bBuKrr0?= =?Windows-1252?Q?IfwufhtZKZGz/Lt8qF26SYsKxiiU6Pjscil4TSRgnLAWbPkw3t3Zi6/X?= =?Windows-1252?Q?k8BZmpTvVTq3aLH34ER+01vnog6dccK3m5PHCm7wYp5lk2CFJ/jvpptz?= =?Windows-1252?Q?z7Fe9ECGKinLd0sKiutA39Vdnz8g6CNxhdOS03WGrCxwoL2C0FCjctK/?= =?Windows-1252?Q?xiNqUnW7sMsJrQK9CMORGFeSH52eBL6dM9PI7ZwXZkgFnN8x0AdrbHzf?= =?Windows-1252?Q?DKyM3BiabUPG/Bfkm8+GBrNsCv+HKsmOCIOSKALI2CpWmo3m275NHIFw?= =?Windows-1252?Q?HDa4TkAL5FHehcjZw43UW6XOP5WqvUFWMWFK3yRuCpdLLItpkdeDf07e?= =?Windows-1252?Q?Sx4OTxUGkSwrVTh4BXE/o7zekbW5aW5HAx+6d03UKpQuQpDaW8vXZhp4?= =?Windows-1252?Q?FcCgl6qy5p+7iLUY0Kyejn9aGbbirGr8jsMXYo3artJZAZ3O7gGCUeu1?= =?Windows-1252?Q?IIEGQGquAfuwIPa7V5w=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;HE1PR0201MB2313;6:KN5ePynhbCVriHXNsrkDHf4LEEkrX23aYnkspazciFQJqmtesoRgV26mUjaXLugqveocTEJ3w81chZF/Vsm5D4IuqYYBlQvKyCvrQM55pHLpaR9IU/WONgvYQocvVJ8GSuSwKQFj2x7aR88niy5826yPg7/8m5bzIJQWtNtZ4iM4GDY19FH19VaBCNHqiJonHpGWsaKIAuMM4a7t7pqixyu1u5cX9q5T2+1eR4VoI1aq0eyqPnd51VXakPyNJHZkPSngvgzYVYEJ950yu7VGmrUTVj7Cw6vLHx569SOxXxoy0gp0jQvNuNh1xg7XgU1t7aVjm/NQhhiLM0ewkIpBOA==;5:CszEgCXlJuAF8rWsLZF9YimxiK1xJzO2KzU1ZFj0c8Eny9Ld+SK6lr4J8l9DCP4to085U1vJO+dkDGfFcfp8cSCASCICZWrOQ+vuFO8Sc52e7+UdCwlnmkLbFdC08Ig8CEzOlyhmhaH0JUaCQK4cMg==;24:LNrGuWGlAJZ9ZBrU0BRdTgVeebgs4Eyqd0v3btiCRWRT1dEzGsIKS63+GpELY/SonPjDJk8h4lZHEfV/IGjXFM3E08KG9kmadfbouvKqzVM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HE1PR0201MB2313;7:fnUpa3p4g7H996pbQbFg6Tb+B33YNGurpQ7WkHwbTBsf98Rsy8qgcpjenxr3OC9RYLUftywE/Yf7sy8NDSCRcfK1qEunKNNs5lMpM/EgRJWHl9Xw/2eyJHzTKTrsH7brmtP75n0VKI7WAXzZd/LupZ8Fj0SDH2tHvjUelqjG9mLOaOalJ0lDdasS7CUb33hwxUkRDviD657xoawbW7F3WP4UMnYo3oD4WJYW/33VG6UGUa50z1dZ6yedtTWJ8yTDmhpukuE/cuaxS5/NUkSRnNtf7a1a8qeWPZ4N1gFPKPsYAIACDWWAuPRP9wBSl2S53rMv4Q/GxeFOXAkI67pgLMuPCSFztPAbQpP6Ds3B4Dw=;23:0sPpbNfAcJHD7keEwpbrwRbeLbGVXIyBCN0FK3LZePZU7lea9Pofqco6Fo1Rp+m+kjJLVjSWgRRAuuZRd3f5ghBC9deU6L5aFFrjB5mNGBXsONOnbbVZSeCOfS4UwZb6Z9eNjBAgNmF0SsbbfLTElg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2016 22:58:32.8037 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0201MB2313 X-OriginatorOrg: axentia.se Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2885 Lines: 65 On 2016-10-21 09:17, jic23@kernel.org wrote: > On 20.10.2016 19:17, Peter Rosin wrote: >> On 2016-10-20 19:37, Jonathan Cameron wrote: >>> On 20 October 2016 18:30:19 BST, Jonathan Cameron >>> wrote: >>>> On 20 October 2016 13:55:12 BST, Lars-Peter Clausen >>>> wrote: >>>>> On 10/20/2016 11:25 AM, Peter Rosin wrote: >>>>>> Also, is there some agreed-upon way to dig out the maximum value >>>>>> from >>>>>> an iio channel? If so, "dpot-dac,max-ohms" can be eliminated from >>>>>> the >>>>>> dt bindings, which would have been nice... >>>>> >>>>> Yes, this is something we could really use. In a sense it exists for >>>>> the >>>>> devices with buffer-capable channels where there is the real_bits >>>>> field >>>>> which tells us the data width of the channel. But a dedicated >>>>> mechanism >>>>> for >>>>> querying the maximum (and minimum) valid code seems like a useful >>>>> feature. >>>>> Not only for in-kernel clients, but also for userspace. >>>> >>>> This was something that was addressed by the rather ancient patch >>>> series i posted that added >>>> an available call back which provided info on range and values for >>>> all info mask elements. >>>> Series got buried by there being a lot of precursors but quite a few of >>>> those have merged since. >>>> >>>> Hmm Google won't let me find it on my phone. Was a while back now. >>>> Will >>>> try to get on pc with >>>> decent email archive later and dig out a reference. >>> http://marc.info/?l=linux-iio&m=138469765309868&w=2 I think... >> >> Interesting, one issue with that is that it is all in real world >> units, while I'd rather have the raw value. > Um.. It's been a while, but the principle was (IIRC) that every > _available would match the units fo the associated info mask element. > Thus if you have a _raw element it would be in adc counts (most likely). > > _input would be in relevant real world units, scale etc in the whatever > units the value itself is in. Ok, so I forward ported that patch and added code so that the relevant channels provide what is available. I also added code to turn the rest of the parameter style devicetree properties into iio device/channel attributes. So, it is now much neater from a bindings point of view. Before I post the updated patches, I'm wondering what the status is on that ancient patch? It didn't forward port without issues, but there were no real difficulties that I noticed. Should I just start off my v2 series with that patch? I tend to think that that's the best option, because I suspect that adding a "max-ohms" devicetree property as a stop-gap pending some new infrastructure is pretty unrealistic... Basically, my question is if that ancient patch as any chance of living at all in a form close to what it is, or if should start looking for an alternative right away? Cheers, Peter