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: 29681 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2261103wrr; Mon, 5 Dec 2022 05:45:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf7t/qOiVnoBcp4E4uShoRE0xXTA599pG66e0FYlb4hK0vIFcJYFkkNskdivzvBVHPwFoZGs X-Received: by 2002:a17:902:d192:b0:189:8867:9bd4 with SMTP id m18-20020a170902d19200b0018988679bd4mr39995151plb.68.1670247900801; Mon, 05 Dec 2022 05:45:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670247900; cv=none; d=google.com; s=arc-20160816; b=1Duqu9I9RpPB8SNTFxo3YpeKOXfN8OAk5UFyw/fIs/e6e+1yCcYO9bLCKuTFcwOsg3 281bowUgruqX2jGoRYYD1pnImZ9C+3fRRXDRHT80TIY5kHdOF6xpTEvHXRe6ltm5uMmO z46hlPxvi6n0/VZtj9cgeb/t+3Ks2MaRJ8jtB7fNVMDarPgbdt83DT4+j1Pq8kdlcQfX JwUTRHAmw8ID7jS/KKr8zM6PTn1T+xgYy+Qw067Vo6w3xbshH48sb/e2+NJj3cX6+Dwu Rmnx5C+qnTNNtVw+PN53TPiYYNaBYqJrn3a/6fU2CSt0ykVD0vEwwgHEr3g9chUXPz71 3Frg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=LD/chWH17w25M9pXTwH4UpygERMvp4cXcbTlF7jaHYg=; b=Os3iAP562EWqcgTIDGfmBJL7nuLFap1mSkpqTg2mTpjDWfP3WgdrRAmGClciOlUts/ xXeQaU+Lc72q5JGciLSlvU1dhxiEC+xiwwTPeiKI0HylBbdpBL9MnFAkaO9BmEto4RxE 3DYd+d78D4TQngttedxz5acPYtIesZ3PStS6qzQEnXjAR+VRzhYY6xMCC/xKbBTcp5Tf i74NMyzaC+EZBxP2GKc899RlbchgJMZ53IJWbZiX1lFEjnrp4OFY7RhxaDlYvMWkLCPs zFp6Cq+mQzMCo/JVrBO1gaave3P1JBmcTecuvi0tIJKiO9wIiMx29enTP2gyh+s44K1j okgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qi16-20020a17090b275000b00205f1a25a31si14818788pjb.161.2022.12.05.05.44.47; Mon, 05 Dec 2022 05:45:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232071AbiLENlZ (ORCPT + 99 others); Mon, 5 Dec 2022 08:41:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232010AbiLENlV (ORCPT ); Mon, 5 Dec 2022 08:41:21 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 692591CFD8; Mon, 5 Dec 2022 05:41:15 -0800 (PST) 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-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751381863186052482?= X-GMAIL-MSGID: =?utf-8?q?1751381863186052482?= 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), { }, };