Lines Matching refs:mtx1_wdt_device

58 } mtx1_wdt_device;  variable
62 spin_lock(&mtx1_wdt_device.lock); in mtx1_wdt_trigger()
63 if (mtx1_wdt_device.running) in mtx1_wdt_trigger()
67 mtx1_wdt_device.gstate = !mtx1_wdt_device.gstate; in mtx1_wdt_trigger()
68 gpiod_set_value(mtx1_wdt_device.gpiod, mtx1_wdt_device.gstate); in mtx1_wdt_trigger()
70 if (mtx1_wdt_device.queue && ticks) in mtx1_wdt_trigger()
71 mod_timer(&mtx1_wdt_device.timer, jiffies + MTX1_WDT_INTERVAL); in mtx1_wdt_trigger()
73 complete(&mtx1_wdt_device.stop); in mtx1_wdt_trigger()
74 spin_unlock(&mtx1_wdt_device.lock); in mtx1_wdt_trigger()
79 ticks = mtx1_wdt_device.default_ticks; in mtx1_wdt_reset()
87 spin_lock_irqsave(&mtx1_wdt_device.lock, flags); in mtx1_wdt_start()
88 if (!mtx1_wdt_device.queue) { in mtx1_wdt_start()
89 mtx1_wdt_device.queue = 1; in mtx1_wdt_start()
90 mtx1_wdt_device.gstate = 1; in mtx1_wdt_start()
91 gpiod_set_value(mtx1_wdt_device.gpiod, 1); in mtx1_wdt_start()
92 mod_timer(&mtx1_wdt_device.timer, jiffies + MTX1_WDT_INTERVAL); in mtx1_wdt_start()
94 mtx1_wdt_device.running++; in mtx1_wdt_start()
95 spin_unlock_irqrestore(&mtx1_wdt_device.lock, flags); in mtx1_wdt_start()
102 spin_lock_irqsave(&mtx1_wdt_device.lock, flags); in mtx1_wdt_stop()
103 if (mtx1_wdt_device.queue) { in mtx1_wdt_stop()
104 mtx1_wdt_device.queue = 0; in mtx1_wdt_stop()
105 mtx1_wdt_device.gstate = 0; in mtx1_wdt_stop()
106 gpiod_set_value(mtx1_wdt_device.gpiod, 0); in mtx1_wdt_stop()
108 ticks = mtx1_wdt_device.default_ticks; in mtx1_wdt_stop()
109 spin_unlock_irqrestore(&mtx1_wdt_device.lock, flags); in mtx1_wdt_stop()
117 if (test_and_set_bit(0, &mtx1_wdt_device.inuse)) in mtx1_wdt_open()
125 clear_bit(0, &mtx1_wdt_device.inuse); in mtx1_wdt_release()
200 mtx1_wdt_device.gpiod = devm_gpiod_get(&pdev->dev, in mtx1_wdt_probe()
202 if (IS_ERR(mtx1_wdt_device.gpiod)) { in mtx1_wdt_probe()
204 return PTR_ERR(mtx1_wdt_device.gpiod); in mtx1_wdt_probe()
207 spin_lock_init(&mtx1_wdt_device.lock); in mtx1_wdt_probe()
208 init_completion(&mtx1_wdt_device.stop); in mtx1_wdt_probe()
209 mtx1_wdt_device.queue = 0; in mtx1_wdt_probe()
210 clear_bit(0, &mtx1_wdt_device.inuse); in mtx1_wdt_probe()
211 timer_setup(&mtx1_wdt_device.timer, mtx1_wdt_trigger, 0); in mtx1_wdt_probe()
212 mtx1_wdt_device.default_ticks = ticks; in mtx1_wdt_probe()
227 if (mtx1_wdt_device.queue) { in mtx1_wdt_remove()
228 mtx1_wdt_device.queue = 0; in mtx1_wdt_remove()
229 wait_for_completion(&mtx1_wdt_device.stop); in mtx1_wdt_remove()