aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ssb/ssb_driver_extif.h
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-12-05 12:46:07 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-12-06 14:58:58 -0500
commit9f640a6376e54fa9ae834c32cbe92cefeec970dc (patch)
tree84e02c5cd758f6d52d595414ccc162279a19037a /include/linux/ssb/ssb_driver_extif.h
parent7280b51a29f8e6cc7d449d565182d1e1b6183907 (diff)
ssb: extif: add methods for watchdog driver
The watchdog driver wants to set the watchdog timeout in ms and not in ticks, add a method converting ms to ticks before setting the watchdog register. Return the ticks or millisecond the timer was set to in case the provided value was bigger than the max allowed value. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/linux/ssb/ssb_driver_extif.h')
-rw-r--r--include/linux/ssb/ssb_driver_extif.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/ssb/ssb_driver_extif.h b/include/linux/ssb/ssb_driver_extif.h
index b618188939d2..99511d0e931d 100644
--- a/include/linux/ssb/ssb_driver_extif.h
+++ b/include/linux/ssb/ssb_driver_extif.h
@@ -153,6 +153,8 @@
153#define SSB_EXTIF_WATCHDOG_CLK 48000000 /* Hz */ 153#define SSB_EXTIF_WATCHDOG_CLK 48000000 /* Hz */
154 154
155#define SSB_EXTIF_WATCHDOG_MAX_TIMER ((1 << 28) - 1) 155#define SSB_EXTIF_WATCHDOG_MAX_TIMER ((1 << 28) - 1)
156#define SSB_EXTIF_WATCHDOG_MAX_TIMER_MS (SSB_EXTIF_WATCHDOG_MAX_TIMER \
157 / (SSB_EXTIF_WATCHDOG_CLK / 1000))
156 158
157 159
158#ifdef CONFIG_SSB_DRIVER_EXTIF 160#ifdef CONFIG_SSB_DRIVER_EXTIF
@@ -172,8 +174,7 @@ extern void ssb_extif_get_clockcontrol(struct ssb_extif *extif,
172extern void ssb_extif_timing_init(struct ssb_extif *extif, 174extern void ssb_extif_timing_init(struct ssb_extif *extif,
173 unsigned long ns); 175 unsigned long ns);
174 176
175extern void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, 177extern u32 ssb_extif_watchdog_timer_set(struct ssb_extif *extif, u32 ticks);
176 u32 ticks);
177 178
178/* Extif GPIO pin access */ 179/* Extif GPIO pin access */
179u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask); 180u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask);
@@ -211,9 +212,9 @@ void ssb_extif_timing_init(struct ssb_extif *extif, unsigned long ns)
211} 212}
212 213
213static inline 214static inline
214void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, 215u32 ssb_extif_watchdog_timer_set(struct ssb_extif *extif, u32 ticks)
215 u32 ticks)
216{ 216{
217 return 0;
217} 218}
218 219
219static inline u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask) 220static inline u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask)