Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp755095rdh; Sun, 24 Sep 2023 10:12:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHodUElUSlP0mZOy9eFT65sYMoRr3kJJS08mTdO4/+TRqaeD38LcsMlvmx6xDEtVs+TMYFg X-Received: by 2002:a05:6a00:1a0e:b0:692:b3da:9f35 with SMTP id g14-20020a056a001a0e00b00692b3da9f35mr3588542pfv.7.1695575567360; Sun, 24 Sep 2023 10:12:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695575567; cv=none; d=google.com; s=arc-20160816; b=cRGYgGnpYB78dw7WzVf+qfmeK2e0StL2e8ByX+z44B6RKsoy/iBTk/ZLgQRqMvuFTL ARhtz0yHlh2s/0sVZNbAAWNDHnxfNOMBlHevhKoB8sxLEfIbp3J6gxB7Yw+qyrh+Ssyb AOC2PmzxbwYoCWMnV5dG/l25o4kfEqqaBrkoYC1oQkyhpG3MSeOCttfOOKm+rbTrA933 p0/dX5Rwe8ldmaYegQgs5+WziVoyWc8WmQaBRoJ1Sdh8e69bXZiLmTWxvpYeAZ58j5f7 nqvpIjbVt36WByWnKEKMsD2DY3FHDbgpo2bbyE84WQYNQfIQbJDFbGmIZ9BUKv3U56ms wTUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from; bh=iPIvb3hN9MTS1ifxXNdK5Clgs9CfXBR8loPYlIU4a1c=; fh=UU0GqEaQ9Xnukct86UJbX2/ZB3UfIgAdTfbf6iYszSw=; b=CL7w6H5zuSQuq0gbqCgST9lDGv9CvdZs2InmuWYUdz6MgwFCaeQrTv8TBD+swxwj7Q 5AAWJH81n0YH1IxUplFoDVE7G7cP8FPH0773aLc2+l8GMfo57qm/T9ysNGMrhtr3OxXx nXs4iTntTxSUL5MHx2rJj5wynNVqvi/C4T9u1D7gJsWQE3tOY5vY5FhzoQTGZJvr9UsA LTySJfgcr2rfPtHrJ1uUeHmfSHkO1/QG0YQyMGSGY6PWMeRq4FAvuzZT7sQv3oiNQ9gR qUp/dAlLzj2PRm09qqUGSmY40xqDvEvvqIgF4tbQMDB33KM2izwOW4lA3/Mza3hCna3G vrAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id k18-20020aa788d2000000b00690d79b95f7si8336428pff.288.2023.09.24.10.12.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Sep 2023 10:12:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 353118115442; Sun, 24 Sep 2023 10:12:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230206AbjIXRLt (ORCPT + 99 others); Sun, 24 Sep 2023 13:11:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230089AbjIXRLj (ORCPT ); Sun, 24 Sep 2023 13:11:39 -0400 Received: from mx.skole.hr (mx1.hosting.skole.hr [161.53.165.185]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D267C6 for ; Sun, 24 Sep 2023 10:11:33 -0700 (PDT) Received: from mx1.hosting.skole.hr (localhost.localdomain [127.0.0.1]) by mx.skole.hr (mx.skole.hr) with ESMTP id 314D38207C; Sun, 24 Sep 2023 19:11:32 +0200 (CEST) From: =?utf-8?q?Duje_Mihanovi=C4=87?= Date: Sun, 24 Sep 2023 18:42:58 +0200 Subject: [PATCH RFC 5/6] ARM: pxa: Convert Spitz hsync to GPIO descriptors MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230924-pxa-gpio-v1-5-2805b87d8894@skole.hr> References: <20230924-pxa-gpio-v1-0-2805b87d8894@skole.hr> In-Reply-To: <20230924-pxa-gpio-v1-0-2805b87d8894@skole.hr> To: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King , Alan Stern , Greg Kroah-Hartman , Linus Walleij , Bartosz Golaszewski , Andy Shevchenko Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, =?utf-8?q?Duje_Mihanovi=C4=87?= X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1719; i=duje.mihanovic@skole.hr; h=from:subject:message-id; bh=5895JvGZEWJwM5WNxnvl7MrpXNHBGrr2xGh6alIOeRs=; b=owEBbQKS/ZANAwAIAZoRnrBCLZbhAcsmYgBlEG28CnZS8E5xwAgzJ6CVN1PApJKF1p75dl+ro yYoGLjMX3SJAjMEAAEIAB0WIQRT351NnD/hEPs2LXiaEZ6wQi2W4QUCZRBtvAAKCRCaEZ6wQi2W 4YQfD/9LYjsoRnldDP9MME1UjvcTXrPKebJ1AlZZnkgjiTUqxRtFVja207shgBymZoSNfnYFQXK sts9x+WgMnlEaHH5XL6nRVrsBZ+v/TahgGgaEXvoq5MvERbUo9ndtbNsSZmTFAppefrqk6UK3eY tTnpgwRWJrhyybcGSqKy2RlbvnCxlBJtaKNmjbwY5OfXfgu0yu/Nzbf99f2+B9Sjfzhs7GhKINK tqhH3qpCvqMbEASiph4uIj5NoZeK3BpdSycgBAy0S5C7nP1LxhRzB57gLSBGPAu0zjKfq3cWIqY v4BXqg/OwTG/Q1IL8MxuROJoLhV+ehUFN/s6qb8crXQkTmcxWfikfIWCM7i/B/4SsFhW3G/doPY sPg7vCpWiX+ScuB7opkcFPlszjXy7Z+EkwTc0Nzq2N6saG4cbUI0OoV5rk91o0/pHZ1haAQ6FJG BMwJLJXjlIyPFAyEe/cq6oNb3AM0Z8sX74+uO3cWijv3Lt2qmzFybQrF1w3zAypi7g8mNJ9DZ+O 0MipG2lbd/oIHZ8dyfljXYMTKrWieYgZAh4FKFajPGAVwgp8rwsE63vB+EMg6119jorXG/Xp86b jBm20jjKfDGUnMG9lUoctJfg/2keNdlpp3sULGvQi0FeNWLjSQnOFKd+Kpydu/Y3nhaIsDVXF7G iRxo4ltWhHjGHUA== X-Developer-Key: i=duje.mihanovic@skole.hr; a=openpgp; fpr=53DF9D4D9C3FE110FB362D789A119EB0422D96E1 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 24 Sep 2023 10:12:03 -0700 (PDT) Sharp's Spitz still uses the legacy GPIO interface in its wait_for_hsync function. Convert it to use the GPIO descriptor interface. Signed-off-by: Duje Mihanović --- arch/arm/mach-pxa/spitz.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 94bcb187713b..1e38069e75f7 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c @@ -520,12 +520,14 @@ static inline void spitz_leds_init(void) {} * SSP Devices ******************************************************************************/ #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) +static struct gpio_desc *hsync = NULL; + static void spitz_ads7846_wait_for_hsync(void) { - while (gpio_get_value(SPITZ_GPIO_HSYNC)) + while (gpiod_get_value(hsync)) cpu_relax(); - while (!gpio_get_value(SPITZ_GPIO_HSYNC)) + while (!gpiod_get_value(hsync)) cpu_relax(); } @@ -543,6 +545,8 @@ static struct gpiod_lookup_table spitz_ads7846_gpio_table = { .table = { GPIO_LOOKUP("gpio-pxa", SPITZ_GPIO_TP_INT, "pendown", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("gpio-pxa", SPITZ_GPIO_HSYNC, + "hsync", GPIO_ACTIVE_LOW), { } }, }; @@ -622,6 +626,9 @@ static void __init spitz_spi_init(void) gpiod_add_lookup_table(&spitz_ads7846_gpio_table); gpiod_add_lookup_table(&spitz_spi_gpio_table); + hsync = gpiod_get(NULL, "hsync", GPIOD_IN); + if (IS_ERR(hsync)) + pr_err("Failed to get hsync GPIO: %ld\n", PTR_ERR(hsync)); pxa2xx_set_spi_info(2, &spitz_spi_info); spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices)); } -- 2.42.0