From patchwork Fri Sep 5 12:14:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 4851771 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BF2149F314 for ; Fri, 5 Sep 2014 12:17:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 85A9820251 for ; Fri, 5 Sep 2014 12:17:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B77A82021A for ; Fri, 5 Sep 2014 12:17:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932172AbaIEMQr (ORCPT ); Fri, 5 Sep 2014 08:16:47 -0400 Received: from ns.mm-sol.com ([37.157.136.199]:56820 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932076AbaIEMQq (ORCPT ); Fri, 5 Sep 2014 08:16:46 -0400 Received: from localhost.localdomain (unknown [37.157.136.206]) by extserv.mm-sol.com (Postfix) with ESMTPSA id 768DD4F883; Fri, 5 Sep 2014 15:16:44 +0300 (EEST) From: Stanimir Varbanov To: Ian Campbell , Pawel Moll , Rob Herring , Kumar Gala , Mark Rutland , Grant Likely , Jonathan Cameron Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Greg Kroah-Hartman , Lars-Peter Clausen , Hartmut Knaack , Angelo Compagnucci , Doug Anderson , Fugang Duan , Johannes Thumshirn , Jean Delvare , Philippe Reynes , Lee Jones , Josh Cartwright , Stephen Boyd , David Collins , Stanimir Varbanov , "Ivan T. Ivanov" Subject: [PATCH 2/2] DT: iio: vadc: document dt binding Date: Fri, 5 Sep 2014 15:14:34 +0300 Message-Id: <1409919274-13419-3-git-send-email-svarbanov@mm-sol.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1409919274-13419-1-git-send-email-svarbanov@mm-sol.com> References: <1409919274-13419-1-git-send-email-svarbanov@mm-sol.com> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Document DT binding for Qualcomm SPMI PMIC voltage ADC driver. Signed-off-by: Stanimir Varbanov Signed-off-by: Ivan T. Ivanov --- .../devicetree/bindings/iio/adc/qcom,spmi-vadc.txt | 110 ++++++++++++++++++++ 1 files changed, 110 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.txt diff --git a/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.txt b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.txt new file mode 100644 index 0000000..f9c780f --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.txt @@ -0,0 +1,110 @@ +Qualcomm's SPMI PMIC voltage ADC + +SPMI PMIC voltage ADC (VADC) provides interface to clients to read +voltage. A 15 bit ADC is used for voltage measurements. There are multiple +peripherals to the VADC and the scope of the driver is to provide interface +for the USR peripheral of the VADC. + +VADC node: + +- compatible: + Usage: required + Value type: + Definition: Should contain "qcom,spmi-vadc". + +- reg: + Usage: required + Value type: + Definition: Base address in the SPMI PMIC register map. + +- interrupts: + Usage: required + Value type: + Definition: End of convertion interrupt number. + +- qcom,poll-eoc: + Usage: optional + Value type: + Definition: Use polling instead of interrupt for end of conversion + completion. + +Channel node properities: + +- qcom,channel: + Usage: required + Value type: + Definition: AMUX channel number. + +- qcom,decimation: + Usage: optional + Value type: + Definition: Sampling rate to use for the individual channel measurement. + Quicker measurements can be made by reducing decimation ratio. + Valid values are 512, 1024, 2048, 4096. + If property is not found, default value of 512 will be used. + +- qcom,pre-scaling: + Usage: optional + Value type: + Definition: Used for scaling the channel input signal before the signal is + fed to VADC. The configuration for this node is to know the + pre-determined ratio and use it for post scaling. Select one from + the following options. + <1 1>, <1 3>, <1 4>, <1 6>, <1 20>, <1 8>, <10 81>, <1 10> + If property is not found default value depending of chip will be used. + +- qcom,ratiometric: + Usage: optional + Value type: + Definition: Channel calibration type. If this property is specified + VADC will use the VDD reference(1.8V) and GND for channel + calibration. If properity is not found, channel will be + calibrated with 625mv and 1.25V reference channels. + +- qcom,hw-settle-time: + Usage: optional + Value type: + Definition: Time between AMUX getting configured and the ADC starting + conversion. Delay = 100us * (value) for value < 11, and + 2ms * (value - 10) otherwise. + Valid values are: 0, 100, 200, 300, 400, 500, 600, 700, 800, + 900 us and 1, 2, 4, 6, 8, 10 ms + If property is not found, channel will use 0us. + +- qcom,avg-samples: + Usage: optional + Value type: + Definition: Number of samples to be used for measurement. + Fast averaging provides the option to obtain a single measurement + from the ADC that is an average of multiple samples. The value + selected is 2^(value). + Valid values are: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512 + If property is not found, 1 sample will be used. + +- label: + Usage: optional + Value type: + Definition: Channel name used for sysfs entry. If not provided + configuration device node name will be used. + +NOTE: At least one channel node is required. + +Example: + /* VADC node */ + vadc@3100 { + compatible = "qcom,spmi-vadc"; + reg = <0x3100>; + interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>; + #io-channel-cells = <1>; + io-channel-ranges; + + /* Channel node */ + usb_id_nopull@39 { + qcom,channel = ; + qcom,decimation = <512>; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,avg-samples = <1>; + qcom,pre-scaling = <1 3> + }; + };