From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stanimir Varbanov Subject: Re: [PATCH V3 2/2] iio: adc: spmi-vadc: Changes to support different scaling Date: Mon, 31 Oct 2016 11:26:53 +0200 Message-ID: <7c0baa96-51a1-06fb-7a90-1bfb3338a294@linaro.org> References: <1477492887-1663-1-git-send-email-rphani@codeaurora.org> <1477492887-1663-3-git-send-email-rphani@codeaurora.org> <8418e7f1-55d9-2dfa-1dc7-5960f9da0305@linaro.org> <812bb533-0f19-7abc-1fa1-9e83f1db10f4@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wm0-f49.google.com ([74.125.82.49]:37257 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763701AbcJaJ05 (ORCPT ); Mon, 31 Oct 2016 05:26:57 -0400 Received: by mail-wm0-f49.google.com with SMTP id t79so37886458wmt.0 for ; Mon, 31 Oct 2016 02:26:57 -0700 (PDT) In-Reply-To: <812bb533-0f19-7abc-1fa1-9e83f1db10f4@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Rama Krishna Phani A , Jonathan Cameron , linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: robh@kernel.org, linux-arm-msm@vger.kernel.org, smohanad@codeaurora.org, mgautam@codeaurora.org, sivaa@codeaurora.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, Julia.Lawall@lip6.fr Hi Rama, On 10/31/2016 09:12 AM, Rama Krishna Phani A wrote: > Hi Jonathan, > > On 30-Oct-16 10:43 PM, Jonathan Cameron wrote: >> On 27/10/16 18:37, Phani A, Rama Krishna wrote: >>> Hi Stan, >>> >>> On 27-Oct-16 4:48 PM, Stanimir Varbanov wrote: >>>> Hi Rama, >>>> >>>> On 10/26/2016 05:41 PM, Rama Krishna Phani A wrote: >>>>> Polling can also be used for End of conversion completion. >>>>> Implement logic >>>>> to choose either polling or interrupt for End of conversion >>>>> completion. >>>>> Scaling can be done on the voltage to report adc code in physical >>>>> units. >>>>> Add changes to support different scale functions to convert adc >>>>> code to >>>>> physical units. >>>>> >>>>> Signed-off-by: Rama Krishna Phani A >>>>> --- >>>>> .../devicetree/bindings/iio/adc/qcom,spmi-vadc.txt | 14 ++ >>>>> drivers/iio/adc/qcom-spmi-vadc.c | 263 >>>>> +++++++++++++++++---- >>>>> 2 files changed, 236 insertions(+), 41 deletions(-) >>>>> >>>>> diff --git >>>>> a/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.txt >>>>> b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.txt >>>>> index 0fb4613..39e31c0e 100644 >>>>> --- a/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.txt >>>>> +++ b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.txt >>>>> @@ -37,6 +37,12 @@ VADC node: >>>>> Value type: >>>>> Definition: End of conversion interrupt. >>>>> >>>>> +- qcom,vadc-poll-eoc: >>>>> + Usage: optional >>>>> + Value type: >>>>> + Definition: Use polling instead of interrupts for End of >>>>> Conversion >>>>> + completion. >>>> >>>> Why you need to add such a flag in DT? >>>> >>>> The DT should describe hardware details not how the driver will choose >>>> pooling vs interrupt. >>>> >>>> On which use-case you would prefer pooling? >>>> >>> >>> Few PMIC's support interrupt functionality for ADC where as few >>> PMIC's dont support. Based on the functionality that is supported in >>> hardware we choose whether to go for polling or for interrupt. >> Can't use the usual trick of an optional interrupt in DT? >> If it's there we try to use it, if not then fall back to polling? >> > Ok., Will check this logic for implementation and will post next patch. The interrupts DT property in binding doc is marked as optional already, so I can't really understand what you are trying to achieve with this new qcom,vadc-poll-eoc boolean property? -- regards, Stan