soc.lore.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paweł Anikiel" <pan@semihalf.com>
To: jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com,
	mika.westerberg@linux.intel.com, robh+dt@kernel.org,
	p.zabel@pengutronix.de, arnd@arndb.de, olof@lixom.net,
	soc@kernel.org, dinguyen@kernel.org, p.yadav@ti.com,
	Tudor.Ambarus@microchip.com
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	alexandre.belloni@bootlin.com, sre@kernel.org,
	thunder.leizhen@huawei.com, Jonathan.Cameron@huawei.com,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	ka@semihalf.com, tn@semihalf.com, jam@semihalf.com,
	amstan@google.com, "Paweł Anikiel" <pan@semihalf.com>
Subject: [PATCH v2 3/4] reset: socfpga: add empty driver allowing consumers to probe
Date: Tue,  5 Oct 2021 16:37:47 +0200	[thread overview]
Message-ID: <20211005143748.2471647-4-pan@semihalf.com> (raw)
Message-ID: <20211005143747.DbuXJjyVqQGuiZ84zqR8E7krMYcbgI2hOXzeTz-G9EQ@z> (raw)
In-Reply-To: <20211005143748.2471647-1-pan@semihalf.com>

The early reset driver doesn't ever probe, which causes consuming
devices to be unable to probe. Add an empty driver to set this device
as available, allowing consumers to probe.

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
---
 drivers/reset/reset-socfpga.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/reset/reset-socfpga.c b/drivers/reset/reset-socfpga.c
index 2a72f861f798..8c6492e5693c 100644
--- a/drivers/reset/reset-socfpga.c
+++ b/drivers/reset/reset-socfpga.c
@@ -92,3 +92,29 @@ void __init socfpga_reset_init(void)
 	for_each_matching_node(np, socfpga_early_reset_dt_ids)
 		a10_reset_init(np);
 }
+
+/*
+ * The early driver is problematic, because it doesn't register
+ * itself as a driver. This causes certain device links to prevent
+ * consumer devices from probing. The hacky solution is to register
+ * an empty driver, whose only job is to attach itself to the reset
+ * manager and call probe.
+ */
+static const struct of_device_id socfpga_reset_dt_ids[] = {
+	{ .compatible = "altr,rst-mgr", },
+	{ /* sentinel */ },
+};
+
+static int reset_simple_probe(struct platform_device *pdev)
+{
+	return 0;
+}
+
+static struct platform_driver reset_socfpga_driver = {
+	.probe	= reset_simple_probe,
+	.driver = {
+		.name		= "socfpga-reset",
+		.of_match_table	= socfpga_reset_dt_ids,
+	},
+};
+builtin_platform_driver(reset_socfpga_driver);
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-10-05 14:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20211005143744.Ya-FNxPYj6F7VrdWeF9qPn7E8MK-ZAw5BpQ_41CqBLY@z>
2021-10-05 14:37 ` [PATCH v2 0/4] Add support for the Mercury+ AA1 module Paweł Anikiel
     [not found]   ` <20211005143745.KzSPsixDL4qG7NmMnTdV7Cu5_ERt2hASRD4vxiWs0nw@z>
2021-10-05 14:37     ` [PATCH v2 1/4] i2c: check bus number property in DesignWare I2C Controller Paweł Anikiel
     [not found]       ` <20211005161957.T5wmze4erQwVaJ_Qz6HuYpG-tazZVAsCNsrUKO-yStE@z>
2021-10-05 16:19         ` Andy Shevchenko
     [not found]   ` <20211005143746.xE5rCkt-P_XlNkn9bJ8ZqYPY4nQQ7doqzSd4FrAlICY@z>
2021-10-05 14:37     ` [PATCH v2 2/4] dt-bindings: add bus number property Paweł Anikiel
     [not found]       ` <20211005162212.TBayj1cRWFPMW12JtO9UGqTBB0s8Z9dPi6yMlWIFDu4@z>
2021-10-05 16:22         ` Arnd Bergmann
2021-10-05 16:22           ` Arnd Bergmann
     [not found]           ` <20211005162816.BPDIv2pF16bxw77sA5vfuNPngDocmoVgJebhwWNW2TA@z>
2021-10-05 16:28             ` Alexandre Belloni
2021-10-06  9:21               ` Paweł Anikiel
     [not found]                 ` <20211006094117.AQee7MSq4c78svBS2Xfh4K4zh5TGQHOfUAbB4byqcCc@z>
2021-10-06  9:41                   ` Arnd Bergmann
2021-10-06  9:41                     ` Arnd Bergmann
     [not found]               ` <20211006092903.A-w9OTOPZGWXPAJIqh-5D8g9oKE98CQ5F_LqTxvtFXQ@z>
2021-10-06  9:29                 ` Paweł Anikiel
2021-10-06  9:29                   ` Paweł Anikiel
     [not found]     ` <20211014164648.M1uKnzcw4t5Jv7OPB9trVkB5i-AW_cXSVgUekIUW13c@z>
2021-10-14 16:46       ` Rob Herring
     [not found]   ` <20211005143747.DbuXJjyVqQGuiZ84zqR8E7krMYcbgI2hOXzeTz-G9EQ@z>
2021-10-05 14:37     ` Paweł Anikiel [this message]
     [not found]   ` <20211005143748.I4_BMbwCzbJqDZM7MjSm0kkCQvrzHpNje3IF2f1tyyo@z>
2021-10-05 14:37     ` [PATCH v2 4/4] dts: socfpga: Add Mercury+ AA1 devicetree Paweł Anikiel

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=20211005143748.2471647-4-pan@semihalf.com \
    --to=pan@semihalf.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=Tudor.Ambarus@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=amstan@google.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dinguyen@kernel.org \
    --cc=jam@semihalf.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=ka@semihalf.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=olof@lixom.net \
    --cc=p.yadav@ti.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=soc@kernel.org \
    --cc=sre@kernel.org \
    --cc=thunder.leizhen@huawei.com \
    --cc=tn@semihalf.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).