From patchwork Mon Dec 5 13:40:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 13064514 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 28501C4708C for ; Mon, 5 Dec 2022 13:42:18 +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:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=s0Y11OypHRspJXekc5i9hjJ34ImafKdtGYSNVFEY4FY=; b=MZAvyME0M0OAer x6HQj1uRUhcmgX3uQYx481UCeXBp1e6OzNIfZo6qr+l2o497xAQEnH9Rdx8jbQ1AWFg92SS3rRqxA 2gp/Iaesa9ZcHZlbj0855YAPHIvDcfP7oifIlDVdA5Qk42uUNOq1EZBFxjJD+tgwHPxuQwyLwHYLI aQhN9ss1cvInRDXCwlnu36DziD0MOKXMvE+gGrzDiOahNkrIA9jDwds964/BGH4IOn1ek/Berb26c W90+RVAnAPI6saZDd4NKbRELCr0tlpXnLulIm5Uoa/EwSizwP0uUiMIAF6GEZyc8PtcTHEBIJ+qzV eRVvhQFKpSrU5DM51Rag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p2Bii-003ZUh-B3; Mon, 05 Dec 2022 13:41:20 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p2Bid-003ZS9-Lb; Mon, 05 Dec 2022 13:41:17 +0000 Received: (Authenticated sender: foss@0leil.net) by mail.gandi.net (Postfix) with ESMTPSA id 3D32DFF802; Mon, 5 Dec 2022 13:41:00 +0000 (UTC) From: Quentin Schulz To: Samuel Holland , Bastien Nocera , =?utf-8?q?Guido_G=C3=BCnther?= , Sascha Hauer , Pengutronix Kernel Team , Angus Ainslie , Ondrej Jirman , Icenowy Zheng , Andy Gross , Aleksei Mamlin , Fabio Estevam , David Jander , Frieder Schrempf , Bjorn Andersson , Konrad Dybcio , Peter Geis , Heiko Stuebner , Shawn Guo , Jernej Skrabec , Lukasz Majewski , AngeloGioacchino Del Regno , Chen-Yu Tsai , Michael Riesch , Rob Herring , NXP Linux Team , Dmitry Torokhov , Hans de Goede , Jagan Teki , Krzysztof Kozlowski Cc: Quentin Schulz , linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org Subject: [PATCH v3 1/9] Input: goodix - add macro for gpio mapping Date: Mon, 5 Dec 2022 14:40:30 +0100 Message-Id: <20221103-upstream-goodix-reset-v3-1-0975809eb183@theobroma-systems.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103-upstream-goodix-reset-v3-0-0975809eb183@theobroma-systems.com> References: <20221103-upstream-goodix-reset-v3-0-0975809eb183@theobroma-systems.com> MIME-Version: 1.0 X-Mailer: b4 0.10.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221205_054115_987311_A7A6E0EB X-CRM114-Status: GOOD ( 11.92 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Quentin Schulz To prepare for the quirks member to be set for all pins, which would make the line longer than allowed, let's move all mappings into a macro. Signed-off-by: Quentin Schulz --- drivers/input/touchscreen/goodix.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c index c281e49826c23..d73d4272a8ea5 100644 --- a/drivers/input/touchscreen/goodix.c +++ b/drivers/input/touchscreen/goodix.c @@ -797,23 +797,31 @@ static int goodix_reset(struct goodix_ts_data *ts) } #ifdef ACPI_GPIO_SUPPORT + +#define GOODIX_GPIO_MAPPING(_name, _params, _size) \ + { \ + .name = _name, \ + .data = _params, \ + .size = _size, \ + } + static const struct acpi_gpio_params first_gpio = { 0, 0, false }; static const struct acpi_gpio_params second_gpio = { 1, 0, false }; static const struct acpi_gpio_mapping acpi_goodix_int_first_gpios[] = { - { GOODIX_GPIO_INT_NAME "-gpios", &first_gpio, 1 }, - { GOODIX_GPIO_RST_NAME "-gpios", &second_gpio, 1 }, + GOODIX_GPIO_MAPPING(GOODIX_GPIO_INT_NAME "-gpios", &first_gpio, 1), + GOODIX_GPIO_MAPPING(GOODIX_GPIO_RST_NAME "-gpios", &second_gpio, 1), { }, }; static const struct acpi_gpio_mapping acpi_goodix_int_last_gpios[] = { - { GOODIX_GPIO_RST_NAME "-gpios", &first_gpio, 1 }, - { GOODIX_GPIO_INT_NAME "-gpios", &second_gpio, 1 }, + GOODIX_GPIO_MAPPING(GOODIX_GPIO_RST_NAME "-gpios", &first_gpio, 1), + GOODIX_GPIO_MAPPING(GOODIX_GPIO_INT_NAME "-gpios", &second_gpio, 1), { }, }; static const struct acpi_gpio_mapping acpi_goodix_reset_only_gpios[] = { - { GOODIX_GPIO_RST_NAME "-gpios", &first_gpio, 1 }, + GOODIX_GPIO_MAPPING(GOODIX_GPIO_RST_NAME "-gpios", &first_gpio, 1), { }, };