Lines Matching +full:mem +full:- +full:base
1 // SPDX-License-Identifier: GPL-2.0
3 * Watchdog driver for the MEN z069 IP-Core
15 void __iomem *base; member
16 struct resource *mem; member
39 val = readw(drv->base + MEN_Z069_WTR); in men_z069_wdt_start()
41 writew(val, drv->base + MEN_Z069_WTR); in men_z069_wdt_start()
51 val = readw(drv->base + MEN_Z069_WTR); in men_z069_wdt_stop()
53 writew(val, drv->base + MEN_Z069_WTR); in men_z069_wdt_stop()
64 val = readw(drv->base + MEN_Z069_WVR); in men_z069_wdt_ping()
66 writew(val, drv->base + MEN_Z069_WVR); in men_z069_wdt_ping()
77 wdt->timeout = timeout; in men_z069_wdt_set_timeout()
80 reg = readw(drv->base + MEN_Z069_WTR); in men_z069_wdt_set_timeout()
83 writew(reg, drv->base + MEN_Z069_WTR); in men_z069_wdt_set_timeout()
105 struct resource *mem; in men_z069_probe() local
107 drv = devm_kzalloc(&dev->dev, sizeof(struct men_z069_drv), GFP_KERNEL); in men_z069_probe()
109 return -ENOMEM; in men_z069_probe()
111 mem = mcb_request_mem(dev, "z069-wdt"); in men_z069_probe()
112 if (IS_ERR(mem)) in men_z069_probe()
113 return PTR_ERR(mem); in men_z069_probe()
115 drv->base = devm_ioremap(&dev->dev, mem->start, resource_size(mem)); in men_z069_probe()
116 if (drv->base == NULL) in men_z069_probe()
119 drv->mem = mem; in men_z069_probe()
120 drv->wdt.info = &men_z069_info; in men_z069_probe()
121 drv->wdt.ops = &men_z069_ops; in men_z069_probe()
122 drv->wdt.timeout = MEN_Z069_DEFAULT_TIMEOUT; in men_z069_probe()
123 drv->wdt.min_timeout = 1; in men_z069_probe()
124 drv->wdt.max_timeout = MEN_Z069_WDT_COUNTER_MAX / MEN_Z069_TIMER_FREQ; in men_z069_probe()
126 watchdog_init_timeout(&drv->wdt, 0, &dev->dev); in men_z069_probe()
127 watchdog_set_nowayout(&drv->wdt, nowayout); in men_z069_probe()
128 watchdog_set_drvdata(&drv->wdt, drv); in men_z069_probe()
129 drv->wdt.parent = &dev->dev; in men_z069_probe()
132 return watchdog_register_device(&drv->wdt); in men_z069_probe()
135 mcb_release_mem(mem); in men_z069_probe()
136 return -ENOMEM; in men_z069_probe()
143 watchdog_unregister_device(&drv->wdt); in men_z069_remove()
144 mcb_release_mem(drv->mem); in men_z069_remove()
155 .name = "z069-wdt",
164 MODULE_DESCRIPTION("Watchdog driver for the MEN z069 IP-Core");