All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/5] clk: ingenic: Add missing header in cgu.h
@ 2019-06-11 18:07 Paul Cercueil
  2019-06-11 18:07 ` [PATCH v2 2/5] clk: ingenic: Handle setting the Low-Power Mode bit Paul Cercueil
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Paul Cercueil @ 2019-06-11 18:07 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan, Michael Turquette, Stephen Boyd
  Cc: od, linux-mips, linux-pm, linux-clk, linux-kernel, Paul Cercueil

The cgu.h has structures that contain 'clk_onecell_data' and 'clk_hw'
structures (no pointers), so the <linux/clk-provider.h> header should be
included.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---

Notes:
    v2: Rebase on v5.2-rc4

 drivers/clk/ingenic/cgu.h         | 1 +
 drivers/clk/ingenic/jz4725b-cgu.c | 1 -
 drivers/clk/ingenic/jz4740-cgu.c  | 1 -
 drivers/clk/ingenic/jz4770-cgu.c  | 1 -
 drivers/clk/ingenic/jz4780-cgu.c  | 1 -
 5 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/clk/ingenic/cgu.h b/drivers/clk/ingenic/cgu.h
index bfbcf6db437d..ef2db1e26e58 100644
--- a/drivers/clk/ingenic/cgu.h
+++ b/drivers/clk/ingenic/cgu.h
@@ -10,6 +10,7 @@
 #define __DRIVERS_CLK_INGENIC_CGU_H__
 
 #include <linux/bitops.h>
+#include <linux/clk-provider.h>
 #include <linux/of.h>
 #include <linux/spinlock.h>
 
diff --git a/drivers/clk/ingenic/jz4725b-cgu.c b/drivers/clk/ingenic/jz4725b-cgu.c
index 8901ea0295b7..6e8bbf620c76 100644
--- a/drivers/clk/ingenic/jz4725b-cgu.c
+++ b/drivers/clk/ingenic/jz4725b-cgu.c
@@ -6,7 +6,6 @@
  * Author: Paul Cercueil <paul@crapouillou.net>
  */
 
-#include <linux/clk-provider.h>
 #include <linux/delay.h>
 #include <linux/of.h>
 #include <dt-bindings/clock/jz4725b-cgu.h>
diff --git a/drivers/clk/ingenic/jz4740-cgu.c b/drivers/clk/ingenic/jz4740-cgu.c
index c77f4e1506dc..2deac19a8d04 100644
--- a/drivers/clk/ingenic/jz4740-cgu.c
+++ b/drivers/clk/ingenic/jz4740-cgu.c
@@ -6,7 +6,6 @@
  * Author: Paul Burton <paul.burton@mips.com>
  */
 
-#include <linux/clk-provider.h>
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/of.h>
diff --git a/drivers/clk/ingenic/jz4770-cgu.c b/drivers/clk/ingenic/jz4770-cgu.c
index dfce740c25a8..42b2ee121642 100644
--- a/drivers/clk/ingenic/jz4770-cgu.c
+++ b/drivers/clk/ingenic/jz4770-cgu.c
@@ -5,7 +5,6 @@
  */
 
 #include <linux/bitops.h>
-#include <linux/clk-provider.h>
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/of.h>
diff --git a/drivers/clk/ingenic/jz4780-cgu.c b/drivers/clk/ingenic/jz4780-cgu.c
index 2464fc4032af..6d524e760180 100644
--- a/drivers/clk/ingenic/jz4780-cgu.c
+++ b/drivers/clk/ingenic/jz4780-cgu.c
@@ -6,7 +6,6 @@
  * Author: Paul Burton <paul.burton@mips.com>
  */
 
-#include <linux/clk-provider.h>
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/of.h>
-- 
2.21.0.593.g511ec345e18


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 2/5] clk: ingenic: Handle setting the Low-Power Mode bit
  2019-06-11 18:07 [PATCH v2 1/5] clk: ingenic: Add missing header in cgu.h Paul Cercueil
@ 2019-06-11 18:07 ` Paul Cercueil
  2019-06-25 22:48   ` Stephen Boyd
  2019-06-11 18:07 ` [PATCH v2 3/5] MIPS: jz4740: PM: Let CGU driver suspend clocks and set sleep mode Paul Cercueil
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Paul Cercueil @ 2019-06-11 18:07 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan, Michael Turquette, Stephen Boyd
  Cc: od, linux-mips, linux-pm, linux-clk, linux-kernel, Paul Cercueil

The Low-Power Mode, when enabled, will make the "wait" MIPS instruction
suspend the system.

This is not really clock-related, but this bit happens to be in the
register set of the CGU.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---

Notes:
    v2: Rebase on v5.2-rc4

 drivers/clk/ingenic/Makefile      |  2 +-
 drivers/clk/ingenic/jz4725b-cgu.c |  3 +++
 drivers/clk/ingenic/jz4740-cgu.c  |  3 +++
 drivers/clk/ingenic/jz4770-cgu.c  | 33 ++---------------------
 drivers/clk/ingenic/jz4780-cgu.c  |  3 +++
 drivers/clk/ingenic/pm.c          | 45 +++++++++++++++++++++++++++++++
 drivers/clk/ingenic/pm.h          | 12 +++++++++
 7 files changed, 69 insertions(+), 32 deletions(-)
 create mode 100644 drivers/clk/ingenic/pm.c
 create mode 100644 drivers/clk/ingenic/pm.h

diff --git a/drivers/clk/ingenic/Makefile b/drivers/clk/ingenic/Makefile
index ab58a6a862a5..250570a809d3 100644
--- a/drivers/clk/ingenic/Makefile
+++ b/drivers/clk/ingenic/Makefile
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
-obj-$(CONFIG_INGENIC_CGU_COMMON)	+= cgu.o
+obj-$(CONFIG_INGENIC_CGU_COMMON)	+= cgu.o pm.o
 obj-$(CONFIG_INGENIC_CGU_JZ4740)	+= jz4740-cgu.o
 obj-$(CONFIG_INGENIC_CGU_JZ4725B)	+= jz4725b-cgu.o
 obj-$(CONFIG_INGENIC_CGU_JZ4770)	+= jz4770-cgu.o
diff --git a/drivers/clk/ingenic/jz4725b-cgu.c b/drivers/clk/ingenic/jz4725b-cgu.c
index 6e8bbf620c76..15055b118a44 100644
--- a/drivers/clk/ingenic/jz4725b-cgu.c
+++ b/drivers/clk/ingenic/jz4725b-cgu.c
@@ -10,6 +10,7 @@
 #include <linux/of.h>
 #include <dt-bindings/clock/jz4725b-cgu.h>
 #include "cgu.h"
+#include "pm.h"
 
 /* CGU register offsets */
 #define CGU_REG_CPCCR		0x00
@@ -226,5 +227,7 @@ static void __init jz4725b_cgu_init(struct device_node *np)
 	retval = ingenic_cgu_register_clocks(cgu);
 	if (retval)
 		pr_err("%s: failed to register CGU Clocks\n", __func__);
+
+	ingenic_cgu_register_syscore_ops(cgu);
 }
 CLK_OF_DECLARE(jz4725b_cgu, "ingenic,jz4725b-cgu", jz4725b_cgu_init);
diff --git a/drivers/clk/ingenic/jz4740-cgu.c b/drivers/clk/ingenic/jz4740-cgu.c
index 2deac19a8d04..efa893ee1de9 100644
--- a/drivers/clk/ingenic/jz4740-cgu.c
+++ b/drivers/clk/ingenic/jz4740-cgu.c
@@ -12,6 +12,7 @@
 #include <dt-bindings/clock/jz4740-cgu.h>
 #include <asm/mach-jz4740/clock.h>
 #include "cgu.h"
+#include "pm.h"
 
 /* CGU register offsets */
 #define CGU_REG_CPCCR		0x00
@@ -218,6 +219,8 @@ static void __init jz4740_cgu_init(struct device_node *np)
 	retval = ingenic_cgu_register_clocks(cgu);
 	if (retval)
 		pr_err("%s: failed to register CGU Clocks\n", __func__);
+
+	ingenic_cgu_register_syscore_ops(cgu);
 }
 CLK_OF_DECLARE(jz4740_cgu, "ingenic,jz4740-cgu", jz4740_cgu_init);
 
diff --git a/drivers/clk/ingenic/jz4770-cgu.c b/drivers/clk/ingenic/jz4770-cgu.c
index 42b2ee121642..12b1f57defb9 100644
--- a/drivers/clk/ingenic/jz4770-cgu.c
+++ b/drivers/clk/ingenic/jz4770-cgu.c
@@ -8,9 +8,9 @@
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/of.h>
-#include <linux/syscore_ops.h>
 #include <dt-bindings/clock/jz4770-cgu.h>
 #include "cgu.h"
