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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 76FFBC433EF for ; Fri, 21 Jan 2022 09:44:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wQ+eiowERzfI2sbIgbcF2W2M91IVKCnYYbVlQuefLag=; b=WJv0pYHO9KlZIC lWngjGjlmJ2rsF1RdUm3tqVtEV84DQw3L47VZcXLRGAiIfNzwqqCVIJypz/RNsV/gZr6uOJUQjk1e vKzHXVMe2vNRTHIp9c8ISdNlyKOrPZsbxGAkHoEqjc84AnAfYMClYix+YQr5QGEJp+PiX2qEXRvXR PrLIgIs9cUJDJXyK499hs9sRD4ncJg2gQjdLK7pRYJgUmRoLMLIXzIotm2UuHuYqJeP+Z2z0wfpQ/ RtnrjcdYML19KlEG0zczLHYTyGZ5+eyO0uMGtYyrwYJt3y4n1ztzhx5SPamlb6L0Y0RnUgXpHZ6Sg BBdgciY1ktkteJTbqRfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAqRf-00EWWb-GT; Fri, 21 Jan 2022 09:42:59 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAqRb-00EWUH-NJ for linux-arm-kernel@lists.infradead.org; Fri, 21 Jan 2022 09:42:58 +0000 Received: from fraeml740-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4JgDqT4Y6xz67yhj; Fri, 21 Jan 2022 17:39:33 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml740-chm.china.huawei.com (10.206.15.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Fri, 21 Jan 2022 10:42:47 +0100 Received: from localhost (10.47.75.29) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.21; Fri, 21 Jan 2022 09:42:46 +0000 Date: Fri, 21 Jan 2022 09:42:43 +0000 From: Jonathan Cameron To: Linus Walleij CC: Mark Brown , , Marek Vasut , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Subject: Re: [PATCH] spi: pxa2xx_spi: Convert to use GPIO descriptors Message-ID: <20220121094243.0000651f@Huawei.com> In-Reply-To: <20220121012014.287288-1-linus.walleij@linaro.org> References: <20220121012014.287288-1-linus.walleij@linaro.org> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.29; i686-w64-mingw32) MIME-Version: 1.0 X-Originating-IP: [10.47.75.29] X-ClientProxiedBy: lhreml702-chm.china.huawei.com (10.201.108.51) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220121_014256_116567_4A1791C1 X-CRM114-Status: GOOD ( 23.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 21 Jan 2022 02:20:14 +0100 Linus Walleij wrote: > This converts the PXA2xx SPI driver to use GPIO descriptors > exclusively to retrieve GPIO chip select lines. > > The device tree and ACPI paths of the driver already use > descriptors, hence ->use_gpio_descriptors is already set and > this codepath is well tested. > > Convert all the PXA boards providing chip select GPIOs as > platform data and drop the old GPIO chipselect handling in > favor of the core managing it exclusively. > > Cc: Marek Vasut > Cc: Daniel Mack > Cc: Haojian Zhuang > Cc: Robert Jarzmik > Cc: linux-arm-kernel@lists.infradead.org > Signed-off-by: Linus Walleij > --- > Documentation/spi/pxa2xx.rst | 3 -- > arch/arm/mach-pxa/corgi.c | 26 +++++++--------- > arch/arm/mach-pxa/hx4700.c | 10 +++++- > arch/arm/mach-pxa/icontrol.c | 26 +++++++++++++--- > arch/arm/mach-pxa/littleton.c | 10 +++++- > arch/arm/mach-pxa/magician.c | 12 +++++-- > arch/arm/mach-pxa/poodle.c | 14 ++++++--- > arch/arm/mach-pxa/spitz.c | 26 +++++++--------- > arch/arm/mach-pxa/stargate2.c | 21 +++++++++++-- > arch/arm/mach-pxa/z2.c | 20 ++++++++++-- > drivers/spi/spi-pxa2xx.c | 57 ---------------------------------- > include/linux/spi/pxa2xx_spi.h | 1 - > 12 files changed, 117 insertions(+), 109 deletions(-) > ... > diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c > index 8ca02ec1d44c..650043023006 100644 > --- a/arch/arm/mach-pxa/stargate2.c > +++ b/arch/arm/mach-pxa/stargate2.c > @@ -346,6 +346,23 @@ static struct pxa2xx_spi_controller pxa_ssp_master_2_info = { > .num_chipselect = 1, > }; > > +static struct gpiod_lookup_table pxa_ssp1_gpio_table = { > + .dev_id = "pxa2xx-spi.1", > + .table = { > + GPIO_LOOKUP_IDX("gpio-pxa", 24, "cs", 0, GPIO_ACTIVE_LOW), > + { }, > + }, > +}; > + > +static struct gpiod_lookup_table pxa_ssp3_gpio_table = { > + .dev_id = "pxa2xx-spi.3", > + .table = { > + GPIO_LOOKUP_IDX("gpio-pxa", 39, "cs", 0, GPIO_ACTIVE_LOW), > + { }, > + }, > +}; > + Nitpick, one line will do. As a side note I have a patch outstanding (from May 2021) to drop stargate2/imote2 on basis that I strongly suspect I'm the only person who still has access to hardware and I've not booted one for a few years. https://lore.kernel.org/all/20210523163606.1966355-1-jic23@kernel.org/ Patch still applies cleanly. In meantime for stargate2/imote2 (same file) Should both patches go in the merge conflict will be very obvious ;) Acked-by: Jonathan Cameron > + > /* An upcoming kernel change will scrap SFRM usage so these > * drivers have been moved to use GPIOs */ > static struct pxa2xx_spi_chip staccel_chip_info = { > @@ -353,7 +370,6 @@ static struct pxa2xx_spi_chip staccel_chip_info = { > .rx_threshold = 8, > .dma_burst_size = 8, > .timeout = 235, > - .gpio_cs = 24, > }; > > static struct pxa2xx_spi_chip cc2420_info = { > @@ -361,7 +377,6 @@ static struct pxa2xx_spi_chip cc2420_info = { > .rx_threshold = 8, > .dma_burst_size = 8, > .timeout = 235, > - .gpio_cs = 39, > }; > > static struct spi_board_info spi_board_info[] __initdata = { > @@ -410,6 +425,8 @@ static void __init imote2_stargate2_init(void) > pxa_set_btuart_info(NULL); > pxa_set_stuart_info(NULL); > > + gpiod_add_lookup_table(&pxa_ssp1_gpio_table); > + gpiod_add_lookup_table(&pxa_ssp3_gpio_table); > pxa2xx_set_spi_info(1, &pxa_ssp_master_0_info); > pxa2xx_set_spi_info(2, &pxa_ssp_master_1_info); > pxa2xx_set_spi_info(3, &pxa_ssp_master_2_info); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel