linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
To: linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
	p.zabel@pengutronix.de
Cc: linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org,
	vkoul@kernel.org, kishon@ti.com, rtanwar@maxlinear.com,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Subject: [PATCH v1 8/9] reset: lantiq: Remove driver as it has been replaced by reset-intel-gw
Date: Tue, 28 Jun 2022 14:44:40 +0200	[thread overview]
Message-ID: <20220628124441.2385023-9-martin.blumenstingl@googlemail.com> (raw)
In-Reply-To: <20220628124441.2385023-1-martin.blumenstingl@googlemail.com>

Now that we have replaced the reset-lantiq driver with the
reset-intel-gw driver we can remove the old code.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 drivers/reset/Kconfig        |   6 -
 drivers/reset/Makefile       |   1 -
 drivers/reset/reset-lantiq.c | 210 -----------------------------------
 3 files changed, 217 deletions(-)
 delete mode 100644 drivers/reset/reset-lantiq.c

diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
index fb49c465078f..22e28f5cf154 100644
--- a/drivers/reset/Kconfig
+++ b/drivers/reset/Kconfig
@@ -103,12 +103,6 @@ config RESET_K210
 	  Say Y if you want to control reset signals provided by this
 	  controller.
 
-config RESET_LANTIQ
-	bool "Lantiq XWAY Reset Driver" if COMPILE_TEST
-	default SOC_TYPE_XWAY
-	help
-	  This enables the reset controller driver for Lantiq / Intel XWAY SoCs.
-
 config RESET_LPC18XX
 	bool "LPC18xx/43xx Reset Driver" if COMPILE_TEST
 	default ARCH_LPC18XX
diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
index a80a9c4008a7..9cb37e7890f1 100644
--- a/drivers/reset/Makefile
+++ b/drivers/reset/Makefile
@@ -14,7 +14,6 @@ obj-$(CONFIG_RESET_HSDK) += reset-hsdk.o
 obj-$(CONFIG_RESET_IMX7) += reset-imx7.o
 obj-$(CONFIG_RESET_INTEL_GW) += reset-intel-gw.o
 obj-$(CONFIG_RESET_K210) += reset-k210.o
-obj-$(CONFIG_RESET_LANTIQ) += reset-lantiq.o
 obj-$(CONFIG_RESET_LPC18XX) += reset-lpc18xx.o
 obj-$(CONFIG_RESET_MCHP_SPARX5) += reset-microchip-sparx5.o
 obj-$(CONFIG_RESET_MESON) += reset-meson.o
diff --git a/drivers/reset/reset-lantiq.c b/drivers/reset/reset-lantiq.c
deleted file mode 100644
index b936cfe85641..000000000000
--- a/drivers/reset/reset-lantiq.c
+++ /dev/null
@@ -1,210 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- *
- *  Copyright (C) 2010 John Crispin <blogic@phrozen.org>
- *  Copyright (C) 2013-2015 Lantiq Beteiligungs-GmbH & Co.KG
- *  Copyright (C) 2016 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
- *  Copyright (C) 2017 Hauke Mehrtens <hauke@hauke-m.de>
- */
-
-#include <linux/mfd/syscon.h>
-#include <linux/module.h>
-#include <linux/regmap.h>
-#include <linux/reset-controller.h>
-#include <linux/of_address.h>
-#include <linux/of_platform.h>
-#include <linux/platform_device.h>
-#include <linux/property.h>
-
-#define LANTIQ_RCU_RESET_TIMEOUT	10000
-
-struct lantiq_rcu_reset_priv {
-	struct reset_controller_dev rcdev;
-	struct device *dev;
-	struct regmap *regmap;
-	u32 reset_offset;
-	u32 status_offset;
-};
-
-static struct lantiq_rcu_reset_priv *to_lantiq_rcu_reset_priv(
-	struct reset_controller_dev *rcdev)
-{
-	return container_of(rcdev, struct lantiq_rcu_reset_priv, rcdev);
-}
-
-static int lantiq_rcu_reset_status(struct reset_controller_dev *rcdev,
-				   unsigned long id)
-{
-	struct lantiq_rcu_reset_priv *priv = to_lantiq_rcu_reset_priv(rcdev);
-	unsigned int status = (id >> 8) & 0x1f;
-	u32 val;
-	int ret;
-
-	ret = regmap_read(priv->regmap, priv->status_offset, &val);
-	if (ret)
-		return ret;
-
-	return !!(val & BIT(status));
-}
-
-static int lantiq_rcu_reset_status_timeout(struct reset_controller_dev *rcdev,
-					   unsigned long id, bool assert)
-{
-	int ret;
-	int retry = LANTIQ_RCU_RESET_TIMEOUT;
-
-	do {
-		ret = lantiq_rcu_reset_status(rcdev, id);
-		if (ret < 0)
-			return ret;
-		if (ret == assert)
-			return 0;
-		usleep_range(20, 40);
-	} while (--retry);
-
-	return -ETIMEDOUT;
-}
-
-static int lantiq_rcu_reset_update(struct reset_controller_dev *rcdev,
-				   unsigned long id, bool assert)
-{
-	struct lantiq_rcu_reset_priv *priv = to_lantiq_rcu_reset_priv(rcdev);
-	unsigned int set = id & 0x1f;
-	u32 val = assert ? BIT(set) : 0;
-	int ret;
-
-	ret = regmap_update_bits(priv->regmap, priv->reset_offset, BIT(set),
-				 val);
-	if (ret) {
-		dev_err(priv->dev, "Failed to set reset bit %u\n", set);
-		return ret;
-	}
-
-
-	ret = lantiq_rcu_reset_status_timeout(rcdev, id, assert);
-	if (ret)
-		dev_err(priv->dev, "Failed to %s bit %u\n",
-			assert ? "assert" : "deassert", set);
-
-	return ret;
-}
-
-static int lantiq_rcu_reset_assert(struct reset_controller_dev *rcdev,
-			     unsigned long id)
-{
-	return lantiq_rcu_reset_update(rcdev, id, true);
-}
-
-static int lantiq_rcu_reset_deassert(struct reset_controller_dev *rcdev,
-			       unsigned long id)
-{
-	return lantiq_rcu_reset_update(rcdev, id, false);
-}
-
-static int lantiq_rcu_reset_reset(struct reset_controller_dev *rcdev,
-			    unsigned long id)
-{
-	int ret;
-
-	ret = lantiq_rcu_reset_assert(rcdev, id);
-	if (ret)
-		return ret;
-
-	return lantiq_rcu_reset_deassert(rcdev, id);
-}
-
-static const struct reset_control_ops lantiq_rcu_reset_ops = {
-	.assert = lantiq_rcu_reset_assert,
-	.deassert = lantiq_rcu_reset_deassert,
-	.status = lantiq_rcu_reset_status,
-	.reset	= lantiq_rcu_reset_reset,
-};
-
-static int lantiq_rcu_reset_of_parse(struct platform_device *pdev,
-			       struct lantiq_rcu_reset_priv *priv)
-{
-	struct device *dev = &pdev->dev;
-	const __be32 *offset;
-
-	priv->regmap = syscon_node_to_regmap(dev->of_node->parent);
-	if (IS_ERR(priv->regmap)) {
-		dev_err(&pdev->dev, "Failed to lookup RCU regmap\n");
-		return PTR_ERR(priv->regmap);
-	}
-
-	offset = of_get_address(dev->of_node, 0, NULL, NULL);
-	if (!offset) {
-		dev_err(&pdev->dev, "Failed to get RCU reset offset\n");
-		return -ENOENT;
-	}
-	priv->reset_offset = __be32_to_cpu(*offset);
-
-	offset = of_get_address(dev->of_node, 1, NULL, NULL);
-	if (!offset) {
-		dev_err(&pdev->dev, "Failed to get RCU status offset\n");
-		return -ENOENT;
-	}
-	priv->status_offset = __be32_to_cpu(*offset);
-
-	return 0;
-}
-
-static int lantiq_rcu_reset_xlate(struct reset_controller_dev *rcdev,
-				  const struct of_phandle_args *reset_spec)
-{
-	unsigned int status, set;
-
-	set = reset_spec->args[0];
-	status = reset_spec->args[1];
-
-	if (set >= rcdev->nr_resets || status >= rcdev->nr_resets)
-		return -EINVAL;
-
-	return (status << 8) | set;
-}
-
-static int lantiq_rcu_reset_probe(struct platform_device *pdev)
-{
-	struct lantiq_rcu_reset_priv *priv;
-	int err;
-
-	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
-	if (!priv)
-		return -ENOMEM;
-
-	priv->dev = &pdev->dev;
-	platform_set_drvdata(pdev, priv);
-
-	err = lantiq_rcu_reset_of_parse(pdev, priv);
-	if (err)
-		return err;
-
-	priv->rcdev.ops = &lantiq_rcu_reset_ops;
-	priv->rcdev.owner = THIS_MODULE;
-	priv->rcdev.of_node = pdev->dev.of_node;
-	priv->rcdev.nr_resets = 32;
-	priv->rcdev.of_xlate = lantiq_rcu_reset_xlate;
-	priv->rcdev.of_reset_n_cells = 2;
-
-	return devm_reset_controller_register(&pdev->dev, &priv->rcdev);
-}
-
-static const struct of_device_id lantiq_rcu_reset_dt_ids[] = {
-	{ .compatible = "lantiq,danube-reset", },
-	{ .compatible = "lantiq,xrx200-reset", },
-	{ },
-};
-MODULE_DEVICE_TABLE(of, lantiq_rcu_reset_dt_ids);
-
-static struct platform_driver lantiq_rcu_reset_driver = {
-	.probe	= lantiq_rcu_reset_probe,
-	.driver = {
-		.name		= "lantiq-reset",
-		.of_match_table	= lantiq_rcu_reset_dt_ids,
-	},
-};
-module_platform_driver(lantiq_rcu_reset_driver);
-
-MODULE_AUTHOR("Martin Blumenstingl <martin.blumenstingl@googlemail.com>");
-MODULE_DESCRIPTION("Lantiq XWAY RCU Reset Controller Driver");
-MODULE_LICENSE("GPL");
-- 
2.36.1


  parent reply	other threads:[~2022-06-28 12:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 12:44 [PATCH v1 0/9] reset: replace reset-lantiq with reset-intel-gw Martin Blumenstingl
2022-06-28 12:44 ` [PATCH v1 1/9] dt-bindings: phy: lantiq: xway-rcu-usb2-phy: Convert to YAML Martin Blumenstingl
2022-07-01 16:25   ` Rob Herring
2022-06-28 12:44 ` [PATCH v1 2/9] dt-bindings: reset: intel,rcu-gw: Allow up to three global reset items Martin Blumenstingl
2022-07-01 16:26   ` Rob Herring
2022-06-28 12:44 ` [PATCH v1 3/9] dt-bindings: reset: intel,rcu-gw: Update bindings for "legacy" SoCs Martin Blumenstingl
2022-07-01 16:33   ` Rob Herring
2022-07-02 23:04     ` Martin Blumenstingl
2022-07-12 15:21       ` Rob Herring
2022-06-28 12:44 ` [PATCH v1 4/9] dt-bindings: mips: lantiq: rcu: Remove binding documentation Martin Blumenstingl
2022-07-01 16:34   ` Rob Herring
2022-06-28 12:44 ` [PATCH v1 5/9] reset: intel: Allow enabling the driver on "LANTIQ" (MIPS) platforms Martin Blumenstingl
2022-06-28 12:44 ` [PATCH v1 6/9] reset: intel: Add and update compatible strings Lantiq SoCs Martin Blumenstingl
2022-06-28 12:44 ` [PATCH v1 7/9] reset: intel: Use syscon_node_to_regmap on legacy SoCs Martin Blumenstingl
2022-06-28 12:44 ` Martin Blumenstingl [this message]
2022-06-28 12:44 ` [PATCH v1 9/9] mips: dts: lantiq: Update the RCU node to match the intel,rcu-gw binding Martin Blumenstingl

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=20220628124441.2385023-9-martin.blumenstingl@googlemail.com \
    --to=martin.blumenstingl@googlemail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=p.zabel@pengutronix.de \
    --cc=rtanwar@maxlinear.com \
    --cc=vkoul@kernel.org \
    /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).