Skip to contentSkip to conversation

clocksource: sh_cmt: 32-bit control register access prototype

PATCH New Magnus Damm 1 participant 1 message Dec 14, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clocksource: sh_cmt: 32-bit control register access prototype

From: Magnus Damm <[email protected]>

This is a 32-bit control register access prototype for the CMT driver. It is not ready for merge but it intends to show the reasoning behind the register access patches included in this series:
"[PATCH 00/08] clocksource: sh_cmt: CMT driver update"

Not-Yet-Signed-off-by Magnus Damm <[email protected]>

---

 drivers/clocksource/sh_cmt.c |   11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/clocksource/sh_cmt.c +11 -0
@@ -79,6 +79,12 @@ struct sh_cmt_priv {
  * CMCSR 0xffca0060 16-bit
  * CMCNT 0xffca0064 32-bit
  * CMCOR 0xffca0068 32-bit
+ *
+ * "32-bit counter and 32-bit control"
+ * CMSTR 0xe6130000 32-bit
+ * CMCSR 0xe6130010 32-bit
+ * CMCNT 0xe6130014 32-bit
+ * CMCOR 0xe6130018 32-bit
  */
 
 static unsigned long sh_cmt_read16(void __iomem *base, unsigned long offs)
@@ -734,8 +740,13 @@ static int sh_cmt_setup(struct sh_cmt_pr
 		goto err1;
 	}
 
+#if 1 /* XXX: filthy prototype hack! */
+	p->read_control = sh_cmt_read32;
+	p->write_control = sh_cmt_write32;
+#else
 	p->read_control = sh_cmt_read16;
 	p->write_control = sh_cmt_write16;
+#endif
 
 	if (resource_size(res) = 6) {
 		p->width = 16;