1 --- a/drivers/bcma/bcma_private.h
2 +++ b/drivers/bcma/bcma_private.h
3 @@ -85,6 +85,8 @@ extern void __exit bcma_host_pci_exit(vo
5 u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
7 +extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc);
9 #ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
10 bool __devinit bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc);
11 void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc);
12 --- a/drivers/bcma/driver_chipcommon.c
13 +++ b/drivers/bcma/driver_chipcommon.c
15 #include "bcma_private.h"
16 #include <linux/bcm47xx_wdt.h>
17 #include <linux/export.h>
18 +#include <linux/platform_device.h>
19 #include <linux/bcma/bcma.h>
21 static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset,
22 @@ -87,6 +88,27 @@ static int bcma_chipco_watchdog_ticks_pe
26 +int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc)
28 + struct bcm47xx_wdt wdt = {};
29 + struct platform_device *pdev;
31 + wdt.driver_data = cc;
32 + wdt.timer_set = bcma_chipco_watchdog_timer_set_wdt;
33 + wdt.timer_set_ms = bcma_chipco_watchdog_timer_set_ms_wdt;
34 + wdt.max_timer_ms = bcma_chipco_watchdog_get_max_timer(cc) / cc->ticks_per_ms;
36 + pdev = platform_device_register_data(NULL, "bcm47xx-wdt",
37 + cc->core->bus->num, &wdt,
40 + return PTR_ERR(pdev);
42 + cc->watchdog = pdev;
47 void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc)
49 if (cc->early_setup_done)
50 --- a/drivers/bcma/main.c
51 +++ b/drivers/bcma/main.c
52 @@ -173,6 +173,12 @@ static int bcma_register_cores(struct bc
56 + if (bus->hosttype == BCMA_HOSTTYPE_SOC) {
57 + err = bcma_chipco_watchdog_register(&bus->drv_cc);
59 + bcma_err(bus, "Error registering watchdog driver\n");
65 @@ -185,6 +191,8 @@ static void bcma_unregister_cores(struct
66 if (core->dev_registered)
67 device_unregister(&core->dev);
69 + if (bus->hosttype == BCMA_HOSTTYPE_SOC)
70 + platform_device_unregister(bus->drv_cc.watchdog);
73 int __devinit bcma_bus_register(struct bcma_bus *bus)
74 --- a/include/linux/bcma/bcma_driver_chipcommon.h
75 +++ b/include/linux/bcma/bcma_driver_chipcommon.h
77 #include <linux/mtd/bcm47xx_sflash.h>
78 #include <linux/mtd/bcm47xx_nand.h>
80 +#include <linux/platform_device.h>
82 /** ChipCommon core registers. **/
83 #define BCMA_CC_ID 0x0000
84 #define BCMA_CC_ID_ID 0x0000FFFF
85 @@ -555,6 +557,7 @@ struct bcma_drv_cc {
86 /* Lock for GPIO register access. */
89 + struct platform_device *watchdog;