Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752109AbdGIKbT (ORCPT ); Sun, 9 Jul 2017 06:31:19 -0400 Received: from mout.web.de ([212.227.15.14]:53083 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751667AbdGIKbR (ORCPT ); Sun, 9 Jul 2017 06:31:17 -0400 Subject: Re: [PATCH] spi: pxa2xx: Only claim CS GPIOs when the slave device is created To: Andy Shevchenko Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Mark Brown , linux-spi , Linux Kernel Mailing List , linux-arm-kernel References: <90b3e14d-0077-9a25-9d90-ab340577af57@web.de> <1677d448-4cdd-363f-34a6-152c61a06c0e@web.de> From: Jan Kiszka Message-ID: <70d88e65-5dd1-f218-dc39-e553a1b6acb5@web.de> Date: Sun, 9 Jul 2017 12:30:40 +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: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="U4Fp4iD6xdqtgsIuITPcrafqinSDF6QEo" X-Provags-ID: V03:K0:Tw800bcak2rHMiupTvUxGJVjvcNVU2YqVZ1Qr/pqs+pTmwLRXxe I2RAByXpAWM3qNvdkNoXzOt0lLhVavv4ziHoY2M+2vPC4HCw0JBqyXcjcKVhozsjtBhvPOk F3j4qJeHKUQxTUM++zKhY+da886az0WCLulKuPZzC6y+2Q7kjmCXzSs/kiHe9YZcYvr7cay goCpH1WiiP6BeJzwTs4KQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:eyZuMdpMc8A=:0fsHCmgMThSAbTtKiIAMlW 7s9N1OIUFhgjIgmopfNnMG8Pqwgd1KSLZTYbw843z2ts7YU55t7Fl9/RNuTBgYTMyUdlzPTJJ X4t3GkAzAvuN9Xqp02/WkwnB96RLdgZTPpmYt/1btZSj5ofTcp7hWR6FZx0V2sg6aX13RC/wf O8NZKnTmPgQHWqqeLIWFQYiEdEQAbionOwZVpwuUKh5KmUeIvbOCbe8KAVevI2JHYIPsM+bfp xySrz7FkiQe3bRMWBJyXUAVkWk5kSYASlUZlBfZjGnsdAlMPlwdvxFQrcpH3kRXtfImwtLwxZ Cq95Lc0vkeVk6K9AAoaqiQgLz3C39HCOh0Z5gRYb7PHMLNpLfoBjFn7sb0SOHxtZYIfWXSik2 Brcqz0j8LJIbmNj3arI6S7+KAhxWNR+OXPFCXypC4VZvRkHxFLuasRIrKMNzfNTWw5l8uX4qt zGzh+cKuOlFN6r9SIops4M8SjjqzPEGrfWj/ZD7JNOk7akpdERiBBfIhKNUrcIwFjfPzw4O8b pcFrdvZz/J6LMRejSWulHZRvDdcdniS4ppUod66NOMuDB7nfvsWPvjGZ2v9Da3xq9HsRvMqMr ty6UCC7xT46DI+1GCTTeycmVmSNis7ooL/3Y357TCmO4HYer0lXVHndL3p3VhcIFzGFk8wr2+ n7MWp+3eQBtQ0JcRU1xEZcFIe9E4BRSLrs2wYrelrajg+WChWrlvOdc3ykjGgfS8nDx4NH/v4 LGmeh+k2+02ImcLFbTY526U6hoIfHwoVqfqAwwrcOGE6qJVoPqBZmlWmnuo= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2983 Lines: 79 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --U4Fp4iD6xdqtgsIuITPcrafqinSDF6QEo Content-Type: multipart/mixed; boundary="t5kek70B9h6xnJFREtaqLxWBsfw65ce9A"; protected-headers="v1" From: Jan Kiszka To: Andy Shevchenko Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Mark Brown , linux-spi , Linux Kernel Mailing List , linux-arm-kernel Message-ID: <70d88e65-5dd1-f218-dc39-e553a1b6acb5@web.de> Subject: Re: [PATCH] spi: pxa2xx: Only claim CS GPIOs when the slave device is created References: <90b3e14d-0077-9a25-9d90-ab340577af57@web.de> <1677d448-4cdd-363f-34a6-152c61a06c0e@web.de> In-Reply-To: --t5kek70B9h6xnJFREtaqLxWBsfw65ce9A Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2017-07-09 11:55, Andy Shevchenko wrote: > On Sun, Jul 9, 2017 at 12:30 PM, Jan Kiszka wrote: >> On 2017-07-08 23:48, Andy Shevchenko wrote: >>> On Sat, Jul 8, 2017 at 11:41 AM, Jan Kiszka wrote= : >>>> From: Jan Kiszka >>>> >>>> Avoid hogging chip select GPIOs just because they are listed for the= >>>> master. They might be mulitplexed and, if no slave device is attache= d, >>>> used for different purposes. Moreover, this strategy avoids having t= o >>>> allocate a cs_gpiods structure. >>>> >>>> Tested on the IOT2000 where the second SPI bus is connected to an >>>> Arduino-compatible connector and multiplexed between SPI, GPIO and P= WM >>>> usage. >>> >>> Can we first switch the driver to use GPIO descriptors instead of >>> plain integers? >> >> -ENOPARSE >=20 > In code you are trying to modify there is a mix of plain integers and > GPIO descriptors (and two APIs). > Can we just convert it to use GPIO descriptors API? That wasn't helpful either for someone not doing gpio development the whole day. I suppose you wanted to suggest the conversion of chip_data::chip_cs to struct gpio_desc * and the consistent usage of gpiod_*, instead of gpio_*. That's not necessarily a precondition, but it's a reasonable cleanup. Jan --t5kek70B9h6xnJFREtaqLxWBsfw65ce9A-- --U4Fp4iD6xdqtgsIuITPcrafqinSDF6QEo 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 iEYEARECAAYFAlliBdQACgkQitSsb3rl5xT4QQCgkjR/tZJFmflxUpv4YkYUSpCe UVEAoNYymNN8HAItPH8nhweE9wRGYx2U =tMDs -----END PGP SIGNATURE----- --U4Fp4iD6xdqtgsIuITPcrafqinSDF6QEo--