Skip to contentSkip to conversation

mfd: add clock API support to asic3 using clocklib

RFC PATCH New Philipp Zabel 1 participant 1 message Jun 26, 2008 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 mfd: add clock API support to asic3 using clocklib

This patch adds basic clock API support for ASIC3 clocks using Dmitry Baryshkov's clocklib (http://lkml.org/lkml/2008/6/26/278).
The CDEX clocks can be enabled/disabled and the SD host and bus clock rates can be changed. Also the clock settings comment for SD HCLK and BCLK in asic3.h is moved to the right place.

I am missing information about the spi, pwm, led, smbus and cx clock's rates, and I'm not sure if the SOURCE0/1 bits in CLOCK_CDEX should be handled here somehow. The CLOCK_SEL_CX bit in CLOCK_SEL is only used internally by the IRQ controller, so I guess not handling that is fine.

---
 drivers/mfd/Kconfig       |    2 +-
 drivers/mfd/asic3.c       |  146 ++++++++++++++++++++++++++++++++++++++++++++-
 include/linux/mfd/asic3.h |    2 +-
 3 files changed, 147 insertions(+), 3 deletions(-)
drivers/mfd/Kconfig +1 -1
index 5f87a28..a0da724 100644
@@ -17,7 +17,7 @@ config MFD_SM501
 
 config MFD_ASIC3
 	bool "Support for Compaq ASIC3"
-	depends on GENERIC_HARDIRQS && HAVE_GPIO_LIB && ARM
+	depends on GENERIC_HARDIRQS && HAVE_GPIO_LIB && HAVE_CLOCKLIB && ARM
 	 ---help---
 	  This driver supports the ASIC3 multifunction chip found on many
 	  PDAs (mainly iPAQ and HTC based ones)
drivers/mfd/asic3.c +145 -1

186 lines not on this page · raw message

include/linux/mfd/asic3.h +1 -1
index 6461a2a..0610449 100644
@@ -152,7 +152,6 @@ struct asic3_platform_data {
 #define CLOCK_CDEX_LED1         (1 << 7)
 #define CLOCK_CDEX_LED2         (1 << 8)
 
-/* Clocks settings: 1 for 24.576 MHz, 0 for 12.288Mhz */
 #define CLOCK_CDEX_SD_HOST      (1 << 9)   /* R/W: SD host clock source */
 #define CLOCK_CDEX_SD_BUS       (1 << 10)  /* R/W: SD bus clock source ctrl */
 #define CLOCK_CDEX_SMBUS        (1 << 11)
@@ -161,6 +160,7 @@ struct asic3_platform_data {
 #define CLOCK_CDEX_EX0          (1 << 13)  /* R/W: 32.768 kHz crystal */
 #define CLOCK_CDEX_EX1          (1 << 14)  /* R/W: 24.576 MHz crystal */
 
+/* Clocks settings: 1 for 24.576 MHz, 0 for 12.288Mhz */
 #define CLOCK_SEL_SD_HCLK_SEL   (1 << 0)   /* R/W: SDIO host clock select */
 #define CLOCK_SEL_SD_BCLK_SEL   (1 << 1)   /* R/W: SDIO bus clock select */
 
Signature · 1 line
1.5.5.4