+#include "pm.h"
 
 /*
  * CPM registers offset address definition
@@ -37,9 +37,6 @@
 #define CGU_REG_MSC2CDR		0xA8
 #define CGU_REG_BCHCDR		0xAC
 
-/* bits within the LCR register */
-#define LCR_LPM			BIT(0)		/* Low Power Mode */
-
 /* bits within the OPCR register */
 #define OPCR_SPENDH		BIT(5)		/* UHC PHY suspend */
 
@@ -406,30 +403,6 @@ static const struct ingenic_cgu_clk_info jz4770_cgu_clocks[] = {
 	},
 };
 
-#if IS_ENABLED(CONFIG_PM_SLEEP)
-static int jz4770_cgu_pm_suspend(void)
-{
-	u32 val;
-
-	val = readl(cgu->base + CGU_REG_LCR);
-	writel(val | LCR_LPM, cgu->base + CGU_REG_LCR);
-	return 0;
-}
-
-static void jz4770_cgu_pm_resume(void)
-{
-	u32 val;
-
-	val = readl(cgu->base + CGU_REG_LCR);
-	writel(val & ~LCR_LPM, cgu->base + CGU_REG_LCR);
-}
-
-static struct syscore_ops jz4770_cgu_pm_ops = {
-	.suspend = jz4770_cgu_pm_suspend,
-	.resume = jz4770_cgu_pm_resume,
-};
-#endif /* CONFIG_PM_SLEEP */
-
 static void __init jz4770_cgu_init(struct device_node *np)
 {
 	int retval;
@@ -443,9 +416,7 @@ static void __init jz4770_cgu_init(struct device_node *np)
 	if (retval)
 		pr_err("%s: failed to register CGU Clocks\n", __func__);
 
-#if IS_ENABLED(CONFIG_PM_SLEEP)
-	register_syscore_ops(&jz4770_cgu_pm_ops);
-#endif
+	ingenic_cgu_register_syscore_ops(cgu);
 }
 
 /* We only probe via devicetree, no need for a platform driver */
diff --git a/drivers/clk/ingenic/jz4780-cgu.c b/drivers/clk/ingenic/jz4780-cgu.c
index 6d524e760180..afd7e9bd4fc4 100644
--- a/drivers/clk/ingenic/jz4780-cgu.c
+++ b/drivers/clk/ingenic/jz4780-cgu.c
@@ -11,6 +11,7 @@
 #include <linux/of.h>
 #include <dt-bindings/clock/jz4780-cgu.h>
 #include "cgu.h"
+#include "pm.h"
 
 /* CGU register offsets */
 #define CGU_REG_CLOCKCONTROL	0x00
@@ -720,5 +721,7 @@ static void __init jz4780_cgu_init(struct device_node *np)
 		pr_err("%s: failed to register CGU Clocks\n", __func__);
 		return;
 	}
+
+	ingenic_cgu_register_syscore_ops(cgu);
 }
 CLK_OF_DECLARE(jz4780_cgu, "ingenic,jz4780-cgu", jz4780_cgu_init);
