Lines Matching refs: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,
54 static int smcwd_ping(struct watchdog_device *wdd)
56 return smcwd_call(wdd, SMCWD_PET, 0, NULL);
59 static unsigned int smcwd_get_timeleft(struct watchdog_device *wdd)
63 smcwd_call(wdd, SMCWD_GET_TIMELEFT, 0, &res);
69 static int smcwd_set_timeout(struct watchdog_device *wdd, unsigned int timeout)
73 res = smcwd_call(wdd, SMCWD_SET_TIMEOUT, timeout, NULL);
75 wdd->timeout = timeout;
79 static int smcwd_stop(struct watchdog_device *wdd)
81 return smcwd_call(wdd, SMCWD_ENABLE, 0, NULL);
84 static int smcwd_start(struct watchdog_device *wdd)
86 return smcwd_call(wdd, SMCWD_ENABLE, 1, NULL);
113 struct watchdog_device *wdd;
118 wdd = devm_kzalloc(&pdev->dev, sizeof(*wdd), GFP_KERNEL);
119 if (!wdd)
121 platform_set_drvdata(pdev, wdd);
126 watchdog_set_drvdata(wdd, (void *)(uintptr_t)smc_func_id);
128 err = smcwd_call(wdd, SMCWD_INIT, 0, &res);
132 wdd->info = &smcwd_info;
134 if (smcwd_call(wdd, SMCWD_GET_TIMELEFT, 0, NULL))
135 wdd->ops = &smcwd_ops;
137 wdd->ops = &smcwd_timeleft_ops;
138 wdd->timeout = res.a2;
139 wdd->max_timeout = res.a2;
140 wdd->min_timeout = res.a1;
141 wdd->parent = &pdev->dev;
143 watchdog_stop_on_reboot(wdd);
144 watchdog_stop_on_unregister(wdd);
145 watchdog_set_nowayout(wdd, nowayout);
146 watchdog_init_timeout(wdd, timeout, &pdev->dev);
147 err = smcwd_set_timeout(wdd, wdd->timeout);
151 err = devm_watchdog_register_device(&pdev->dev, wdd);
157 wdd->timeout, nowayout);