Lines Matching +full:super +full:- +full:set

1 // SPDX-License-Identifier: GPL-2.0-only
2 /* riowd.c - driver for hw watchdog inside Super I/O of RIO
23 /* RIO uses the NatSemi Super I/O power management logical device
28 * trigger a power-on reset when the signal is asserted. The BBC
31 * The only Super I/O device register we care about is at index
32 * 0x05 (WDTO_INDEX) which is the watchdog time-out in minutes (1-255).
33 * If set to zero, this disables the watchdog. When set, the system
34 * must periodically (before watchdog expires) clear (set to zero) and
35 * re-set the watchdog else it will trigger.
37 * There are two other indexed watchdog registers inside this Super I/O
39 * the watchdog control and can be used to make the watchdog timer re-set
71 spin_lock_irqsave(&p->lock, flags); in riowd_writereg()
72 writeb(index, p->regs + 0); in riowd_writereg()
73 writeb(val, p->regs + 1); in riowd_writereg()
74 spin_unlock_irqrestore(&p->lock, flags); in riowd_writereg()
103 return -EFAULT; in riowd_ioctl()
109 return -EFAULT; in riowd_ioctl()
118 return -EFAULT; in riowd_ioctl()
125 return -EINVAL; in riowd_ioctl()
131 return -EFAULT; in riowd_ioctl()
133 return -EINVAL; in riowd_ioctl()
142 return -EINVAL; in riowd_ioctl()
179 int err = -EINVAL; in riowd_probe()
184 err = -ENOMEM; in riowd_probe()
185 p = devm_kzalloc(&op->dev, sizeof(*p), GFP_KERNEL); in riowd_probe()
189 spin_lock_init(&p->lock); in riowd_probe()
191 p->regs = of_ioremap(&op->resource[0], 0, 2, DRIVER_NAME); in riowd_probe()
192 if (!p->regs) { in riowd_probe()
206 riowd_timeout, p->regs); in riowd_probe()
213 of_iounmap(&op->resource[0], p->regs, 2); in riowd_probe()
224 of_iounmap(&op->resource[0], p->regs, 2); in riowd_remove()