linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Jeffery <andrew@aj.id.au>
To: openipmi-developer@lists.sourceforge.net,
	openbmc@lists.ozlabs.org, minyard@acm.org
Cc: "Chia-Wei, Wang" <chiawei_wang@aspeedtech.com>,
	robh+dt@kernel.org, joel@jms.id.au, lee.jones@linaro.org,
	avifishman70@gmail.com, tmaimon77@gmail.com,
	tali.perry1@gmail.com, venture@google.com, yuenn@google.com,
	benjaminfair@google.com, linus.walleij@linaro.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-aspeed@lists.ozlabs.org, linux-gpio@vger.kernel.org
Subject: [PATCH 04/19] pinctrl: aspeed-g5: Adapt to new LPC device tree layout
Date: Sat, 20 Feb 2021 00:55:08 +1030	[thread overview]
Message-ID: <20210219142523.3464540-5-andrew@aj.id.au> (raw)
In-Reply-To: <20210219142523.3464540-1-andrew@aj.id.au>

From: "Chia-Wei, Wang" <chiawei_wang@aspeedtech.com>

Add check against LPC device v2 compatible string to
ensure that the fixed device tree layout is adopted.
The LPC register offsets are also fixed accordingly.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Tested-by: Andrew Jeffery <andrew@aj.id.au>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c b/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
index 0cab4c2576e2..996ebcba4d38 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
@@ -60,7 +60,7 @@
 #define COND2		{ ASPEED_IP_SCU, SCU94, GENMASK(1, 0), 0, 0 }
 
 /* LHCR0 is offset from the end of the H8S/2168-compatible registers */
-#define LHCR0		0x20
+#define LHCR0		0xa0
 #define GFX064		0x64
 
 #define B14 0
@@ -2648,14 +2648,19 @@ static struct regmap *aspeed_g5_acquire_regmap(struct aspeed_pinmux_data *ctx,
 	}
 
 	if (ip == ASPEED_IP_LPC) {
-		struct device_node *node;
+		struct device_node *np;
 		struct regmap *map;
 
-		node = of_parse_phandle(ctx->dev->of_node,
+		np = of_parse_phandle(ctx->dev->of_node,
 					"aspeed,external-nodes", 1);
-		if (node) {
-			map = syscon_node_to_regmap(node->parent);
-			of_node_put(node);
+		if (np) {
+			if (!of_device_is_compatible(np->parent, "aspeed,ast2400-lpc-v2") &&
+			    !of_device_is_compatible(np->parent, "aspeed,ast2500-lpc-v2") &&
+			    !of_device_is_compatible(np->parent, "aspeed,ast2600-lpc-v2"))
+				return ERR_PTR(-ENODEV);
+
+			map = syscon_node_to_regmap(np->parent);
+			of_node_put(np);
 			if (IS_ERR(map))
 				return map;
 		} else
-- 
2.27.0


  parent reply	other threads:[~2021-02-19 14:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-19 14:25 [PATCH 00/19] ipmi: Allow raw access to KCS devices Andrew Jeffery
2021-02-19 14:25 ` [PATCH 01/19] dt-bindings: aspeed-lpc: Remove LPC partitioning Andrew Jeffery
2021-02-22  9:04   ` Lee Jones
2021-02-19 14:25 ` [PATCH 02/19] ARM: dts: Remove LPC BMC and Host partitions Andrew Jeffery
2021-02-19 14:25 ` [PATCH 03/19] ipmi: kcs: aspeed: Adapt to new LPC DTS layout Andrew Jeffery
2021-02-19 14:25 ` Andrew Jeffery [this message]
2021-02-19 14:25 ` [PATCH 05/19] soc: aspeed: Adapt to new LPC device tree layout Andrew Jeffery
2021-02-19 14:25 ` [PATCH 06/19] ipmi: kcs_bmc_aspeed: Use of match data to extract KCS properties Andrew Jeffery
2021-02-19 14:25 ` [PATCH 07/19] ipmi: kcs_bmc: Make status update atomic Andrew Jeffery
2021-02-19 14:25 ` [PATCH 08/19] ipmi: kcs_bmc: Rename {read,write}_{status,data}() functions Andrew Jeffery
2021-02-19 14:25 ` [PATCH 09/19] ipmi: kcs_bmc: Split out kcs_bmc_cdev_ipmi Andrew Jeffery
2021-02-19 14:25 ` [PATCH 10/19] ipmi: kcs_bmc: Turn the driver data-structures inside-out Andrew Jeffery
2021-02-19 14:25 ` [PATCH 11/19] ipmi: kcs_bmc: Split headers into device and client Andrew Jeffery
2021-02-19 14:25 ` [PATCH 12/19] ipmi: kcs_bmc: Strip private client data from struct kcs_bmc Andrew Jeffery
2021-02-19 14:25 ` [PATCH 13/19] ipmi: kcs_bmc: Decouple the IPMI chardev from the core Andrew Jeffery
2021-02-19 14:25 ` [PATCH 14/19] ipmi: kcs_bmc: Allow clients to control KCS IRQ state Andrew Jeffery
2021-02-19 14:25 ` [PATCH 15/19] ipmi: kcs_bmc: Add a "raw" character device interface Andrew Jeffery
2021-02-19 14:25 ` [PATCH 16/19] dt-bindings: ipmi: Convert ASPEED KCS binding to schema Andrew Jeffery
2021-03-05 23:07   ` Rob Herring
2021-03-09  2:45     ` Andrew Jeffery
2021-02-19 14:25 ` [PATCH 17/19] dt-bindings: ipmi: Add optional SerIRQ property to ASPEED KCS devices Andrew Jeffery
2021-03-05 23:09   ` Rob Herring
2021-03-09  2:44     ` Andrew Jeffery
2021-02-19 14:25 ` [PATCH 18/19] ipmi: kcs_bmc_aspeed: Implement KCS SerIRQ configuration Andrew Jeffery
2021-02-19 14:25 ` [PATCH 19/19] ipmi: kcs_bmc_aspeed: Fix IBFIE typo from datasheet Andrew Jeffery

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210219142523.3464540-5-andrew@aj.id.au \
    --to=andrew@aj.id.au \
    --cc=avifishman70@gmail.com \
    --cc=benjaminfair@google.com \
    --cc=chiawei_wang@aspeedtech.com \
    --cc=devicetree@vger.kernel.org \
    --cc=joel@jms.id.au \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minyard@acm.org \
    --cc=openbmc@lists.ozlabs.org \
    --cc=openipmi-developer@lists.sourceforge.net \
    --cc=robh+dt@kernel.org \
    --cc=tali.perry1@gmail.com \
    --cc=tmaimon77@gmail.com \
    --cc=venture@google.com \
    --cc=yuenn@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).