Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp325385ybg; Sun, 26 Jul 2020 05:52:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzes1TDpGaTGqCmKP6Z4RTvKJzKiPw3SVNK3UpzmaIRD3cnek0NUsjVgpvzyRy2gPhJjb0P X-Received: by 2002:a50:ee8d:: with SMTP id f13mr16501944edr.302.1595767946426; Sun, 26 Jul 2020 05:52:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595767946; cv=none; d=google.com; s=arc-20160816; b=Juzj9F+3wIZJSrs95TBlYrzhwI1uKEqD4UZoAm7EAvMB5nRnT0fc4wYAgIED8BAZSa ytXFx1GhQrUQWCmmT7bTtsney5uBgsNqlGou79lom3+97uAMdt3OAF5ZMVC6LhxB3Fio PkHcfFqRZ13+CSlxw2TxuMGeuV4ULVMUleKb/kjTdPq/nq2Alynln/rOSCuhBRau57oU UkUlE1FPwSn9lCETsJkZJYKzwan9sWuRsDLBTGESfzEgCrQeXnFEDXe/rDS/NNZ+88Y4 A8DlVd9OXbL1Tpa3Z3ixKGuMggLFHyICH26uQA1+2sfXhouZ2UOF0A8o12hHsTmqu2a0 Vv6g== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=AH19ZgxB9sKTyLHTofui8J5R2TjLWJMTfK4c1HnuKHA=; b=E2bre7M8U4mr3YyrgDh9ZrGDOz78G1oeQzfpV/wVRObfh73D2E/UJdp9Cy72dU9tgS xJ4nuUUmrvUx/siUnN1SNi6EgZJLTVRPJbXPrJqfdm28MCsF2PYTfbJPH9h0PHbjP6rl Q/UqJNAGzQ0PcTk8MSprA6iqMgNYFiS2pzSEmSEuJzrLcXWdZzyD527POMmkkZEDVQ7R GUcd6w3Q7BXvWhJ1KawdFvrI+uBsdjXDJQN+9nf72Wf9FkIkgfIPKwyZFkOtGT7akMcT yIAZviUsh+1XwK2efsj5sMxqJR/2t3QmDA+MWX/3VC3XuG4mRTd+zTZcDw1fnwJyuUHg Vd6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=00B5D0t9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds15si5118247ejc.463.2020.07.26.05.52.04; Sun, 26 Jul 2020 05:52:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=00B5D0t9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726719AbgGZMvE (ORCPT + 99 others); Sun, 26 Jul 2020 08:51:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:45576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbgGZMvD (ORCPT ); Sun, 26 Jul 2020 08:51:03 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 24A3B2065E; Sun, 26 Jul 2020 12:51:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595767863; bh=Tiy4JSgM4TpbyNf0slTi9UaPjGZNDHxnwqMnKUaMZss=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=00B5D0t9pMPSfc7RlCO3d7GBDmTYzO4D1+hR4pZMlhJN1b48jvUBYH+1JI7IEbha9 2tS10Kts27OogQs4aILr2uCngJHdoMsvzgIW6VIMAjUaehP368PzVc164hGUVqi5RN Uj7uV7SJXnfV7XxAXcQaHBzy6IjbWnciooR5prb0= Date: Sun, 26 Jul 2020 13:50:59 +0100 From: Jonathan Cameron To: "Pop, Cristian" Cc: Lars-Peter Clausen , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH] one-bit-adc-dac: Add initial version of one bit ADC, DAC Message-ID: <20200726135059.1234aa71@archlinux> In-Reply-To: References: <20200716072737.9535-1-cristian.pop@analog.com> <9bd0363c-e8fb-a36f-a107-0afd8f7851d0@metafoo.de> <20200720145225.4f5d552b@archlinux> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org .. > > > > > > + if (ret < 0) > > > > + return ret; > > > > + > > > > + for (i = 0; i < num_ch; i++) { > > > > + channels[i] = (struct > > iio_chan_spec)ONE_BIT_ADC_DAC_CHANNEL(i + > > > > + offset, > > > > + direction); > > > > + channels[i].extend_name = gpio_names[i]; > > > I think we want to avoid using extend_name in new drivers because it > > > makes for a very clumsy ABI. We should add a label property like we > > > have for the device for channels to have a symbolic name of the channel. > The current dts looks like this: > one-bit-adc-dac@0 { > in-gpios = <&gpio 17 0>, <&gpio 27 0>; > in-gpio-names = "i_17", "i_27"; > out-gpios = <&gpio 23 0>, <&gpio 24 0>; > out-gpio-names = "o_23", "o_24"; > }; > Resulting in channels: > in_voltage0_i_17_raw > in_voltage1_i_27_raw > out_voltage2_o_23_raw > out_voltage3_o_24_raw > If we want to lose extend_name, please provide an example for using labels. > How the dts should look like, how do I use it in the driver? Doesn't exist yet :) Proposal was to add support for a label attribute to the iio core. If we were going to do a generic binding it would have to be part of the existing channel bindings. e.g. Documentation/devicetree/bindings/iio/adc/adc.txt But here it might be fine to use the gpio-names to fill one in. Alternative would be to use a binding where the gpio was specified as part of the per channel child nodes rather than as a single entry.