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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C879C77B7F for ; Mon, 8 May 2023 15:17:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234448AbjEHPRN (ORCPT ); Mon, 8 May 2023 11:17:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234441AbjEHPRM (ORCPT ); Mon, 8 May 2023 11:17:12 -0400 X-Greylist: delayed 62 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 08 May 2023 08:17:07 PDT Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3298676AE for ; Mon, 8 May 2023 08:17:06 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id 3dcf1144-edb3-11ed-b3cf-005056bd6ce9; Mon, 08 May 2023 18:16:02 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Mon, 8 May 2023 18:16:00 +0300 To: Linus Walleij Cc: Aaro Koskinen , Janusz Krzysztofik , Tony Lindgren , Russell King , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Thomas Bogendoerfer , Dmitry Torokhov , Mark Brown , Bartosz Golaszewski , Andreas Kemnade , Helge Deller , Ulf Hansson , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-input@vger.kernel.org, linux-spi@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mmc@vger.kernel.org Subject: Re: [PATCH v3 1/3] Input: ads7846 - Convert to use software nodes Message-ID: References: <20230430-nokia770-regression-v3-0-a6d0a89ffa8b@linaro.org> <20230430-nokia770-regression-v3-1-a6d0a89ffa8b@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230430-nokia770-regression-v3-1-a6d0a89ffa8b@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Fri, May 05, 2023 at 01:16:55PM +0200, Linus Walleij kirjoitti: > The Nokia 770 is using GPIOs from the global numberspace on the > CBUS node to pass down to the LCD controller. This regresses when we > let the OMAP GPIO driver use dynamic GPIO base. > > The Nokia 770 now has dynamic allocation of IRQ numbers, so this > needs to be fixed for it to work. > > As this is the only user of LCD MIPID we can easily augment the > driver to use a GPIO descriptor instead and resolve the issue. > > The platform data .shutdown() callback wasn't even used in the > code, but we encode a shutdown asserting RESET in the remove() > callback for completeness sake. > > The CBUS also has the ADS7846 touchscreen attached. > > Populate the devices on the Nokia 770 CBUS I2C using software > nodes instead of platform data quirks. This includes the LCD > and the ADS7846 touchscreen so the conversion just brings the LCD > along with it as software nodes is an all-or-nothing design > pattern. > > The ADS7846 has some limited support for using GPIO descriptors, > let's convert it over completely to using device properties and then > fix all remaining boardfile users to provide all platform data using > software nodes. > > Dump the of includes and of_match_ptr() in the ADS7846 driver as part > of the job. > > Since we have to move ADS7846 over to obtaining the GPIOs it is > using exclusively from descriptors, we provide descriptor tables > for the two remaining in-kernel boardfiles using ADS7846: > > - PXA Spitz > - MIPS Alchemy DB1000 development board > > It was too hard for me to include software node conversion of > these two remaining users at this time: the spitz is using a > hscync callback in the platform data that would require further > GPIO descriptor conversion of the Spitz, and moving the hsync > callback down into the driver: it will just become too big of > a job, but it can be done separately. > > The MIPS Alchemy DB1000 is simply something I cannot test, so take > the easier approach of just providing some GPIO descriptors in > this case as I don't want the patch to grow too intrusive. ... > #include Do we need it after this patch? > #include > +#include ... > +static const struct software_node *nokia770_gpiochip_nodes[] = { > + &nokia770_mpuio_gpiochip_node, > + &nokia770_gpiochip1_node, > + &nokia770_gpiochip2_node, > + NULL, Comma is redundant for the terminator entry. > +}; ... > +static struct gpiod_lookup_table spitz_ads7846_gpio_table = { > + .dev_id = "spi2.0", > + .table = { > + GPIO_LOOKUP("gpio-pxa", SPITZ_GPIO_TP_INT, > + "pendown", GPIO_ACTIVE_HIGH), > + { }, Ditto. > + }, > +}; ... > +static struct gpiod_lookup_table db1100_touch_gpio_table = { > + .dev_id = "spi0.0", > + .table = { > + GPIO_LOOKUP("alchemy-gpio2", 21, > + "pendown", GPIO_ACTIVE_HIGH), > + { }, Ditto. > + }, > +}; -- With Best Regards, Andy Shevchenko