Lines Matching refs:ddata

72 static void mpc8xxx_wdt_keepalive(struct mpc8xxx_wdt_ddata *ddata)  in mpc8xxx_wdt_keepalive()  argument
75 spin_lock(&ddata->lock); in mpc8xxx_wdt_keepalive()
76 out_be16(&ddata->base->swsrr, 0x556c); in mpc8xxx_wdt_keepalive()
77 out_be16(&ddata->base->swsrr, 0xaa39); in mpc8xxx_wdt_keepalive()
78 spin_unlock(&ddata->lock); in mpc8xxx_wdt_keepalive()
83 struct mpc8xxx_wdt_ddata *ddata = in mpc8xxx_wdt_start() local
85 u32 tmp = in_be32(&ddata->base->swcrr); in mpc8xxx_wdt_start()
89 tmp |= SWCRR_SWEN | SWCRR_SWPR | (ddata->swtc << 16); in mpc8xxx_wdt_start()
94 out_be32(&ddata->base->swcrr, tmp); in mpc8xxx_wdt_start()
96 tmp = in_be32(&ddata->base->swcrr); in mpc8xxx_wdt_start()
100 ddata->swtc = tmp >> 16; in mpc8xxx_wdt_start()
101 set_bit(WDOG_HW_RUNNING, &ddata->wdd.status); in mpc8xxx_wdt_start()
108 struct mpc8xxx_wdt_ddata *ddata = in mpc8xxx_wdt_ping() local
111 mpc8xxx_wdt_keepalive(ddata); in mpc8xxx_wdt_ping()
132 struct mpc8xxx_wdt_ddata *ddata; in mpc8xxx_wdt_probe() local
144 ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL); in mpc8xxx_wdt_probe()
145 if (!ddata) in mpc8xxx_wdt_probe()
148 ddata->base = devm_platform_ioremap_resource(ofdev, 0); in mpc8xxx_wdt_probe()
149 if (IS_ERR(ddata->base)) in mpc8xxx_wdt_probe()
150 return PTR_ERR(ddata->base); in mpc8xxx_wdt_probe()
152 enabled = in_be32(&ddata->base->swcrr) & SWCRR_SWEN; in mpc8xxx_wdt_probe()
167 ddata->wdd.bootstatus = status ? WDIOF_CARDRESET : 0; in mpc8xxx_wdt_probe()
176 spin_lock_init(&ddata->lock); in mpc8xxx_wdt_probe()
178 ddata->wdd.info = &mpc8xxx_wdt_info; in mpc8xxx_wdt_probe()
179 ddata->wdd.ops = &mpc8xxx_wdt_ops; in mpc8xxx_wdt_probe()
181 ddata->wdd.timeout = WATCHDOG_TIMEOUT; in mpc8xxx_wdt_probe()
182 watchdog_init_timeout(&ddata->wdd, timeout, dev); in mpc8xxx_wdt_probe()
184 watchdog_set_nowayout(&ddata->wdd, nowayout); in mpc8xxx_wdt_probe()
186 ddata->swtc = min(ddata->wdd.timeout * freq / wdt_type->prescaler, in mpc8xxx_wdt_probe()
195 mpc8xxx_wdt_start(&ddata->wdd); in mpc8xxx_wdt_probe()
197 ddata->wdd.max_hw_heartbeat_ms = (ddata->swtc * wdt_type->prescaler) / in mpc8xxx_wdt_probe()
199 ddata->wdd.min_timeout = ddata->wdd.max_hw_heartbeat_ms / 1000; in mpc8xxx_wdt_probe()
200 if (ddata->wdd.timeout < ddata->wdd.min_timeout) in mpc8xxx_wdt_probe()
201 ddata->wdd.timeout = ddata->wdd.min_timeout; in mpc8xxx_wdt_probe()
203 ret = devm_watchdog_register_device(dev, &ddata->wdd); in mpc8xxx_wdt_probe()
209 reset ? "reset" : "interrupt", ddata->wdd.timeout); in mpc8xxx_wdt_probe()
211 platform_set_drvdata(ofdev, ddata); in mpc8xxx_wdt_probe()