diff --git a/drivers/clk/ingenic/pm.c b/drivers/clk/ingenic/pm.c
new file mode 100644
index 000000000000..341752b640d2
--- /dev/null
+++ b/drivers/clk/ingenic/pm.c
@@ -0,0 +1,45 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2019 Paul Cercueil <paul@crapouillou.net>
+ */
+
+#include "cgu.h"
+#include "pm.h"
+
+#include <linux/io.h>
+#include <linux/syscore_ops.h>
+
+#define CGU_REG_LCR		0x04
+
+#define LCR_LOW_POWER_MODE	BIT(0)
+
+static void __iomem * __maybe_unused ingenic_cgu_base;
+
+static int __maybe_unused ingenic_cgu_pm_suspend(void)
+{
+	u32 val = readl(ingenic_cgu_base + CGU_REG_LCR);
+
+	writel(val | LCR_LOW_POWER_MODE, ingenic_cgu_base + CGU_REG_LCR);
+
+	return 0;
+}
+
+static void __maybe_unused ingenic_cgu_pm_resume(void)
+{
+	u32 val = readl(ingenic_cgu_base + CGU_REG_LCR);
+
+	writel(val & ~LCR_LOW_POWER_MODE, ingenic_cgu_base + CGU_REG_LCR);
+}
+
+static struct syscore_ops __maybe_unused ingenic_cgu_pm_ops = {
+	.suspend = ingenic_cgu_pm_suspend,
+	.resume = ingenic_cgu_pm_resume,
+};
+
+void ingenic_cgu_register_syscore_ops(struct ingenic_cgu *cgu)
+{
+	if (IS_ENABLED(CONFIG_PM_SLEEP)) {
+		ingenic_cgu_base = cgu->base;
+		register_syscore_ops(&ingenic_cgu_pm_ops);
+	}
+}
diff --git a/drivers/clk/ingenic/pm.h b/drivers/clk/ingenic/pm.h
new file mode 100644
index 000000000000..fa7540407b6b
--- /dev/null
+++ b/drivers/clk/ingenic/pm.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019 Paul Cercueil <paul@crapouillou.net>
+ */
+#ifndef DRIVERS_CLK_INGENIC_PM_H
+#define DRIVERS_CLK_INGENIC_PM_H
+
+struct ingenic_cgu;
+
+void ingenic_cgu_register_syscore_ops(struct ingenic_cgu *cgu);
+
+#endif /* DRIVERS_CLK_INGENIC_PM_H */
-- 
2.21.0.593.g511ec345e18


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 3/5] MIPS: jz4740: PM: Let CGU driver suspend clocks and set sleep mode
  2019-06-11 18:07 [PATCH v2 1/5] clk: ingenic: Add missing header in cgu.h Paul Cercueil
  2019-06-11 18:07 ` [PATCH v2 2/5] clk: ingenic: Handle setting the Low-Power Mode bit Paul Cercueil
@ 2019-06-11 18:07 ` Paul Cercueil
  2019-06-25 22:48   ` Stephen Boyd
  2019-06-11 18:07 ` [PATCH v2 4/5] clk: ingenic: Remove unused functions Paul Cercueil
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Paul Cercueil @ 2019-06-11 18:07 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan, Michael Turquette, Stephen Boyd
  Cc: od, linux-mips, linux-pm, linux-clk, linux-kernel, Paul Cercueil

Instead of forcing the jz4740 clocks to suspend here, we let the CGU
driver handle it.
We also let the CGU driver set the "sleep mode" bit.

This has the added benefit that now it is possible to build a kernel on
SoCs newer than the JZ4740 with CONFIG_PM.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---

Notes:
    v2: Rebase on v5.2-rc4

 arch/mips/jz4740/pm.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/arch/mips/jz4740/pm.c b/arch/mips/jz4740/pm.c
index bbdd2b801e6e..f9b551f01f42 100644
--- a/arch/mips/jz4740/pm.c
+++ b/arch/mips/jz4740/pm.c
@@ -9,21 +9,13 @@
 #include <linux/delay.h>
 #include <linux/suspend.h>
 
-#include <asm/mach-jz4740/clock.h>
-
 static int jz4740_pm_enter(suspend_state_t state)
 {
-	jz4740_clock_suspend();
-
-	jz4740_clock_set_wait_mode(JZ4740_WAIT_MODE_SLEEP);
-
 	__asm__(".set\tmips3\n\t"
 		"wait\n\t"
 		".set\tmips0");
 
-	jz4740_clock_set_wait_mode(JZ4740_WAIT_MODE_IDLE);
 
-	jz4740_clock_resume();
 
 	return 0;
 }
-- 
2.21.0.593.g511ec345e18


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 4/5] clk: ingenic: Remove unused functions
  2019-06-11 18:07 [PATCH v2 1/5] clk: ingenic: Add missing header in cgu.h Paul Cercueil
  2019-06-11 18:07 ` [PATCH v2 2/5] clk: ingenic: Handle setting the Low-Power Mode bit Paul Cercueil
  2019-06-11 18:07 ` [PATCH v2 3/5] MIPS: jz4740: PM: Let CGU driver suspend clocks and set sleep mode Paul Cercueil
@ 2019-06-11 18:07 ` Paul Cercueil
  2019-06-25 22:48   ` Stephen Boyd
  2019-06-11 18:07 ` [PATCH v2 5/5] MIPS: Remove dead code Paul Cercueil
  2019-06-25 22:17 ` [PATCH v2 1/5] clk: ingenic: Add missing header in cgu.h Stephen Boyd
  4 siblings, 1 reply; 13+ messages in thread
From: Paul Cercueil @ 2019-06-11 18:07 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan, Michael Turquette, Stephen Boyd
  Cc: od, linux-mips, linux-pm, linux-clk, linux-kernel, Paul Cercueil

These functions are not called anywhere anymore, they can safely be
removed.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---

Notes:
    v2: Rebase on v5.2-rc4

 drivers/clk/ingenic/jz4740-cgu.c | 73 --------------------------------
 1 file changed, 73 deletions(-)

