Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 342008
b: refs/heads/master
c: 9f640a6
h: refs/heads/master
v: v3
  • Loading branch information
Hauke Mehrtens authored and John W. Linville committed Dec 6, 2012
1 parent 18edf7e commit dae2e16
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7280b51a29f8e6cc7d449d565182d1e1b6183907
refs/heads/master: 9f640a6376e54fa9ae834c32cbe92cefeec970dc
21 changes: 20 additions & 1 deletion trunk/drivers/ssb/driver_extif.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,30 @@ void ssb_extif_get_clockcontrol(struct ssb_extif *extif,
*m = extif_read32(extif, SSB_EXTIF_CLOCK_SB);
}

void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, u32 ticks)
u32 ssb_extif_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt, u32 ticks)
{
struct ssb_extif *extif = bcm47xx_wdt_get_drvdata(wdt);

return ssb_extif_watchdog_timer_set(extif, ticks);
}

u32 ssb_extif_watchdog_timer_set_ms(struct bcm47xx_wdt *wdt, u32 ms)
{
struct ssb_extif *extif = bcm47xx_wdt_get_drvdata(wdt);
u32 ticks = (SSB_EXTIF_WATCHDOG_CLK / 1000) * ms;

ticks = ssb_extif_watchdog_timer_set(extif, ticks);

return (ticks * 1000) / SSB_EXTIF_WATCHDOG_CLK;
}

u32 ssb_extif_watchdog_timer_set(struct ssb_extif *extif, u32 ticks)
{
if (ticks > SSB_EXTIF_WATCHDOG_MAX_TIMER)
ticks = SSB_EXTIF_WATCHDOG_MAX_TIMER;
extif_write32(extif, SSB_EXTIF_WATCHDOG, ticks);

return ticks;
}

u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask)
Expand Down
15 changes: 15 additions & 0 deletions trunk/drivers/ssb/ssb_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,19 @@ extern u32 ssb_chipco_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt,
u32 ticks);
extern u32 ssb_chipco_watchdog_timer_set_ms(struct bcm47xx_wdt *wdt, u32 ms);

#ifdef CONFIG_SSB_DRIVER_EXTIF
extern u32 ssb_extif_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt, u32 ticks);
extern u32 ssb_extif_watchdog_timer_set_ms(struct bcm47xx_wdt *wdt, u32 ms);
#else
static inline u32 ssb_extif_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt,
u32 ticks)
{
return 0;
}
static inline u32 ssb_extif_watchdog_timer_set_ms(struct bcm47xx_wdt *wdt,
u32 ms)
{
return 0;
}
#endif
#endif /* LINUX_SSB_PRIVATE_H_ */
9 changes: 5 additions & 4 deletions trunk/include/linux/ssb/ssb_driver_extif.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@
#define SSB_EXTIF_WATCHDOG_CLK 48000000 /* Hz */

#define SSB_EXTIF_WATCHDOG_MAX_TIMER ((1 << 28) - 1)
#define SSB_EXTIF_WATCHDOG_MAX_TIMER_MS (SSB_EXTIF_WATCHDOG_MAX_TIMER \
/ (SSB_EXTIF_WATCHDOG_CLK / 1000))


#ifdef CONFIG_SSB_DRIVER_EXTIF
Expand All @@ -172,8 +174,7 @@ extern void ssb_extif_get_clockcontrol(struct ssb_extif *extif,
extern void ssb_extif_timing_init(struct ssb_extif *extif,
unsigned long ns);

extern void ssb_extif_watchdog_timer_set(struct ssb_extif *extif,
u32 ticks);
extern u32 ssb_extif_watchdog_timer_set(struct ssb_extif *extif, u32 ticks);

/* Extif GPIO pin access */
u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask);
Expand Down Expand Up @@ -211,9 +212,9 @@ void ssb_extif_timing_init(struct ssb_extif *extif, unsigned long ns)
}

static inline
void ssb_extif_watchdog_timer_set(struct ssb_extif *extif,
u32 ticks)
u32 ssb_extif_watchdog_timer_set(struct ssb_extif *extif, u32 ticks)
{
return 0;
}

static inline u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask)
Expand Down

0 comments on commit dae2e16

Please sign in to comment.