From patchwork Thu Sep 10 16:12:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 261132 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D854C07548 for ; Thu, 10 Sep 2020 18:48:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3B4220855 for ; Thu, 10 Sep 2020 18:48:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599763728; bh=ipXNcf/TRHvf+ZR7u/TpP2y/IWKhoPj+ksZzOBS6oeY=; h=From:To:Subject:Date:In-Reply-To:References:List-ID:From; b=JW0HYU7Sd70Fr+7Fg0TkvinangSgPJMQWuMVOsTPTVja7AUQXAPz130n/P692WN+D 04kNRH+pmD0Mibb2y4kw/bBkD/5qWFiU4SFGdVgRtyT2Xr2urQE2lNuiJfFivWKnAC o7+aAfx+Es6w5IH+o/fDFx8mTOUSFWeUXRLuQEoM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727107AbgIJSqT (ORCPT ); Thu, 10 Sep 2020 14:46:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:59750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726731AbgIJQN0 (ORCPT ); Thu, 10 Sep 2020 12:13:26 -0400 Received: from localhost.localdomain (unknown [194.230.155.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1AD9320C09; Thu, 10 Sep 2020 16:12:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599754361; bh=ipXNcf/TRHvf+ZR7u/TpP2y/IWKhoPj+ksZzOBS6oeY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LYXD5L1KnSWu9wrTfZpVm7D0GGZfWKqF4E7VDT6pnjMpouWEamKmpdlvM9ijAK/eK QWcRPcCAl9HaufFaAOA6s3msHheRw5l3FQYUlnMKmaZaNs/xUcfX8EabfcmDlIgnvl s8xz2tBfAXi54roPdCqIGRGBbxzRoAttSWCNarjA= From: Krzysztof Kozlowski To: "David S. Miller" , Jakub Kicinski , Rob Herring , Krzysztof Kozlowski , Krzysztof Opasiak , Kukjin Kim , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-nfc@lists.01.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v3 3/8] nfc: s3fwrn5: Remove wrong vendor prefix from GPIOs Date: Thu, 10 Sep 2020 18:12:14 +0200 Message-Id: <20200910161219.6237-4-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200910161219.6237-1-krzk@kernel.org> References: <20200910161219.6237-1-krzk@kernel.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The device tree property prefix describes the vendor, which in case of S3FWRN5 chip is Samsung. Therefore the "s3fwrn5" prefix for "en-gpios" and "fw-gpios" is not correct and should be deprecated. Introduce properly named properties for these GPIOs but still support deprecated ones. Signed-off-by: Krzysztof Kozlowski Tested-by: Marek Szyprowski --- drivers/nfc/s3fwrn5/i2c.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/nfc/s3fwrn5/i2c.c b/drivers/nfc/s3fwrn5/i2c.c index b4eb926d220a..557279492503 100644 --- a/drivers/nfc/s3fwrn5/i2c.c +++ b/drivers/nfc/s3fwrn5/i2c.c @@ -200,13 +200,21 @@ static int s3fwrn5_i2c_parse_dt(struct i2c_client *client) if (!np) return -ENODEV; - phy->gpio_en = of_get_named_gpio(np, "s3fwrn5,en-gpios", 0); - if (!gpio_is_valid(phy->gpio_en)) - return -ENODEV; + phy->gpio_en = of_get_named_gpio(np, "en-gpios", 0); + if (!gpio_is_valid(phy->gpio_en)) { + /* Support also deprecated property */ + phy->gpio_en = of_get_named_gpio(np, "s3fwrn5,en-gpios", 0); + if (!gpio_is_valid(phy->gpio_en)) + return -ENODEV; + } - phy->gpio_fw_wake = of_get_named_gpio(np, "s3fwrn5,fw-gpios", 0); - if (!gpio_is_valid(phy->gpio_fw_wake)) - return -ENODEV; + phy->gpio_fw_wake = of_get_named_gpio(np, "wake-gpios", 0); + if (!gpio_is_valid(phy->gpio_fw_wake)) { + /* Support also deprecated property */ + phy->gpio_fw_wake = of_get_named_gpio(np, "s3fwrn5,fw-gpios", 0); + if (!gpio_is_valid(phy->gpio_fw_wake)) + return -ENODEV; + } return 0; }