diff --git a/drivers/clk/ingenic/jz4740-cgu.c b/drivers/clk/ingenic/jz4740-cgu.c
index efa893ee1de9..a495d75d5133 100644
--- a/drivers/clk/ingenic/jz4740-cgu.c
+++ b/drivers/clk/ingenic/jz4740-cgu.c
@@ -10,7 +10,6 @@
 #include <linux/io.h>
 #include <linux/of.h>
 #include <dt-bindings/clock/jz4740-cgu.h>
-#include <asm/mach-jz4740/clock.h>
 #include "cgu.h"
 #include "pm.h"
 
@@ -223,75 +222,3 @@ static void __init jz4740_cgu_init(struct device_node *np)
 	ingenic_cgu_register_syscore_ops(cgu);
 }
 CLK_OF_DECLARE(jz4740_cgu, "ingenic,jz4740-cgu", jz4740_cgu_init);
-
-void jz4740_clock_set_wait_mode(enum jz4740_wait_mode mode)
-{
-	uint32_t lcr = readl(cgu->base + CGU_REG_LCR);
-
-	switch (mode) {
-	case JZ4740_WAIT_MODE_IDLE:
-		lcr &= ~LCR_SLEEP;
-		break;
-
-	case JZ4740_WAIT_MODE_SLEEP:
-		lcr |= LCR_SLEEP;
-		break;
-	}
-
-	writel(lcr, cgu->base + CGU_REG_LCR);
-}
-
-void jz4740_clock_udc_disable_auto_suspend(void)
-{
-	uint32_t clkgr = readl(cgu->base + CGU_REG_CLKGR);
-
-	clkgr &= ~CLKGR_UDC;
-	writel(clkgr, cgu->base + CGU_REG_CLKGR);
-}
-EXPORT_SYMBOL_GPL(jz4740_clock_udc_disable_auto_suspend);
-
-void jz4740_clock_udc_enable_auto_suspend(void)
-{
-	uint32_t clkgr = readl(cgu->base + CGU_REG_CLKGR);
-
-	clkgr |= CLKGR_UDC;
-	writel(clkgr, cgu->base + CGU_REG_CLKGR);
-}
-EXPORT_SYMBOL_GPL(jz4740_clock_udc_enable_auto_suspend);
-
-#define JZ_CLOCK_GATE_UART0	BIT(0)
-#define JZ_CLOCK_GATE_TCU	BIT(1)
-#define JZ_CLOCK_GATE_DMAC	BIT(12)
-
-void jz4740_clock_suspend(void)
-{
-	uint32_t clkgr, cppcr;
-
-	clkgr = readl(cgu->base + CGU_REG_CLKGR);
-	clkgr |= JZ_CLOCK_GATE_TCU | JZ_CLOCK_GATE_DMAC | JZ_CLOCK_GATE_UART0;
-	writel(clkgr, cgu->base + CGU_REG_CLKGR);
-
-	cppcr = readl(cgu->base + CGU_REG_CPPCR);
-	cppcr &= ~BIT(jz4740_cgu_clocks[JZ4740_CLK_PLL].pll.enable_bit);
-	writel(cppcr, cgu->base + CGU_REG_CPPCR);
-}
-
-void jz4740_clock_resume(void)
-{
-	uint32_t clkgr, cppcr, stable;
-
-	cppcr = readl(cgu->base + CGU_REG_CPPCR);
-	cppcr |= BIT(jz4740_cgu_clocks[JZ4740_CLK_PLL].pll.enable_bit);
-	writel(cppcr, cgu->base + CGU_REG_CPPCR);
-
-	stable = BIT(jz4740_cgu_clocks[JZ4740_CLK_PLL].pll.stable_bit);
-	do {
-		cppcr = readl(cgu->base + CGU_REG_CPPCR);
-	} while (!(cppcr & stable));
-
-	clkgr = readl(cgu->base + CGU_REG_CLKGR);
-	clkgr &= ~JZ_CLOCK_GATE_TCU;
-	clkgr &= ~JZ_CLOCK_GATE_DMAC;
-	clkgr &= ~JZ_CLOCK_GATE_UART0;
-	writel(clkgr, cgu->base + CGU_REG_CLKGR);
-}
-- 
2.21.0.593.g511ec345e18


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 5/5] MIPS: Remove dead code
  2019-06-11 18:07 [PATCH v2 1/5] clk: ingenic: Add missing header in cgu.h Paul Cercueil
                   ` (2 preceding siblings ...)
  2019-06-11 18:07 ` [PATCH v2 4/5] clk: ingenic: Remove unused functions Paul Cercueil
