Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933151AbdGJRcc (ORCPT ); Mon, 10 Jul 2017 13:32:32 -0400 Received: from mout.web.de ([212.227.15.3]:55398 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932257AbdGJRcW (ORCPT ); Mon, 10 Jul 2017 13:32:22 -0400 Subject: Re: [PATCH] spi: pxa2xx: Only claim CS GPIOs when the slave device is created To: Mark Brown , Andy Shevchenko Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , linux-spi , Linux Kernel Mailing List , linux-arm-kernel References: <90b3e14d-0077-9a25-9d90-ab340577af57@web.de> <20170710120913.g35ftcbs7pngrtsm@sirena.org.uk> From: Jan Kiszka Message-ID: Date: Mon, 10 Jul 2017 19:31:24 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <20170710120913.g35ftcbs7pngrtsm@sirena.org.uk> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CwuGboeE3PACFF32XlGmIQ8KNID3HT9hA" X-Provags-ID: V03:K0:D++u7jQKk9LxN1i6VnSTdk/FrdU5HYVabKqqISozQSuJQo2fMdm DtrKhgxesg6HZSlNkymdYXDPWsfTuihmNpCtL8ohME2e+693c2kPLAkyXEPqfwphOHo6PMC kAwlwBbc1dEZxkanWogLOIdNTwUYiowMHt+9Pj8I4070C14R2XiprPymW7knWW26PN9idyw oMf2ihf2QXM7TqjaH5l8g== X-UI-Out-Filterresults: notjunk:1;V01:K0:dDZ9cTIkOb0=:2dFukBWk8UUsXxKiS+KlCD y5SbA4IfYejKOobSt9ItuLs3j7i3mjiquEHZ2oM5+RoiSGFjwAByzjZP6P4ceHEU/pIwcRsA6 BBWqQlAads1tj8eEmhvBkTpk0fSABGFqBYUsHU15BYDnm7sIQz6TRPiT5Zve6f+2Vrlu8FwEo S7MppsVQkS6DQ0aIl/NWe0uiCZgm8TfTXvIDs52CKvr/1Sr9cP2x6ulikEuu/5Iz7y1l+uG6z d5dlid33xBVI7YMsL0WIo8+mVkP90uBZ0PtGvvlyr6GOSpEEyoJe4SirFnT/BTES+BASIP0cU jbIeU3YB7x4OdPtsDNm8FT4xVVCC4kXUR/2M/0b8B9ebRgyxzC7CyJjGh9hCRGa9TX6bx56ZY JSgIV3/GTFKCggXtCPnZzxo5X8ugj+NdhUFlyilmL3n/Z61MSKhS8SV0nsQKenYwX9IDzXIfF RtQHrdknCcnDHKNjjublmVilU04rgHcM2qxH6N7ENE7GgU/NOiR1RPPMCrrIzN/Im25Fg/c5P 1SwSVhmTOtNBAMCKSTJebfRY3x41pSiWAbi5qH+X+WYWvjHn4MZvvLwLNaOPwHyv3/G+fEn24 icLq7ryv0H0WSFyQheLP+dyssTyAHcWFqOSXEUMXMhjq+wwkVR9tEPIz/EFz/OhU8s/vWBNnp vOFojuRFTDWvNeQUv162ipmev7QhDYTr6QocBbUwRVMFb2vlxWF2/rjlO18s7CcKwK2A7RjFZ rNNxEp8WWfwZ+ZCJc7mwciBSVa/4prCU6PvkWrtMcYJJc+CwsrAVMdKz9nU= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2693 Lines: 74 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --CwuGboeE3PACFF32XlGmIQ8KNID3HT9hA Content-Type: multipart/mixed; boundary="xPr0vVIInS9p2DJ7mMcD0a75jK7O4CNGS"; protected-headers="v1" From: Jan Kiszka To: Mark Brown , Andy Shevchenko Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , linux-spi , Linux Kernel Mailing List , linux-arm-kernel Message-ID: Subject: Re: [PATCH] spi: pxa2xx: Only claim CS GPIOs when the slave device is created References: <90b3e14d-0077-9a25-9d90-ab340577af57@web.de> <20170710120913.g35ftcbs7pngrtsm@sirena.org.uk> In-Reply-To: <20170710120913.g35ftcbs7pngrtsm@sirena.org.uk> --xPr0vVIInS9p2DJ7mMcD0a75jK7O4CNGS Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2017-07-10 14:09, Mark Brown wrote: > On Sun, Jul 09, 2017 at 12:48:10AM +0300, Andy Shevchenko wrote: >> On Sat, Jul 8, 2017 at 11:41 AM, Jan Kiszka wrote:= >=20 >>> Tested on the IOT2000 where the second SPI bus is connected to an >>> Arduino-compatible connector and multiplexed between SPI, GPIO and PW= M >>> usage. >=20 >> Can we first switch the driver to use GPIO descriptors instead of >> plain integers? >=20 > Only if you also convert the SPI core to use descriptors, Chris Packham= > was looking at that but he needed update the ep93xx drivers among other= s > and getting reviewers was hard. >=20 IIUC, we can't convert completely due to some legacy boards providing their CS lines as integers. But even then, a few more API usages can be converted. While looking into this, I noticed that this patch violated the formal rule to never release a GPIO with the old API when it was requested with the new one. That's at least stated in the docs, even though gpio_free is equivalent to gpiod_put. Fixed that already, but I need to find some time to retest. Jan --xPr0vVIInS9p2DJ7mMcD0a75jK7O4CNGS-- --CwuGboeE3PACFF32XlGmIQ8KNID3HT9hA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlljufEACgkQitSsb3rl5xT2GgCg69FfU53V1W2p9VcahSFmy9Ni TW4AoIkL7HGviaPOX2l8i7qUZuc06oY9 =XznT -----END PGP SIGNATURE----- --CwuGboeE3PACFF32XlGmIQ8KNID3HT9hA--