Re: [PATCH 1/2] clk: sunxi-ng: Provide a default reset hook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



在 2017-08-25 17:49,Maxime Ripard 写道:
The reset hook was left implemented. Provide a dumb implementation so that
client drivers can depend on it.

I think some clients should also convert to use this.

For example:

- The TCON driver in sun4i-drm. (It now uses reset_control_status, but
  this is also not implemented in CCU.)
- The EPHY in dwmac-sun8i driver. (It uses explicit assert then deassert)

P.S. maybe the status hook should also be implemented?


Signed-off-by: Maxime Ripard <maxime.ripard@xxxxxxxxxxxxxxxxxx>
---
 drivers/clk/sunxi-ng/ccu_reset.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/clk/sunxi-ng/ccu_reset.c b/drivers/clk/sunxi-ng/ccu_reset.c
index 6c31d48783a7..1dc4e98ea802 100644
--- a/drivers/clk/sunxi-ng/ccu_reset.c
+++ b/drivers/clk/sunxi-ng/ccu_reset.c
@@ -8,6 +8,7 @@
  * the License, or (at your option) any later version.
  */

+#include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/reset-controller.h>

@@ -49,7 +50,18 @@ static int ccu_reset_deassert(struct
reset_controller_dev *rcdev,
 	return 0;
 }

+static int ccu_reset_reset(struct reset_controller_dev *rcdev,
+			   unsigned long id)
+{
+	ccu_reset_assert(rcdev, id);
+	udelay(10);
+	ccu_reset_deassert(rcdev, id);
+
+	return 0;
+}
+
 const struct reset_control_ops ccu_reset_ops = {
 	.assert		= ccu_reset_assert,
 	.deassert	= ccu_reset_deassert,
+	.reset		= ccu_reset_reset,
 };
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux