Received: by 10.223.164.221 with SMTP id h29csp2118464wrb; Mon, 23 Oct 2017 01:09:25 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QTuca5W9duf+RHvGbmkTNJsVMY0WVuhmeCxZvQXISDT9Rv7hgB+BVdtkPGBx3+YI+I2PDr X-Received: by 10.84.248.142 with SMTP id q14mr9675138pll.307.1508746165058; Mon, 23 Oct 2017 01:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508746165; cv=none; d=google.com; s=arc-20160816; b=gDbeaDyOpSKohAOl4rQejsXiN9aBl9H1M++/mNvW9VL2FPKgBKd783X+AajIQ9S3YP JDKm/dova437N5muwTFnXHCz3hbdZrdwUVAZRcNGEvk5RaiKJ8edCzZIj5W9Tu268iVO CZpzWHdeIq2WDfieqapzBt3M4CwW/M45N2D7ufDaJrpE3x0BpURoZiEgJpwxyXnhbxkr AWfwd4FC1EubQD/nVrUV5i/80mw6a5J3szgokkQ+uVsSMr6Egvhfn/41PdXidipwWHRO aBe9AGDb0lSWO9rxDCwG8xcHT12719cw64Vib1pKn49MMC3JgqDZ3mfm80YNI0N40Wah R8IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=128T2FR3dsBACXZD2OxUrN9Ehz6dxoY5K9RyvdIO5DU=; b=CPRaniOwlLm7qtvIXyD7ucfqKkOtkQt5og5eL+qzSxpCPvcNum/Fine0KlOQIueDQr mYMjFyG6o/ZQiuiaWF/FhgdxPXUag378iQWWq6ej0iLtsDcJapvVq2torUTKNgCyQtKS T7MhQ1AwEFDu1Y0lkdq5GWXUxbKnrYuvVBcWb7bmsML2r2HG+8FsdhQxn3HQwXxzqHJ9 2sQ9AbZiT9eMgj23ZkFMYKTpeEQwDXIQhOzvYUusaGJFtTKqnQtOhOLF4QEWf1V9HqVY GsiQSU0BFIm/LdXDFs9cui89laYi8i8vE2VlBNz6Yb+AnNY94pXHCRvT5TzQcAj87MuZ YB6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o13si3741703pli.628.2017.10.23.01.09.11; Mon, 23 Oct 2017 01:09:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751363AbdJWIHg (ORCPT + 99 others); Mon, 23 Oct 2017 04:07:36 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:44039 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751178AbdJWIHd (ORCPT ); Mon, 23 Oct 2017 04:07:33 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9N83b0f009249; Mon, 23 Oct 2017 10:06:32 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2dqupv06hd-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 23 Oct 2017 10:06:32 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 142B931; Mon, 23 Oct 2017 08:06:29 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node3.st.com [10.75.127.15]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B449F13AE; Mon, 23 Oct 2017 08:06:29 +0000 (GMT) Received: from [10.48.0.167] (10.75.127.45) by SFHDAG5NODE3.st.com (10.75.127.15) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 23 Oct 2017 10:06:28 +0200 Subject: Re: [PATCH 1/3] dt-bindings: iio: adc: stm32: add support for diff channels To: Jonathan Cameron CC: , , , , , , , , , , , , , References: <1508246145-19417-1-git-send-email-fabrice.gasnier@st.com> <1508246145-19417-2-git-send-email-fabrice.gasnier@st.com> <20171021185401.529f2eb2@archlinux> <20171021202327.51dd2855@archlinux> From: Fabrice Gasnier Message-ID: <0726f676-0440-afbe-f275-ec7fdaa29c9f@st.com> Date: Mon, 23 Oct 2017 10:06:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171021202327.51dd2855@archlinux> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.45] X-ClientProxiedBy: SFHDAG4NODE2.st.com (10.75.127.11) To SFHDAG5NODE3.st.com (10.75.127.15) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-23_02:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/21/2017 09:23 PM, Jonathan Cameron wrote: > On Sat, 21 Oct 2017 18:54:01 +0100 > Jonathan Cameron wrote: > >> On Tue, 17 Oct 2017 15:15:43 +0200 >> Fabrice Gasnier wrote: >> >>> STM32H7 ADC channels may be configured either as single-ended or >>> differential. >>> Add 'st,adc-diff-channels' property to support differential channels. >>> Differential channels are defined as a pair of positive and negative >>> inputs: vinp & vinn. >>> >>> Signed-off-by: Fabrice Gasnier >> Hmm. Fair enough. Sometimes we support both types of channels >> and leave it to userspace, but in many cases that makes little sense >> - particularly if like I think is going on here, we aren't combining channels >> that can be separately read but rather the negative pin is simply unused >> when we are in single channel mode... (did I understand that right?) > I clearly didn't understand. This is same as other devices > in that we are picking a pair from the channels that can otherwise be > used as single end channels. (I think). Hi Jonathan, Indeed, we're picking a pair from the channels that can be used as single channels otherwise. Also, it doesn't makes sense to leave the choice to userspace: when these channels are used in differential mode, both input should be biased. This is quite dependent on hardware (board), not really a runtime choice. Hope this clarifies ? > > For this binding I think I'd like to see an example added showing how > this works... You're right, I should have added that. Please let me know if I can add bellow example in v2: Example to setup differential channels 1, 2 & 3 (with resp. 0, 6 & 7 negative inputs): adc: adc@40022000 { compatible = "st,stm32h7-adc-core"; ... adc1: adc@0 { compatible = "st,stm32h7-adc"; ... st,adc-diff-channels = <1 0>, <2 6>, <3 7>; }; }; Thanks for reviewing, Best Regards, Fabrice > > Thanks, > > Jonathan >> >> Jonathan >> >>> --- >>> Documentation/devicetree/bindings/iio/adc/st,stm32-adc.txt | 6 ++++++ >>> 1 file changed, 6 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.txt b/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.txt >>> index 48bfcaa3..c3c8de1 100644 >>> --- a/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.txt >>> +++ b/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.txt >>> @@ -62,6 +62,12 @@ Required properties: >>> - st,adc-channels: List of single-ended channels muxed for this ADC. >>> It can have up to 16 channels on stm32f4 or 20 channels on stm32h7, numbered >>> from 0 to 15 or 19 (resp. for in0..in15 or in0..in19). >>> +- st,adc-diff-channels: List of differential channels muxed for this ADC. >>> + Depending on part used, some channels can be configured as differential >>> + instead of single-ended (e.g. stm32h7). List here positive and negative >>> + inputs pairs as , ,... vinp and vinn are numbered >>> + from 0 to 19 on stm32h7) >>> + Note: At least one of "st,adc-channels" or "st,adc-diff-channels" is required. >>> - #io-channel-cells = <1>: See the IIO bindings section "IIO consumers" in >>> Documentation/devicetree/bindings/iio/iio-bindings.txt >>> >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-iio" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html > From 1581896310525230725@xxx Sat Oct 21 19:24:42 +0000 2017 X-GM-THRID: 1581553715797412419 X-Gmail-Labels: Inbox,Category Forums