Lines Matching defs:wdd
34 static int smcwd_call(struct watchdog_device *wdd, enum smcwd_call call,
42 arm_smccc_smc((u32)(uintptr_t)watchdog_get_drvdata(wdd), call, arg, 0,
56 static int smcwd_ping(struct watchdog_device *wdd)
58 return smcwd_call(wdd, SMCWD_PET, 0, NULL);
61 static unsigned int smcwd_get_timeleft(struct watchdog_device *wdd)
65 smcwd_call(wdd, SMCWD_GET_TIMELEFT, 0, &res);
71 static int smcwd_set_timeout(struct watchdog_device *wdd, unsigned int timeout)
75 res = smcwd_call(wdd, SMCWD_SET_TIMEOUT, timeout, NULL);
77 wdd->timeout = timeout;
81 static int smcwd_stop(struct watchdog_device *wdd)
83 return smcwd_call(wdd, SMCWD_ENABLE, 0, NULL);
86 static int smcwd_start(struct watchdog_device *wdd)
88 return smcwd_call(wdd, SMCWD_ENABLE, 1, NULL);
115 struct watchdog_device *wdd;
120 wdd = devm_kzalloc(&pdev->dev, sizeof(*wdd), GFP_KERNEL);
121 if (!wdd)
123 platform_set_drvdata(pdev, wdd);
128 watchdog_set_drvdata(wdd, (void *)(uintptr_t)smc_func_id);
130 err = smcwd_call(wdd, SMCWD_INIT, 0, &res);
134 wdd->info = &smcwd_info;
136 err = smcwd_call(wdd, SMCWD_GET_TIMELEFT, 0, NULL);
139 set_bit(WDOG_HW_RUNNING, &wdd->status);
142 wdd->ops = &smcwd_timeleft_ops;
145 wdd->ops = &smcwd_ops;
149 wdd->timeout = res.a2;
150 wdd->max_timeout = res.a2;
151 wdd->min_timeout = res.a1;
152 wdd->parent = &pdev->dev;
154 watchdog_stop_on_reboot(wdd);
155 watchdog_stop_on_unregister(wdd);
156 watchdog_set_nowayout(wdd, nowayout);
157 watchdog_init_timeout(wdd, timeout, &pdev->dev);
158 err = smcwd_set_timeout(wdd, wdd->timeout);
162 err = devm_watchdog_register_device(&pdev->dev, wdd);
168 wdd->timeout, nowayout);