From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751672AbdB1JFN (ORCPT ); Tue, 28 Feb 2017 04:05:13 -0500 Received: from www381.your-server.de ([78.46.137.84]:44825 "EHLO www381.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751285AbdB1JFE (ORCPT ); Tue, 28 Feb 2017 04:05:04 -0500 Subject: Re: [PATCH 1/2] dt-bindings: iio: stm32-adc: add option to set resolution To: Fabrice Gasnier , Jonathan Cameron , linux@armlinux.org.uk, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <1487177757-19427-1-git-send-email-fabrice.gasnier@st.com> <1487177757-19427-2-git-send-email-fabrice.gasnier@st.com> <79e01c5c-d27c-89ea-4d8f-9e66a6c091e6@st.com> Cc: linux-iio@vger.kernel.org, mark.rutland@arm.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, knaack.h@gmx.de, pmeerw@pmeerw.net From: Lars-Peter Clausen X-Enigmail-Draft-Status: N1110 Message-ID: Date: Tue, 28 Feb 2017 09:34:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 MIME-Version: 1.0 In-Reply-To: <79e01c5c-d27c-89ea-4d8f-9e66a6c091e6@st.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Authenticated-Sender: lars@metafoo.de Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/28/2017 09:21 AM, Fabrice Gasnier wrote: > On 02/25/2017 04:11 PM, Jonathan Cameron wrote: >> On 24/02/17 16:04, Fabrice Gasnier wrote: >>> On 02/19/2017 01:09 PM, Jonathan Cameron wrote: >>>> On 15/02/17 16:55, Fabrice Gasnier wrote: >>>>> Add documentation for 'st,adc-res' dt optional property. >>>>> >>>>> Signed-off-by: Fabrice Gasnier >>>> I'm happy with this, but would like to leave time for a device tree review. >>>> >>>> Ultimately we may well want to make this a generic property and call it >>>> something >>>> like adc-resolution but perhaps we need to wait until we have a few more >>>> devices >>>> supporting setting it via device tree to figure out what the best >>>> interface is. >>>> It would exactly be a problem to support this as a deprecated binding at >>>> that >>>> point. >>> >>> Hi Jonathan, >>> >>> I agree with you on this... It may be better to have generic property >>> for this, especially if you see that it will come in the near future. >>> May I suggest this prop to be less restrictive, e.g. like >>> resolution-bits as is may also be worth for other device types, e.g. >>> DAC as an example ?> >> Sure, why not - no loss of meaning here. We may never use it for anything >> else but that doesn't matter. > > Hi Jonathan, > > Following Rob's comment, how you see such a common property can be > integrated. Currently I don't see much devices are doing this. > Do you have ideas or preferences on this ? > > - Do you think replacing 'st,adc-res' by 'resolution-bits' in current > patchset is enough for now ? That name would be a bit confusing. Considering that the devicetree describes th capabilities of the hardware this name would suggest that this is the resolution supported by the device. If we want to allow selecting runtime configuration parameters for IIO devices from the devicetree we should probably follow the precedence set by the clock framework and use properties with the 'assigned-' prefix. But to be honest I'm not convinced yet that the whole approach of allowing runtime configuration parameters to be configured via the devicetree is the right approach. Converters and sensors often have a lot of runtime configurable parameters, typically we expose them to the application layer to allow maximum flexibility. Why is the resolution special in this case and should be pre-configured via the devicetree instead? - Lars