Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp406303rdb; Thu, 30 Nov 2023 07:53:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXwX2M+ijbq2NdM+XI+fLD3u0e6d011pd3ksyyE0nAun223t1uFMpDk9XEZ3QlYHeeTYYf X-Received: by 2002:a92:c532:0:b0:35d:32f3:9399 with SMTP id m18-20020a92c532000000b0035d32f39399mr5700077ili.16.1701359631095; Thu, 30 Nov 2023 07:53:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701359631; cv=none; d=google.com; s=arc-20160816; b=zumo1JF3mwXO5V5dPvQpK+kWODPQLPSUpZ63D88ItxA4SSSc0jY7fc5gmeZgQoj4n7 hHucUkhFZaVrFX5CtzyU94uutbK74mMClQMUM2D82O9Yc9xgkydKDIJs+Cha/832BGLT pzjwpkakTuyGOiYRqLRnW5q6zAzAhLzNcTSL6MAJx4kZp/lvHDs2AxaU8BqMkOZspP9t eMjmcWRHT/jsj4/gJMPATnogF84XN0EB9Q8ApopyA4R4c5SHCzITZkXq35H7w3q3aJOS xYrpFZwYoHD9vqI2YaN6w1IwyxiwX/YfwJid92REkXjYeFdOJlTSu69YS8yIRYg+o7cM nhMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7iExOhEgEGWzYC6c0vCXqmw6+K6dRRJj/BjS3mSKy+8=; fh=USfJF574jX6jDge/FE6YUQkAlTdZF4Mhu1OhMowgKoQ=; b=xB2B5AtUe+neOgxN1Hw4DT0CL+/WHcY93FwSls2MPUU0blewOQVqNLzSkmddyG9wN7 wf2Jk8udffnRE6kCOwJM1FNBLQnxkGrB3h6FGh0e5zSSwdJMTr6RtkKiW67hnAZHQs3K PcxeP528We7zlxU48LxZZRZQBPTDw0T0gopi1WYaV+Q8dUBzDhwXI8Q2FuHVvtfLvOXT A8C4tUjWQnv8l3FN2pXTsxGMs87q8z/VRx9DBKmLVH1Y3whUfLEcI4/vzBoehvxUmCVQ AmpOlqdAAPvaIO+X6KFF3ajdwYKRzRM3i3nC+DgjEsVDQZA8QWs0PC7f6O6ZkekOVeGp giyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KWTJmj6g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id r6-20020a632b06000000b005bdfbd664b8si1528678pgr.202.2023.11.30.07.53.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 07:53:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KWTJmj6g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id B377580CF527; Thu, 30 Nov 2023 07:53:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346413AbjK3Px3 (ORCPT + 99 others); Thu, 30 Nov 2023 10:53:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235209AbjK3Px2 (ORCPT ); Thu, 30 Nov 2023 10:53:28 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DE7910D1 for ; Thu, 30 Nov 2023 07:53:33 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FE8DC433C8; Thu, 30 Nov 2023 15:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701359612; bh=HrIeUu7V7smPbz53czTMhVOKIhnJX6FObsHMqEgNuww=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KWTJmj6guoUZxaxt6RIJl4h1DsBIWv/7g3q4qKBMb15RXr7Fs2wvfEKnOK6rG16nX 45OdwoH02duq0uGWs4bJbWEbkn8b8uzmW2JBSlzD6PR7V0Aa0o4BcJfbzkNI78j/FT cdfn/nZ2ARojwYf1WZp4ntPp3BEbjki/RMmFrqLL4em0VcmrE5P+5nvoFZpJr96uay oVrbrQ5PqGT8qFz1JX+VGFNsgks2ojGh9/pZC+cnKGaostTf9zZS5xpMK33ptqx4Vr 8Ky45g5pqU2uS6pd5Zjx7EZbgwXCQhdNxJs/77t8TVniEHmU2Bfk0J4hlErV5Ap1sg SugTdBq1JUJ4g== Date: Thu, 30 Nov 2023 15:53:27 +0000 From: Conor Dooley To: Jonathan Cameron Cc: Krzysztof Kozlowski , marius.cristea@microchip.com, lars@metafoo.de, robh+dt@kernel.org, jdelvare@suse.com, linux@roeck-us.net, linux-hwmon@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] dt-bindings: iio: adc: adding support for PAC193X Message-ID: <20231130-obedient-pointer-6b4470a85c63@spud> References: <20231115134453.6656-1-marius.cristea@microchip.com> <20231115134453.6656-2-marius.cristea@microchip.com> <20231116-channel-variety-cc7c262924ad@squawk> <20231125194754.304523e6@jic23-huawei> <20231126-nineteen-clumsy-701ac4145ba8@spud> <20231126160438.01ff57d7@jic23-huawei> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oP7sV86AVSwt1W+s" Content-Disposition: inline In-Reply-To: <20231126160438.01ff57d7@jic23-huawei> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 30 Nov 2023 07:53:48 -0800 (PST) --oP7sV86AVSwt1W+s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 26, 2023 at 04:04:38PM +0000, Jonathan Cameron wrote: > On Sun, 26 Nov 2023 11:24:56 +0000 > Conor Dooley wrote: > > On Sat, Nov 25, 2023 at 07:47:54PM +0000, Jonathan Cameron wrote: > > > On Thu, 16 Nov 2023 18:21:33 +0000 > > > Conor Dooley wrote: =20 > > > > On Thu, Nov 16, 2023 at 04:01:43PM +0100, Krzysztof Kozlowski wrote= : =20 > > > > > On 15/11/2023 14:44, marius.cristea@microchip.com wrote: =20 > > > > > > From: Marius Cristea =20 > > > > > > +patternProperties: > > > > > > + "^channel@[1-4]+$": > > > > > > + type: object > > > > > > + $ref: adc.yaml > > > > > > + description: Represents the external channels which are co= nnected to the ADC. > > > > > > + > > > > > > + properties: > > > > > > + reg: > > > > > > + items: > > > > > > + minimum: 1 > > > > > > + maximum: 4 > > > > > > + > > > > > > + shunt-resistor-micro-ohms: > > > > > > + description: | > > > > > > + Value in micro Ohms of the shunt resistor connected = between > > > > > > + the SENSE+ and SENSE- inputs, across which the curre= nt is measured. Value > > > > > > + is needed to compute the scaling of the measured cur= rent. > > > > > > + > > > > > > + required: > > > > > > + - reg > > > > > > + - shunt-resistor-micro-ohms > > > > > > + > > > > > > + unevaluatedProperties: false > > > > > > + > > > > > > +required: > > > > > > + - compatible > > > > > > + - reg > > > > > > + - "#address-cells" > > > > > > + - "#size-cells" > > > > > > + > > > > > > +allOf: > > > > > > + - if: > > > > > > + properties: > > > > > > + compatible: > > > > > > + contains: > > > > > > + const: interrupts =20 > > > > >=20 > > > > >=20 > > > > > I don't understand what do you want to say here. I am also 100% s= ure you > > > > > did not test it on a real case (maybe example passes but nothing = more). =20 > > > >=20 > > > > As far as I understand, the same pin on the device is used for both= an > > > > output or an input depending on the configuration. As an input, it = is > > > > the "slow-io" control, and as an output it is an interrupt. > > > > I think Marius is trying to convey that either this pin can be in > > > > exclusively one state or another. > > > >=20 > > > > _However_ I am not sure that that is really the right thing to do -= they > > > > might well be mutually exclusive modes, but I think the decision ca= n be > > > > made at runtime, rather than at devicetree creation time. Say for > > > > example the GPIO controller this is connected to is capable of acti= ng as > > > > an interrupt controller. Unless I am misunderstanding the runtime > > > > configurability of this hardware, I think it is possible to actually > > > > provide a "slow-io-gpios" and an interrupt property & let the opera= ting > > > > system decide at runtime which mode it wants to work in. =20 > > >=20 > > > I'll admit I've long forgotten what was going on here, but based just= on > > > this bit of text I agree. There is nothing 'stopping' us having a pin > > > uses as either / or / both interrupt and gpio. > > >=20 > > > It'll be a bit messy to support in the driver as IIRC there are some = sanity > > > checks that limit combinations on IRQs and output GPIOS. Can't remem= ber > > > how bad the dance to navigate it safely is. > > >=20 > > > First version I'd just say pick one option if both are provided and > > > don't support configuring it at runtime. =20 > >=20 > > Just to be clear, you are suggesting having the > > "microchip,slow-io-gpios" and "interrupts" properties in the binding, > > but the driver will just (for example) put that pin into alert mode > > always & leave it there? >=20 > Yes. >=20 > > If that is what you are suggesting, that seems pragmatic to me. >=20 > If a use case to do something else comes along later, then we can > be smarter, but I'd like to keep it simple initially at least. Sounds good to me, thanks Jonathan. Seems like a good compromise of depicting the hardware accurately and not overcomplicating the driver implementation. Marius, I completely forgot to get in touch with you about this - give me a shout on teams if there's anything outstanding that I can help you with. --oP7sV86AVSwt1W+s Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZWiv9wAKCRB4tDGHoIJi 0uHzAPwLRSFe3lyznjBdX2nugpHz1wH9XkPMsIfMCDZMgNeUhQD/QIvnrIRYkwXk T9Reuc+W3+2ww8eTAHVikTkLYDMDvQ8= =fi+Q -----END PGP SIGNATURE----- --oP7sV86AVSwt1W+s--