@ 2019-06-11 18:07 ` Paul Cercueil
  2019-06-11 22:50   ` Paul Burton
  2019-06-25 22:48   ` Stephen Boyd
  2019-06-25 22:17 ` [PATCH v2 1/5] clk: ingenic: Add missing header in cgu.h Stephen Boyd
  4 siblings, 2 replies; 13+ messages in thread
From: Paul Cercueil @ 2019-06-11 18:07 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan, Michael Turquette, Stephen Boyd
  Cc: od, linux-mips, linux-pm, linux-clk, linux-kernel, Paul Cercueil

Remove the unused <asm/mach-jz4740/clock.h> include.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---

Notes:
    v2: Rebase on v5.2-rc4

 arch/mips/include/asm/mach-jz4740/clock.h | 22 ----------------------
 arch/mips/jz4740/board-qi_lb60.c          |  2 --
 arch/mips/jz4740/platform.c               |  2 --
 arch/mips/jz4740/time.c                   |  3 ---
 4 files changed, 29 deletions(-)
 delete mode 100644 arch/mips/include/asm/mach-jz4740/clock.h

diff --git a/arch/mips/include/asm/mach-jz4740/clock.h b/arch/mips/include/asm/mach-jz4740/clock.h
deleted file mode 100644
index 600d5051691a..000000000000
--- a/arch/mips/include/asm/mach-jz4740/clock.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- *  Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de>
- */
-
-#ifndef __ASM_JZ4740_CLOCK_H__
-#define __ASM_JZ4740_CLOCK_H__
-
-enum jz4740_wait_mode {
-	JZ4740_WAIT_MODE_IDLE,
-	JZ4740_WAIT_MODE_SLEEP,
-};
-
-void jz4740_clock_set_wait_mode(enum jz4740_wait_mode mode);
-
-void jz4740_clock_suspend(void);
-void jz4740_clock_resume(void);
-
-void jz4740_clock_udc_enable_auto_suspend(void);
-void jz4740_clock_udc_disable_auto_suspend(void);
-
-#endif
diff --git a/arch/mips/jz4740/board-qi_lb60.c b/arch/mips/jz4740/board-qi_lb60.c
index 071e9d94eea7..d07ee418e5b0 100644
--- a/arch/mips/jz4740/board-qi_lb60.c
+++ b/arch/mips/jz4740/board-qi_lb60.c
@@ -37,8 +37,6 @@
 
 #include <asm/mach-jz4740/platform.h>
 
-#include "clock.h"
-
 /* GPIOs */
 #define QI_LB60_GPIO_KEYOUT(x)		(JZ_GPIO_PORTC(10) + (x))
 #define QI_LB60_GPIO_KEYIN(x)		(JZ_GPIO_PORTD(18) + (x))
diff --git a/arch/mips/jz4740/platform.c b/arch/mips/jz4740/platform.c
index 4b89abb17950..c74c99f5951d 100644
--- a/arch/mips/jz4740/platform.c
+++ b/arch/mips/jz4740/platform.c
@@ -21,8 +21,6 @@
 #include <linux/serial_core.h>
 #include <linux/serial_8250.h>
 
