From patchwork Wed Jun 29 01:41:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiYuan Huang X-Patchwork-Id: 12899144 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 BCB5FC433EF for ; Wed, 29 Jun 2022 01:42:34 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id: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:In-Reply-To:References: List-Owner; bh=BTXFPALmJoBGWmv0v0Gt/dt71paj+RDnlH9NhJndMF8=; b=jlcd6OEjLcIlza bJJskU1rWOzJn3J3tl0fPZOBUw2xNmw21IztGUsRbGZIW85r+OGSbRRKlo0T90SkXKkNy9rUBrFB2 lhAATPYM8Pd82wGF/bdtsBmS/2kJIN+pttcToz4VyNpKUD2U0KIiJnF2w6alr0wpPWa7gwXcXlTwE IM5OtjYO25fOT4lOkeAUb+tyNwH7mHx8bm9ITBf3OfRud25zbpjK74JRc1cW2uk0ni5Ey7Yf3u9f4 OfhPng8vas6ZjcY7JnAETKuejLazVUGFWi/8hoznH8VY7ndjjUrtxOtuu5XLwdHgYThSzSMWbz8KS 7SlvnAJMoNS1BRIILB1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6Mhh-008wuo-V2; Wed, 29 Jun 2022 01:41:18 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6Mhf-008wt5-6G; Wed, 29 Jun 2022 01:41:16 +0000 Received: by mail-pj1-x102c.google.com with SMTP id i8-20020a17090aee8800b001ecc929d14dso226301pjz.0; Tue, 28 Jun 2022 18:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=S2ALH10CiIJ9QarbU1oFFB9yUYMcWtOsqvnVKD2phWs=; b=Wtpkw/+ZZca6AButPmm3hgE1RwtlB7vp2QjhuYjzW9XWR5P8J835GNQ9GfSeFSr4Kh 9A2cK63SET+iyqCW2bFPd0GgSjFj0viFFM2+MD/kKYKPhLzkWvjhdugQsWd5rzaRbZhR WCEh+IW2w975E9HgFUnPNMC0N0mXMy8x2LaUP43iNQuvM9XlXEqO3AELxs9RKI29vkfw JP1EAjSd8W+1XpcKznqvQBolr6YlNyaYggL+MqqtmWlPs7zAKGVYN9TmisZPAS4OanZb MWx8xF5OrGr7gCEKgUbMq2LUGYEbYXjAZ1AkOm1OsQsbh2/HTf8eNDPVqCiBGnLWX2dV /pdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=S2ALH10CiIJ9QarbU1oFFB9yUYMcWtOsqvnVKD2phWs=; b=WFANLAclSp73z8yTRlgD6LfDcd9NyNfDHi/kBYarvyNEfMTQO2Z3Rf8NcnysgicjuZ eDdsmXxhs5Sh6kuIS2BthdpfRxpjbxXeDWy9oQH4/2QLJz1ss2yQSiRgDSVqBVaU6Wn8 XhvRNvnNMbgqCjzXe29ceriFwh1QZVo9BNovz3+xrIqmK2JRoTLHIfCM570/gp7RAiko lbp+vJBVYs4lg8vBNf0T1Jf3gOMqyGqf2TIGFGErj69GG5BSEbNfsXMuT2kLvr8b0NLD vrbHEvR9qYnduMOwu5SSXVWU/Hhbh0j/CgF7BFQKM/CAz1YasEJBaNNv4milAzUlvUx4 jC6Q== X-Gm-Message-State: AJIora/pgPacL7kBJxdxtJ5JaReS+tuY37VamuyUBRhQPlcaPlkHR78U btB9ls780aBlrxmzRQinT00= X-Google-Smtp-Source: AGRyM1v8CXE6gypzs36wg8Rh/T42PFlavrif+6TTtAf/MYaXBleCdFPsSq11fHsVxknSlLyhqjDIcA== X-Received: by 2002:a17:902:ab87:b0:16a:82a9:feb7 with SMTP id f7-20020a170902ab8700b0016a82a9feb7mr8011328plr.37.1656466869173; Tue, 28 Jun 2022 18:41:09 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:46a:3e21:914b:bb3e:3e56:4806]) by smtp.gmail.com with ESMTPSA id u15-20020aa7838f000000b0052592a8ef62sm7182965pfm.110.2022.06.28.18.41.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jun 2022 18:41:08 -0700 (PDT) From: cy_huang To: broonie@kernel.org Cc: lgirdwood@gmail.com, matthias.bgg@gmail.com, chiaen_wu@richtek.com, alice_chen@richtek.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, ChiYuan Huang Subject: [PATCH 1/2] regulator: mt6370: Use 'fwnode_gpiod_get_index' to fix gpio parsing Date: Wed, 29 Jun 2022 09:41:00 +0800 Message-Id: <1656466861-7737-1-git-send-email-u0084500@gmail.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220628_184115_275250_45F6F68F X-CRM114-Status: GOOD ( 12.07 ) 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: ChiYuan Huang From the common binding, 'enable-gpio' or 'enable-gpios' are all well for external 'enable' gpio. 'gpiod_get_from_of_node' only parse the 'enable' property, it need to add the gpio suffix. It's more convenient to use fwnode_gpiod_get_index. Although fwnode parsing is not preferred, but 'of_parse_cb' already can guarantee the callback will only be used by regulator of_node parsing. Signed-off-by: ChiYuan Huang --- drivers/regulator/mt6370-regulator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/mt6370-regulator.c b/drivers/regulator/mt6370-regulator.c index bc356b4..949b2c7 100644 --- a/drivers/regulator/mt6370-regulator.c +++ b/drivers/regulator/mt6370-regulator.c @@ -153,7 +153,8 @@ static int mt6370_of_parse_cb(struct device_node *np, struct gpio_desc *enable_gpio; int ret; - enable_gpio = gpiod_get_from_of_node(np, "enable", 0, GPIOD_OUT_HIGH | + enable_gpio = fwnode_gpiod_get_index(of_fwnode_handle(np), "enable", 0, + GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE, desc->name); if (IS_ERR(enable_gpio)) { From patchwork Wed Jun 29 01:41:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiYuan Huang X-Patchwork-Id: 12899143 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 4A7EEC43334 for ; Wed, 29 Jun 2022 01:42:34 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id: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=gtteVZtelK5o5MVPLG70pYVbJ8x8/ZwtVtS3/ennJCE=; b=jYxkQa3CAwMIXu 29239HVgcy0C0oqo7/0ZBJcQUO7AUUPGUEDIj0tTY6gt7p9b2inFi6Vsyh+PrJ7H+09QdpaKQ9Bhs tGZe6+tzycsMRPk7Cskhg6VK6h+jhtogKpPrgz34xOQhkwiMahUjeqcEZ4UTnp8K0Ag2hdm8gYm2m 22/dsyvmznR83BiVSe+sEe7vH4A9VVarLnUOdGJzAp01+MdEDdDlQvzjCwJvDoA2YNRhJAbkk6YwR Fhae1CY3NIMQzdOdVRwTIc6zkK/GEYXO0/SiJ1puxz9MTypeTXaqL70NRSBDwWST5i80tR1nko99m luur3+D8zle1emsX8PZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6Mht-008wyR-Ki; Wed, 29 Jun 2022 01:41:29 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6Mhg-008wtt-P6; Wed, 29 Jun 2022 01:41:17 +0000 Received: by mail-pf1-x434.google.com with SMTP id 136so8517840pfy.10; Tue, 28 Jun 2022 18:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VPrtKXtq4qyhWu5o6BvIQVhQZeTNkHbfrZBU4KflF1U=; b=hkx13qBdyfwvDRjLf7bPh5cXqfEkjL+9Mp5yt9EbaSpbCItGkXK69DXTcE+WxPlHth 3E3xXl3Oaq3WF+FEox6KG/dTIL/YmVKSSw6qiZ2x/wBq5dbdv75rO6VYh+7oZKd7I8Pv lYX2roR43c+eBF8Wk5PvX3JJwwtB+ElKB7J/BVWLWXtZYc8N2124Poc20XLw08ebY+/q qrQ4wz5FD0HFQLfUGDzk/94yWX17bpcXeWWf4QF3qofkdLB1xmOM/BQwnsAHPB1ww41k TvcxsR42R6wJCii5UkUTuk4dCQU5NvCnzcpUfsq4lnqZ5uoaBpHkPZVrPbQc+1Uqyeew 5wMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VPrtKXtq4qyhWu5o6BvIQVhQZeTNkHbfrZBU4KflF1U=; b=jn4aVi7R5EBvlsFQh6OVAJdcZKZ53EdTRjTSf3D9PonNkxr0iy8DcIDA+Had8XfrQU Rm3rDknThwXu3yJGQIp4lvrvYQjd4WGV93yMdKmmctjwE+2Stmu7k/Ei+Kq4j9+GQ8sc FADhwCpfV9HafETH2FDGkh8aNPLAd7l8NDf7U6ekn32koHWdLZdi0ByJj7XXUusd9VME QicXAKkG0ZRSuoaEXDMDM040TSQBmSnCNvudXOeiaZBzYm5jpHRaPpM25Dnu89KmNgy5 LLQEptmT5axngLVrK/9CFhWu4VyRnjrFUUUEZJSJEJPApREylKqmSgNK0/rGojaqytU/ GTDQ== X-Gm-Message-State: AJIora8XSJjKASpki2KgMe/2RTgId+d2WT+0Rfk588OWndh8n7LpXy49 lNhVq9Vx11kPooXbK6CORsM= X-Google-Smtp-Source: AGRyM1uG6BxKE8W+97XkRAiCdqoSnQSGJ5ap2Q3rJirhPCQLRDuMDEjwijqDdlb2irmBj2SOir0Aig== X-Received: by 2002:a05:6a00:1a48:b0:522:9716:4e0a with SMTP id h8-20020a056a001a4800b0052297164e0amr6478757pfv.22.1656466872983; Tue, 28 Jun 2022 18:41:12 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:46a:3e21:914b:bb3e:3e56:4806]) by smtp.gmail.com with ESMTPSA id u15-20020aa7838f000000b0052592a8ef62sm7182965pfm.110.2022.06.28.18.41.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jun 2022 18:41:12 -0700 (PDT) From: cy_huang To: broonie@kernel.org Cc: lgirdwood@gmail.com, matthias.bgg@gmail.com, chiaen_wu@richtek.com, alice_chen@richtek.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, ChiYuan Huang Subject: [PATCH 2/2] regulator: mt6370: Use the correct header for platform_device_id Date: Wed, 29 Jun 2022 09:41:01 +0800 Message-Id: <1656466861-7737-2-git-send-email-u0084500@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1656466861-7737-1-git-send-email-u0084500@gmail.com> References: <1656466861-7737-1-git-send-email-u0084500@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220628_184116_853620_779FB84B X-CRM114-Status: GOOD ( 11.36 ) 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: ChiYuan Huang 'platform_device_id' struct is defined in 'mod_devicetable.h'. Even 'of.h' also includes this header usage. The 'of.h' cannot be removed due to 'of_match_ptr' function. Signed-off-by: ChiYuan Huang Reviewed-by: AngeloGioacchino Del Regno --- drivers/regulator/mt6370-regulator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/regulator/mt6370-regulator.c b/drivers/regulator/mt6370-regulator.c index 949b2c7..e73f5a4 100644 --- a/drivers/regulator/mt6370-regulator.c +++ b/drivers/regulator/mt6370-regulator.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include