From patchwork Sun Sep 24 16:42:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Duje_Mihanovi=C4=87?= X-Patchwork-Id: 144126 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp760958vqu; Sun, 24 Sep 2023 10:12:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRLt1WGYiHb35EKGKVoAkFsQwzHwYGXTZRYZirqz4P2SpG7BdoVLok04b8dryuBeg4lsbb X-Received: by 2002:a17:90b:3e87:b0:26d:4312:17e5 with SMTP id rj7-20020a17090b3e8700b0026d431217e5mr2744654pjb.6.1695575558323; Sun, 24 Sep 2023 10:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695575558; cv=none; d=google.com; s=arc-20160816; b=N500Eac8Y9n/F+JAPn4/OnN6Bmqx+8+akRgFf5g3KVZnSxozKaw2i6P0mlsexQu8Y/ Kfqxk4/DMr4czkAH79cGwGFbbyguq8cT5EAn0u3yvS9UR+XQTiDgoRds7xFyODhS0Hcm Ke1DVCPmKTWpREGYjjT08JU3Trc1oMppwd0wABj0qiIe+HxvgUWOXi+vcsV/9JneAd/R T+LFJyRZybVaGhQfI0xNCvFuEJvFBCxBSo47NS5w7PpeVF3VRTemTSm8TyxWs5OjhSBq 9yMT2kee0KppcojsOGQOiOL4eh3rwNLimyn9YccR13P/p1y2XDuOSqJM1Q/Mhiw8rL72 2lKg== 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 Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id gf14-20020a17090ac7ce00b0026963a00ab0si7984108pjb.122.2023.09.24.10.12.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Sep 2023 10:12:38 -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 1790081716B6; Sun, 24 Sep 2023 10:12:24 -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 S230212AbjIXRLu (ORCPT + 30 others); Sun, 24 Sep 2023 13:11:50 -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 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_Mihan?= =?utf-8?q?ovi=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:24 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777939836598033247 X-GMAIL-MSGID: 1777939836598033247 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)); }