-#include "clock.h"
-
 /* USB Device Controller */
 struct platform_device jz4740_udc_xceiv_device = {
 	.name = "usb_phy_generic",
diff --git a/arch/mips/jz4740/time.c b/arch/mips/jz4740/time.c
index a3260c754e65..cb768e560d8b 100644
--- a/arch/mips/jz4740/time.c
+++ b/arch/mips/jz4740/time.c
@@ -13,13 +13,10 @@
 #include <linux/clockchips.h>
 #include <linux/sched_clock.h>
 
-#include <asm/mach-jz4740/clock.h>
 #include <asm/mach-jz4740/irq.h>
 #include <asm/mach-jz4740/timer.h>
 #include <asm/time.h>
 
-#include "clock.h"
-
 #define TIMER_CLOCKEVENT 0
 #define TIMER_CLOCKSOURCE 1
 
-- 
2.21.0.593.g511ec345e18


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 5/5] MIPS: Remove dead code
  2019-06-11 18:07 ` [PATCH v2 5/5] MIPS: Remove dead code Paul Cercueil
@ 2019-06-11 22:50   ` Paul Burton
  2019-06-25 22:48   ` Stephen Boyd
  1 sibling, 0 replies; 13+ messages in thread
From: Paul Burton @ 2019-06-11 22:50 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Ralf Baechle, James Hogan, Michael Turquette, Stephen Boyd, od,
	linux-mips, linux-pm, linux-clk, linux-kernel

Hi Paul,

On Tue, Jun 11, 2019 at 08:07:57PM +0200, Paul Cercueil wrote:
> Remove the unused <asm/mach-jz4740/clock.h> include.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

Presuming this goes via the clk tree:

    Acked-by: Paul Burton <paul.burton@mips.com>

Thanks,
    Paul

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/5] clk: ingenic: Add missing header in cgu.h
  2019-06-11 18:07 [PATCH v2 1/5] clk: ingenic: Add missing header in cgu.h Paul Cercueil
                   ` (3 preceding siblings ...)
  2019-06-11 18:07 ` [PATCH v2 5/5] MIPS: Remove dead code Paul Cercueil
@ 2019-06-25 22:17 ` Stephen Boyd
  2019-06-25 22:42   ` Stephen Boyd
  4 siblings, 1 reply; 13+ messages in thread
From: Stephen Boyd @ 2019-06-25 22:17 UTC (permalink / raw)
  To: James Hogan, Michael Turquette, Paul Burton, Paul Cercueil, Ralf Baechle
  Cc: od, linux-mips, linux-pm, linux-clk, linux-kernel, Paul Cercueil

Quoting Paul Cercueil (2019-06-11 11:07:53)
> The cgu.h has structures that contain 'clk_onecell_data' and 'clk_hw'
> structures (no pointers), so the <linux/clk-provider.h> header should be
> included.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---
> 
> Notes:
>     v2: Rebase on v5.2-rc4

You seemed to miss my review comments on patch set #1.

https://lkml.kernel.org/r/155726035790.14659.7321778387595703949@swboyd.mtv.corp.google.com


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/5] clk: ingenic: Add missing header in cgu.h
  2019-06-25 22:17 ` [PATCH v2 1/5] clk: ingenic: Add missing header in cgu.h Stephen Boyd
@ 2019-06-25 22:42   ` Stephen Boyd
  2019-06-25 22:46     ` Paul Cercueil
  0 siblings, 1 reply; 13+ messages in thread
From: Stephen Boyd @ 2019-06-25 22:42 UTC (permalink / raw)
  To: James Hogan, Michael Turquette, Paul Burton, Paul Cercueil, Ralf Baechle
  Cc: od, linux-mips, linux-pm, linux-clk, linux-kernel, Paul Cercueil

Quoting Stephen Boyd (2019-06-25 15:17:35)
> Quoting Paul Cercueil (2019-06-11 11:07:53)
> > The cgu.h has structures that contain 'clk_onecell_data' and 'clk_hw'
> > structures (no pointers), so the <linux/clk-provider.h> header should be
> > included.
> > 
> > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> > ---
> > 
> > Notes:
> >     v2: Rebase on v5.2-rc4
> 
> You seemed to miss my review comments on patch set #1.
> 
> https://lkml.kernel.org/r/155726035790.14659.7321778387595703949@swboyd.mtv.corp.google.com
> 

I've just decided to fix it instead of wait. Let me know if that's a
problem.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/5] clk: ingenic: Add missing header in cgu.h
  2019-06-25 22:42   ` Stephen Boyd
@ 2019-06-25 22:46     ` Paul Cercueil
  0 siblings, 0 replies; 13+ messages in thread
From: Paul Cercueil @ 2019-06-25 22:46 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: James Hogan, Michael Turquette, Paul Burton, Ralf Baechle, od,
	linux-mips, linux-pm, linux-clk, linux-kernel



Le mer. 26 juin 2019 à 0:42, Stephen Boyd <sboyd@kernel.org> a écrit :
> Quoting Stephen Boyd (2019-06-25 15:17:35)
>>  Quoting Paul Cercueil (2019-06-11 11:07:53)
>>  > The cgu.h has structures that contain 'clk_onecell_data' and 
>> 'clk_hw'
>>  > structures (no pointers), so the <linux/clk-provider.h> header 
>> should be
>>  > included.
>>  >
>>  > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>>  > ---
>>  >
>>  > Notes:
>>  >     v2: Rebase on v5.2-rc4
>> 
>>  You seemed to miss my review comments on patch set #1.
>> 
>>  
>> https://lkml.kernel.org/r/155726035790.14659.7321778387595703949@swboyd.mtv.corp.google.com

Oops. Sorry about that.

> I've just decided to fix it instead of wait. Let me know if that's a
> problem.

Sure, that's no problem. Thanks!

