Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932174AbcJUIjl (ORCPT ); Fri, 21 Oct 2016 04:39:41 -0400 Received: from mail-db5eur01on0104.outbound.protection.outlook.com ([104.47.2.104]:35040 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750859AbcJUIjh (ORCPT ); Fri, 21 Oct 2016 04:39:37 -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: <28861d1d-7f50-7ea2-f8cb-5a9d359f74c0@axentia.se> Date: Fri, 21 Oct 2016 10:24:24 +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: AM4PR0101CA0035.eurprd01.prod.exchangelabs.com (10.167.254.45) To VI1PR0201MB2319.eurprd02.prod.outlook.com (10.168.63.21) X-MS-Office365-Filtering-Correlation-Id: c1821417-3fe0-41c8-faf6-08d3f98bae39 X-Microsoft-Exchange-Diagnostics: 1;VI1PR0201MB2319;2:LRfjpReZrTMd7NOmdt8BWacjOSP9RYBKhBQpYrMqqpjeTE8wCjH4pWKsPm+hWu1RiglHOY/+ceKHwB/7QN0YP7TGZ6VWo0bEJhFrtWKfWBIVWM1CDWCZyqcarAJ5tQhBdiqPKC9F23XPUwc0pAvFOKrcAvRLImZk6e9EhWa428AgwRaB26mo+u+DdGr8K/9++qGM1vM6Lh/gV7f31xxQCA==;3:epvxKuinguRn5ie/3162mtPSuxMgI610KOWXVfAB3IJsC0eSlSC+4pKageEGilxWJ4fSZGz2BhLHfXFaBY8lF5cGHoyVjjRhKP3sY9fPnmAgjPjiJ1w2cKcHRuH3nxjqAIDEN+qQidmjLMWESrOieg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0201MB2319; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0201MB2319;25:mWllQMrl/45ITxf1AjvC7G7SeJIQp7U0G9d11hGGUBt0IANWEdA9psXo4LUD3tPWGc/ZZPQIpnqKSe8EmbKgezZIvC8fDdYMK9+AiywA0qUyX1/JTzMr4s95pYveQOG75NoLAjQ6drapJ9hp+B6ijdhVy/aoK8eX8K/dbxFU1/WPxp14bldZl/lMXe7rmTECttvModii+45VRgxJjTLu0ar39dkBhYgyrBTGkjk+s6Do2ig2t58E06L8OfVmXYabI1uq14YSiTI9+1Y8tkaFskZKjXEjuH7NPSOKfqMlX/HD5A+LjUcA03cAwfUqiFygqdX66oVF+jEH0ZONGSptnpeZFe/zBvVXYmyEqEvVseimC48HLE7UFeMzF/K+eR9C8miNTfMsOgshN0p1ufVjViAZDwQu9HSpgiD+di+yOzpB5stD76qKohhB8Kaj06HhsUQMv6XUlim0F4Bl9n71MbMYXR5xGJH3tlKlMZ/WpLNaKsBJojPwDvvu2GvZ9lGq4dDS+pEheuInu9CAph13WGpZGMAHsvh0Sww3xyH07AYN9tznuiLI5TCAeTZBAeHZc33gr3JCy1vJyyIykXjG3tOotKJTzzAKju/8AiD79GXFIYMR0igTMRDJfpkjK2WVuAQnOT5SFy6NQMTXjf5x+ZVbAHtP0QCkDqkBAjOPUkN+061iiE88ZS9e0Ja7lBu15JTVvi7JdsWBPCj7b2cH/d7rloRGrweKBJsgrI/ZpTeUtWtRyxn25s39lLkkrOV39xUdqvEUVmLTzLfmmcbeUDR6VaxOT0IzDAA6CbLjTFU= X-Microsoft-Exchange-Diagnostics: 1;VI1PR0201MB2319;31:xT9dghD0MrfVUFRDV4blIYGy62OPxPkowUL3LaOwU+iGrfpBg8hSqi3hk1oPFPUhreYTTPt53buhQlAg1p/p4U6NP0lZSNxMX/Tn3/l1eINIc4HfKkDB3b7mOl2wXmoAUmy2Nmi0CKY5WeQjIf7vCmez+/oDOcoZEJFIAr33o3ceZAstR45pZTBD2Vc8V5VzQ0yemmexpNf1mTOqhqt8bIYXMdONEULMgKb6hFx1b3oEJRWKSns5062yIFWLQwUh5iN6WKqHOjAi3kaPCqbUuw==;4:vXQuGPnf7L/NkhdQQ7ZK8spuS0jBx+HvYh+c4LYBfLq/HC6Y2oQsu3ZXhL+iztWRPD+GuwxnwGbLBkkfnjhQi+6eMUZ9r3qK4TJ+1pkbUzQEcYPGCR8zD647SEayLn+1tOotbAQ91+lYYd8ceXq3zKuLoF4wzFNGqYX9aNcd5JSX+vAFxLQ3fXItkA1HDlXC40yIJr0HxVN2OVboLeDrVsXayZyrvJJx2aMHaB4BcgUN4UoUyngT4rJfIhoY3R742abA3rjvbV4jb8FEnMLElkRutAzo5m15o1P4J8RyVMmAs6aADVJnEnTnpmROtZ/RkmrVTVMkHhXVPZ3/GfxmB8ldRR8+8TMvIa6/T6HwzldMexQTLIY1LshwnWi/vsJzyE95MlmY9DlI4Dtjv7sKHZ+qmtXbSc1Bfwg4El1ILYtzGr8FcAivnRwfSqTJCdB0 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:VI1PR0201MB2319;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0201MB2319; X-Forefront-PRVS: 01026E1310 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6049001)(6009001)(7916002)(209900001)(199003)(377424004)(189002)(54094003)(24454002)(117156001)(7416002)(97736004)(66066001)(101416001)(6116002)(586003)(19580405001)(31696002)(86362001)(3846002)(23746002)(4001350100001)(65956001)(74482002)(93886004)(230700001)(19580395003)(65806001)(33646002)(92566002)(15395725005)(2950100002)(110136003)(50986999)(64126003)(36756003)(83506001)(2906002)(4326007)(65826007)(42186005)(4001150100001)(106356001)(47776003)(7736002)(7846002)(15975445007)(8676002)(6666003)(54356999)(2351001)(5660300001)(50466002)(77096005)(81166006)(305945005)(6916009)(105586002)(31686004)(76176999)(189998001)(81156014)(8666005)(68736007)(7059030)(42262002)(6606295002);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0201MB2319;H:[192.168.0.125];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;VI1PR0201MB2319;23:oQObGU+CeMcSPs4lLAXeVFqjnpQiMq/fySN?= =?Windows-1252?Q?JWx7a8JVk57/erz9Xia5RoHYVZcFZgmVHceA58yV8qz3KO+QX89S4nwk?= =?Windows-1252?Q?rLaml264+dx+KDnmE9OZPlJFtQem9xFeniGQy311ldVzbKN7rii0Tr9D?= =?Windows-1252?Q?lxMj/SoalAlahIslsIJWneuc4YS8/bvLRuLgvFSvEW0hkxN34khl8T96?= =?Windows-1252?Q?BbOK8o/L49ecvlSmP7agUCElbSTQjukUBeLw5MWxA5cMU1Q2/bs8uQI2?= =?Windows-1252?Q?JxWKMVIFkKYKJwS7hTXSjLuBifAfO6XUcXGZbxJuz7waUic/WN2uOc+U?= =?Windows-1252?Q?5n6jn/o0g+l4y16puEX1prFSLfZK1tEaO9VE9YZ4AIcR1W/cG9gw4+cQ?= =?Windows-1252?Q?4OxMUygdtSztV9obYqBsXaAGE1+kgp5n14DzvBWERIEptESXoHIwPaOO?= =?Windows-1252?Q?IUrlVG8zbzgxzHUYw14A6G0sFja5zgR/R+8C0yne0QMsBUCx49pnftHT?= =?Windows-1252?Q?7PX1xXH+lsolBBgEHy6ch3jBiKLRyJ3Iw66o0dbuh9ATB8ZcTfT5HQjy?= =?Windows-1252?Q?D8w1FLiRUiDXKgt4NJcJync7PVaKpqo6UnGIMtQQoaG6EbcxmxMzevCn?= =?Windows-1252?Q?XGm3r4E5mVOaNT4eG8iIs02C8uHcJA82htvQmx1PEIQuJK/Cb87lJmBc?= =?Windows-1252?Q?E5Wom/p5qn6WEVyRVRSN/Bg2IMgAGFBpwjh8tEEIrC4ZidrMndBOwXqA?= =?Windows-1252?Q?u3W53GqOco7/70g1WmhdgTjg6Bxs6fcIhwEr+WT7xC1nEcz6D1lB0H30?= =?Windows-1252?Q?Bdoytp6A7Ku/Pv0ww9CYxvmUr/tvSs6f8qT7TpRJbAvPiQKFGonTt8yx?= =?Windows-1252?Q?MbfKYP1fRVD4lkrRs70EUkhW6RcsM8/0o6lWbaJ7AMr//ba0PEJIguQP?= =?Windows-1252?Q?IEPFW3GA44Xu3/4mDq9+Y4Kb4MZmCOJ1sOH7goXfVGDRijmX2Tmz6bgs?= =?Windows-1252?Q?1IdcqpDYztXEDb/36m1M2zpPOmatNYzG/09DF9Kt+h+siLmZ0P03y+lo?= =?Windows-1252?Q?zeQ49vIU0yOzSDHMx3spZCEaXxPKiOQmzn9IF9R/QDglm7lz8PJnmrJS?= =?Windows-1252?Q?PoQSg0HKxOnFE7fLyLk75Ms43QH8wF1mUxK3wYTZfpIrV9T0nvuTfiGY?= =?Windows-1252?Q?2+tQojg4usgUQX81OarRJ62a+EEvYnx7k1a5gUi8gvVeEr9UTUCD8avB?= =?Windows-1252?Q?ZwkyQ7SjaEXiydtm4x5tuif0W8itRiO4sSVkIqgTYJ1q5Y3zPTbY25aC?= =?Windows-1252?Q?xBTyo5kNbIsAprdy0yL7qbBfOKeOWajlQBukARi5kGZEdpUYqvuzjDV2?= =?Windows-1252?Q?irMbBTfoHXWDp/2HVERhAdaFIKTNuEPh27oouaDamTrb/2OI8AAtAfbJ?= =?Windows-1252?Q?BZ9TWJTa+Kp80JZ84CtUoPyAmRkeZGOxda9kmYUdFeRioxI4W1eHEU7b?= =?Windows-1252?Q?nSUbR8siWLNqlmKsnovY0pcaCm37qTnR0cJIPTO9OcuxzJdVCWnzTIu+?= =?Windows-1252?Q?kfrgyHPHbp+HLtgdqUvCbbRXhUmju79byoH+qtYJ9tqtD2lBnsEud4sY?= =?Windows-1252?Q?zuYbuIfnxM2Uya8DA2GyYe+te3a6YlfijM4KNyRGx1O9JCGhaCaPpzau?= =?Windows-1252?Q?G7hjlwVObU0/pTOMR/YN0cOZ3kMhm7Fc3Ce7wlsZCBG3zJdZTu7j+WD7?= =?Windows-1252?Q?9P+PWhCAHoZDIY/Qb8Q=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;VI1PR0201MB2319;6:DzXGGvsh5KUyN5OuHofYnr08xmO2g8REXxe56a2bxv5mFEajx9JK5lORqo/ai/0wnA44VotsB1k7zhRhy4FrW9yIt6rH2fpkBlM/S+V9jEL+wscrpCf6vTxpGzu712BxCZxRfAF1ThipY87o7JJwd34dUpza9nKDY8u7Go4sV1ZGmhN3uaM3MFR1SKXgKhrxjqbhOj5ktWGZp88ciR0p9FKAn0mhimcOF0tAvfbFQCy8l0ONZkJCLM3r+SdDlHrhmZZtWkxiZ4VprRA0/FK4Ff9aMl/VgIjJ37rQggpc40JvDHb5T4jCyctSn2iR7hcm+mNLQPtvz/FIv7GiOF0wzA==;5:yIwF4kSn9TdeyhBzWAOhnp5B1KPeO7vkjzTnhh6EonOCmumehGrWg8fy0xszPCeIgWXnZPew4MJ9txW1SchA6sMP85yXW8Mk+k869NSE7D4HkHQEvzjHmZTSdqXEvNbN0w39EJ2XGPxitih5m1diLYk9c5toH/G6Z70ecCqHWbQ=;24:lTbD8RTdzDEonvHeCxysie/NHwABCOMqeUZPoLMzAcjgnCyZkvEvX2b2VS4OVu43GlLtCtUZIfuXUS20WX6+K9oBAkV3GjcvmiI3LS66lSk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0201MB2319;7:mnGvXNenwsCRX3PXscdoYaL/PmLAyHko0BM4bE6gz6Iy9moguf0GeU51Q+HHeg+IeW4huSOYFfuXzDpXM2gwQ6XBtVwHRc6pdsF5qG0IwrwZu2c9GQItMdPDXxQr7KMBr+qgT1+6JNPTDFCjuo5MmNjzAiBVwzGe3iy1O9XhmUwS1ibKkBL4DKj5AQ7ASzhLR0tgJrc6C6LYnCRnTtQ8LeL/h0CbW/2/qoAkV0SSace10Fef7f1ubxut4wK3F6J6qJfdtap517O317ytpnz8AGZVT9rtflvnyxnziLkYqhcmjIWFohTGfDU5GiD6blXQPrFlaz2vXdj+ikBH0W7Ae7JV3nkSOR8k+I6emtjNIBg= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2016 08:24:29.7078 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0201MB2319 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1485 Lines: 35 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: >>> 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. Ah, that was just me totally misreading the patch. I didn't realize that the iio_format_value function is also used for raw values and assumed it was all about real world units when that function was used. Feel rather silly ATM... >> So, I would need to >> convert back to the raw value using the scale, which sounds boring >> but doable. However, I wonder if calibration may also be involved >> with that conversion back to raw for some channels? That sounds a >> bit more driver specific and potentially troublesome... > I've not had a chance to look at your code (only picked up on this as > there was a fair length thread developing), but I wouldn't have thought > we'd > need to deal with calibrations. Might need them to move to real world > units from raw but that's always the case anyway (unfortunately). Right. Cheers, Peter