Skip to contentSkip to conversation

CS5535: add a generic clock event MFGPT driver

PATCH New Andres Salomon 1 participant 1 message Nov 8, 2009 Clocksource, clockevent drivers

lore
Share & tools
lore
#0 lore raw

PATCH 2/6 CS5535: add a generic clock event MFGPT driver

This is based on the old code in arch/x86/kernel/mfgpt_32.c, but is modular and not Geode-specific. There's no reason why the clock event device needs to be registered so early at boot; the clockevent code is perfectly capable of dynamic switching.

---
 drivers/Kconfig                       |    2 +
 drivers/clocksource/Kconfig           |    9 ++
 drivers/clocksource/Makefile          |    1 +
 drivers/clocksource/cs5535-clockevt.c |  196 +++++++++++++++++++++++++++++++++
 4 files changed, 208 insertions(+), 0 deletions(-)
 create mode 100644 drivers/clocksource/Kconfig
 create mode 100644 drivers/clocksource/cs5535-clockevt.c
drivers/Kconfig +2 -0
index 48bbdbe..b4bc5a4 100644
@@ -98,6 +98,8 @@ source "drivers/edac/Kconfig"
 
 source "drivers/rtc/Kconfig"
 
+source "drivers/clocksource/Kconfig"
+
 source "drivers/dma/Kconfig"
 
 source "drivers/dca/Kconfig"
drivers/clocksource/Kconfig new file +9 -0
new file mode 100644
index 0000000..08f726c
@@ -0,0 +1,9 @@
+config CS5535_CLOCK_EVENT_SRC
+	tristate "CS5535/CS5536 high-res timer (MFGPT) events"
+	depends on GENERIC_TIME && GENERIC_CLOCKEVENTS && CS5535_MFGPT
+	help
+	  This driver provides a clock event source based on the MFGPT
+	  timer(s) in the CS5535 and CS5536 companion chips.
+	  MFGPTs have a better resolution and max interval than the
+	  generic PIT, and are suitable for use as high-res timers.
+
drivers/clocksource/Makefile +1 -0
index eef216f..be61ece 100644
@@ -2,6 +2,7 @@ obj-$(CONFIG_ATMEL_TCB_CLKSRC)	+= tcb_clksrc.o
 obj-$(CONFIG_X86_CYCLONE_TIMER)	+= cyclone.o
 obj-$(CONFIG_X86_PM_TIMER)	+= acpi_pm.o
 obj-$(CONFIG_SCx200HR_TIMER)	+= scx200_hrt.o
+obj-$(CONFIG_CS5535_CLOCK_EVENT_SRC)	+= cs5535-clockevt.o
 obj-$(CONFIG_SH_TIMER_CMT)	+= sh_cmt.o
 obj-$(CONFIG_SH_TIMER_MTU2)	+= sh_mtu2.o
 obj-$(CONFIG_SH_TIMER_TMU)	+= sh_tmu.o
drivers/clocksource/cs5535-clockevt.c new file +196 -0

196 lines not on this page · raw message

Signature · 1 line
1.5.6.5