openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Zev Weiss <zev@bewilderbeest.net>
To: Joel Stanley <joel@jms.id.au>
Cc: linux-aspeed@lists.ozlabs.org, Zev Weiss <zev@bewilderbeest.net>,
	Andrew Jeffery <andrew@aj.id.au>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Josh Triplett <josh@joshtriplett.org>,
	"Alexander A. Klimov" <grandmaster@al2klimov.de>,
	linux-serial@vger.kernel.org, Jiri Slaby <jirislaby@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] drivers/tty/serial/8250: simplify Aspeed VUART SIRQ polarity DT config
Date: Mon, 29 Mar 2021 19:23:36 -0500	[thread overview]
Message-ID: <20210330002338.335-2-zev@bewilderbeest.net> (raw)
In-Reply-To: <20210330002338.335-1-zev@bewilderbeest.net>

The initial implementation of this configuration conflated the SIRQ
polarity setting with the syscon eSPI/LPC strapping; this patch
disentangles them by reducing the DT config to a simple boolean.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
---
 drivers/tty/serial/8250/8250_aspeed_vuart.c | 39 ++-------------------
 drivers/tty/serial/8250/Kconfig             |  1 -
 2 files changed, 2 insertions(+), 38 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c
index c33e02cbde93..b9b5fa58ab28 100644
--- a/drivers/tty/serial/8250/8250_aspeed_vuart.c
+++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c
@@ -10,8 +10,6 @@
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
-#include <linux/regmap.h>
-#include <linux/mfd/syscon.h>
 #include <linux/tty.h>
 #include <linux/tty_flip.h>
 #include <linux/clk.h>
@@ -346,30 +344,8 @@ static int aspeed_vuart_handle_irq(struct uart_port *port)
 	return 1;
 }
 
-static void aspeed_vuart_auto_configure_sirq_polarity(
-	struct aspeed_vuart *vuart, struct device_node *syscon_np,
-	u32 reg_offset, u32 reg_mask)
-{
-	struct regmap *regmap;
-	u32 value;
-
-	regmap = syscon_node_to_regmap(syscon_np);
-	if (IS_ERR(regmap)) {
-		dev_warn(vuart->dev,
-			 "could not get regmap for aspeed,sirq-polarity-sense\n");
-		return;
-	}
-	if (regmap_read(regmap, reg_offset, &value)) {
-		dev_warn(vuart->dev, "could not read hw strap table\n");
-		return;
-	}
-
-	aspeed_vuart_set_sirq_polarity(vuart, (value & reg_mask) == 0);
-}
-
 static int aspeed_vuart_probe(struct platform_device *pdev)
 {
-	struct of_phandle_args sirq_polarity_sense_args;
 	struct uart_8250_port port;
 	struct aspeed_vuart *vuart;
 	struct device_node *np;
@@ -468,19 +444,8 @@ static int aspeed_vuart_probe(struct platform_device *pdev)
 
 	vuart->line = rc;
 
-	rc = of_parse_phandle_with_fixed_args(
-		np, "aspeed,sirq-polarity-sense", 2, 0,
-		&sirq_polarity_sense_args);
-	if (rc < 0) {
-		dev_dbg(&pdev->dev,
-			"aspeed,sirq-polarity-sense property not found\n");
-	} else {
-		aspeed_vuart_auto_configure_sirq_polarity(
-			vuart, sirq_polarity_sense_args.np,
-			sirq_polarity_sense_args.args[0],
-			BIT(sirq_polarity_sense_args.args[1]));
-		of_node_put(sirq_polarity_sense_args.np);
-	}
+	if (of_property_read_bool(np, "aspeed,sirq-active-high"))
+		aspeed_vuart_set_sirq_polarity(vuart, 1);
 
 	aspeed_vuart_set_enabled(vuart, true);
 	aspeed_vuart_set_host_tx_discard(vuart, true);
diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
index 603137da4736..105a325bcdd1 100644
--- a/drivers/tty/serial/8250/Kconfig
+++ b/drivers/tty/serial/8250/Kconfig
@@ -254,7 +254,6 @@ config SERIAL_8250_ASPEED_VUART
 	tristate "Aspeed Virtual UART"
 	depends on SERIAL_8250
 	depends on OF
-	depends on REGMAP && MFD_SYSCON
 	help
 	  If you want to use the virtual UART (VUART) device on Aspeed
 	  BMC platforms, enable this option. This enables the 16550A-
-- 
2.31.1


  reply	other threads:[~2021-03-30  0:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30  0:23 [PATCH 0/3] simplify Aspeed VUART SIRQ polarity DT config, add e3c246d4i BMC dts Zev Weiss
2021-03-30  0:23 ` Zev Weiss [this message]
2021-03-30  0:23 ` [PATCH 2/3] dt-bindings: serial: 8250: update for aspeed, sirq-active-high Zev Weiss
2021-03-30 22:39   ` [PATCH 2/3] dt-bindings: serial: 8250: update for aspeed,sirq-active-high Rob Herring
2021-03-30 23:04     ` Zev Weiss
2021-04-01  0:56       ` [PATCH v2 0/3] simplify Aspeed VUART SIRQ polarity DT config Zev Weiss
2021-04-01  0:57         ` [PATCH v2 1/3] dt-bindings: serial: 8250: deprecate aspeed, sirq-polarity-sense Zev Weiss
2021-04-01  3:53           ` Joel Stanley
2021-04-01  0:57         ` [PATCH v2 2/3] drivers/tty/serial/8250: add DT property for aspeed vuart sirq polarity Zev Weiss
2021-04-01  4:15           ` Joel Stanley
2021-04-01  5:18             ` Zev Weiss
2021-04-01  5:34               ` Andrew Jeffery
2021-04-01  7:36                 ` Zev Weiss
2021-04-01  0:57         ` [PATCH v2 3/3] dt-bindings: serial: 8250: add aspeed, sirq-active-high Zev Weiss
2021-04-01  4:04           ` Andrew Jeffery
2021-04-01  4:57             ` [PATCH v2 3/3] dt-bindings: serial: 8250: add aspeed,sirq-active-high Zev Weiss
2021-04-01 14:56           ` [PATCH v2 3/3] dt-bindings: serial: 8250: add aspeed, sirq-active-high Rob Herring
2021-03-30 23:26     ` [PATCH 2/3] dt-bindings: serial: 8250: update for " Joel Stanley
2021-03-30  0:23 ` [PATCH 3/3] ARM: dts: aspeed: add ASRock E3C246D4I BMC Zev Weiss
2021-03-31  7:41   ` Joel Stanley
2021-03-31  7:43     ` Joel Stanley
2021-03-31  7:50     ` Joel Stanley
2021-04-01  2:51       ` [PATCH] " Zev Weiss
2021-04-01  3:51         ` Joel Stanley
2021-04-01  4:09           ` Zev Weiss
2021-04-01  0:04   ` [PATCH 3/3] " Andrew Jeffery
2021-04-01  0:26     ` Zev Weiss

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=20210330002338.335-2-zev@bewilderbeest.net \
    --to=zev@bewilderbeest.net \
    --cc=andrew@aj.id.au \
    --cc=grandmaster@al2klimov.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=joel@jms.id.au \
    --cc=josh@joshtriplett.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=openbmc@lists.ozlabs.org \
    --subject='Re: [PATCH 1/3] drivers/tty/serial/8250: simplify Aspeed VUART SIRQ polarity DT config' \
    /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

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).