From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CBEBC47247 for ; Tue, 5 May 2020 15:13:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 09E782078D for ; Tue, 5 May 2020 15:13:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ni619Ifu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09E782078D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=the-dreams.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OLA85caNk63TXHuSmWqqIWvCF4EbL4WuRgetwD5WMj0=; b=Ni619IfuegE43KHhe8EGSNyFN OghTI8r9sJPsKpMKR36vlGCuQlUSItvQ8GCSusHJVdGbfSZE8qCt4arrHRc7ofzctOR/uzGalyXDE 1JR8oJquWSDgTuHkZBxgWY6QCAYYuRLYE7RDbau6MG8hpMuharr8nZlfIJ9lkYvlg5LwId+RlUzN9 vMJGt3cGy5ymB5SuETiZXlTFpKGU9GBK2bEs0NhC9AB8jS3Uh5ndPhBxI/IE1rTBvZuusDLuSRso4 SQkZz8ED0w9Q+K4DfxxhxhD/78GANwzzP6dn4b0WfpKSTTIEwPaD1ZUdugGKRRIGXCmV/DSGketwr S+N7FgwqA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jVzFk-0004we-Ob; Tue, 05 May 2020 15:13:00 +0000 Received: from sauhun.de ([88.99.104.3] helo=pokefinder.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jVzFh-0004wM-9h for linux-arm-kernel@lists.infradead.org; Tue, 05 May 2020 15:12:58 +0000 Received: from localhost (p54B335A1.dip0.t-ipconnect.de [84.179.53.161]) by pokefinder.org (Postfix) with ESMTPSA id 7F2872C0892; Tue, 5 May 2020 17:12:56 +0200 (CEST) Date: Tue, 5 May 2020 17:12:56 +0200 From: Wolfram Sang To: Codrin Ciubotariu Subject: Re: [RFC PATCH] i2c: at91: Fix pinmux after devm_gpiod_get() for bus recovery Message-ID: <20200505151256.GF2468@ninjato> References: <20200415070643.23663-1-codrin.ciubotariu@microchip.com> MIME-Version: 1.0 In-Reply-To: <20200415070643.23663-1-codrin.ciubotariu@microchip.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200505_081257_486135_4ACBFD0B X-CRM114-Status: UNSURE ( 8.72 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alan@softiron.com, kamel.bouhara@bootlin.com, alexandre.belloni@bootlin.com, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, ludovic.desroches@microchip.com, linux-i2c@vger.kernel.org, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============0569657075585125825==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============0569657075585125825== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="twz1s1Hj1O0rHoT0" Content-Disposition: inline --twz1s1Hj1O0rHoT0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 15, 2020 at 10:06:43AM +0300, Codrin Ciubotariu wrote: > devm_gpiod_get() usually calls gpio_request_enable() for non-strict pinmux > drivers. These puts the pins in GPIO mode, whithout notifying the pinctrl > driver. At this point, the I2C bus no longer owns the pins. To mux the > pins back to the I2C bus, we use the pinctrl driver to change the state > of the pins to GPIO, before using devm_gpiod_get(). After the pins are > received as GPIOs, we switch theer pinctrl state back to the default > one, >=20 > Fixes: d3d3fdcc4c90 ("i2c: at91: implement i2c bus recovery") > Signed-off-by: Codrin Ciubotariu Applied to for-current, thanks! This will do for 5.7. For 5.8 or 5.9, I can imagine to take the two pinctrl_state pointers into bus_recovery_info and handle all this in the core. I will try this later this week if noone is super-eager to try it out before. --twz1s1Hj1O0rHoT0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl6xgnQACgkQFA3kzBSg KbbY+xAArfL/iEHhieAsZoajJ8HCWqBjKMu523a4uPpmSCk4jP9UIqOQqtUac4tK wUCJg3LXJvbT8pfvfxAcSTHYjgVIvh0br6N44vO5zWz6uTlyEH0LXrg8NP9qrECb B5HHfsFxVWhTMuFTgcqRHel1qHzhd3rWCebhfdiFrBcHpM6xmeB9VlYyXoq4/qx5 p3/5LwgKJW4xo4AT2J3PCfX5h/zVdIzeWW9qPX+xyUtCJ0MpCxsVxStpUXwudIH2 rJahIU7t0NL0MtKLa4Waf8PjQULKShZc1vrQ/QQhi50kLicGkPwQSJnkFe+lLnjS aMGEKiJajucG8tz1nqsg8A2CsXpUC70f7bwQP7kGlUVPqEPp13soeor9qoKIClfX LleANdq18XOlIIRKGtcLKvg/abHXk1/OQ9efNx8Aa4G30im3rozCwbR+Fpn+mLZC oANKeX7VJ+DmuYqiWaD23Iz/j3M2skgBmUeuzAMYvA+OX6lERmWWnBqEMAqb0si2 nngZTQcBg1s8HEbeDMkH7N9zu47bEdXAARoFE9ys16uZK3A7RRNnv46NSjZAph1b uepFxAB8QGm9a+sLjLY4Ym/G6vBAv9CRh5FCLDxZ1ODzYZfEiPtt3umtz7DFfGKp /9wolNpCGqYXQHYwgmakJq5f9MEASvhl4GNag81Qi1AHgRJeDqs= =kQ/H -----END PGP SIGNATURE----- --twz1s1Hj1O0rHoT0-- --===============0569657075585125825== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============0569657075585125825==--