-Paul



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 2/5] clk: ingenic: Handle setting the Low-Power Mode bit
  2019-06-11 18:07 ` [PATCH v2 2/5] clk: ingenic: Handle setting the Low-Power Mode bit Paul Cercueil
@ 2019-06-25 22:48   ` Stephen Boyd
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Boyd @ 2019-06-25 22:48 UTC (permalink / raw)
  To: James Hogan, Michael Turquette, Paul Burton, Paul Cercueil, Ralf Baechle
  Cc: od, linux-mips, linux-pm, linux-clk, linux-kernel, Paul Cercueil

Quoting Paul Cercueil (2019-06-11 11:07:54)
> The Low-Power Mode, when enabled, will make the "wait" MIPS instruction
> suspend the system.
> 
> This is not really clock-related, but this bit happens to be in the
> register set of the CGU.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---

Applied to clk-next


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 3/5] MIPS: jz4740: PM: Let CGU driver suspend clocks and set sleep mode
  2019-06-11 18:07 ` [PATCH v2 3/5] MIPS: jz4740: PM: Let CGU driver suspend clocks and set sleep mode Paul Cercueil
@ 2019-06-25 22:48   ` Stephen Boyd
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Boyd @ 2019-06-25 22:48 UTC (permalink / raw)
  To: James Hogan, Michael Turquette, Paul Burton, Paul Cercueil, Ralf Baechle
  Cc: od, linux-mips, linux-pm, linux-clk, linux-kernel, Paul Cercueil

Quoting Paul Cercueil (2019-06-11 11:07:55)
> Instead of forcing the jz4740 clocks to suspend here, we let the CGU
> driver handle it.
> We also let the CGU driver set the "sleep mode" bit.
> 
> This has the added benefit that now it is possible to build a kernel on
> SoCs newer than the JZ4740 with CONFIG_PM.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---

Applied to clk-next


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 4/5] clk: ingenic: Remove unused functions
  2019-06-11 18:07 ` [PATCH v2 4/5] clk: ingenic: Remove unused functions Paul Cercueil
@ 2019-06-25 22:48   ` Stephen Boyd
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Boyd @ 2019-06-25 22:48 UTC (permalink / raw)
  To: James Hogan, Michael Turquette, Paul Burton, Paul Cercueil, Ralf Baechle
  Cc: od, linux-mips, linux-pm, linux-clk, linux-kernel, Paul Cercueil

Quoting Paul Cercueil (2019-06-11 11:07:56)
> These functions are not called anywhere anymore, they can safely be
> removed.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---

Applied to clk-next


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 5/5] MIPS: Remove dead code
  2019-06-11 18:07 ` [PATCH v2 5/5] MIPS: Remove dead code Paul Cercueil
  2019-06-11 22:50   ` Paul Burton
@ 2019-06-25 22:48   ` Stephen Boyd
  1 sibling, 0 replies; 13+ messages in thread
From: Stephen Boyd @ 2019-06-25 22:48 UTC (permalink / raw)
  To: James Hogan, Michael Turquette, Paul Burton, Paul Cercueil, Ralf Baechle
  Cc: od, linux-mips, linux-pm, linux-clk, linux-kernel, Paul Cercueil

Quoting Paul Cercueil (2019-06-11 11:07:57)
> Remove the unused <asm/mach-jz4740/clock.h> include.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---

Applied to clk-next


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-06-25 22:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-11 18:07 [PATCH v2 1/5] clk: ingenic: Add missing header in cgu.h Paul Cercueil
2019-06-11 18:07 ` [PATCH v2 2/5] clk: ingenic: Handle setting the Low-Power Mode bit Paul Cercueil
2019-06-25 22:48   ` Stephen Boyd
2019-06-11 18:07 ` [PATCH v2 3/5] MIPS: jz4740: PM: Let CGU driver suspend clocks and set sleep mode Paul Cercueil
2019-06-25 22:48   ` Stephen Boyd
2019-06-11 18:07 ` [PATCH v2 4/5] clk: ingenic: Remove unused functions Paul Cercueil
2019-06-25 22:48   ` Stephen Boyd
2019-06-11 18:07 ` [PATCH v2 5/5] MIPS: Remove dead code Paul Cercueil
2019-06-11 22:50   ` Paul Burton
2019-06-25 22:48   ` Stephen Boyd
2019-06-25 22:17 ` [PATCH v2 1/5] clk: ingenic: Add missing header in cgu.h Stephen Boyd
2019-06-25 22:42   ` Stephen Boyd
2019-06-25 22:46     ` Paul Cercueil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.