Lines Matching +full:use +full:- +full:sw +full:- +full:pm

1 // SPDX-License-Identifier: GPL-2.0+
27 * others: timeout = 2048 ms * 2^(TWDSCALE-1).
34 #define DA9063_TWDSCALE_MAX (ARRAY_SIZE(wdt_timeout) - 1)
60 regmap_read(da9063->regmap, DA9063_REG_CONTROL_D, &val); in da9063_wdt_read_timeout()
67 return regmap_update_bits(da9063->regmap, DA9063_REG_CONTROL_D, in da9063_wdt_disable_timer()
93 return regmap_update_bits(da9063->regmap, DA9063_REG_CONTROL_D, in da9063_wdt_update_timeout()
102 ret = da9063_wdt_update_timeout(da9063, wdd->timeout); in da9063_wdt_start()
104 dev_err(da9063->dev, "Watchdog failed to start (err = %d)\n", in da9063_wdt_start()
117 dev_alert(da9063->dev, "Watchdog failed to stop (err = %d)\n", in da9063_wdt_stop()
135 ret = regmap_write(da9063->regmap, DA9063_REG_CONTROL_F, in da9063_wdt_ping()
138 dev_alert(da9063->dev, "Failed to ping the watchdog (err = %d)\n", in da9063_wdt_ping()
153 * further use. in da9063_wdt_set_timeout()
164 dev_err(da9063->dev, "Failed to set watchdog timeout (err = %d)\n", in da9063_wdt_set_timeout()
167 wdd->timeout = wdt_timeout[da9063_wdt_timeout_to_sel(timeout)]; in da9063_wdt_set_timeout()
176 struct i2c_client *client = to_i2c_client(da9063->dev); in da9063_wdt_restart()
179 /* Don't use regmap because it is not atomic safe */ in da9063_wdt_restart()
183 dev_alert(da9063->dev, "Failed to shutdown (err = %d)\n", in da9063_wdt_restart()
208 struct device *dev = &pdev->dev; in da9063_wdt_probe()
213 if (!dev->parent) in da9063_wdt_probe()
214 return -EINVAL; in da9063_wdt_probe()
216 da9063 = dev_get_drvdata(dev->parent); in da9063_wdt_probe()
218 return -EINVAL; in da9063_wdt_probe()
222 return -ENOMEM; in da9063_wdt_probe()
224 use_sw_pm = device_property_present(dev, "dlg,use-sw-pm"); in da9063_wdt_probe()
226 wdd->info = &da9063_watchdog_info; in da9063_wdt_probe()
227 wdd->ops = &da9063_watchdog_ops; in da9063_wdt_probe()
228 wdd->min_timeout = DA9063_WDT_MIN_TIMEOUT; in da9063_wdt_probe()
229 wdd->max_timeout = DA9063_WDT_MAX_TIMEOUT; in da9063_wdt_probe()
230 wdd->min_hw_heartbeat_ms = DA9063_RESET_PROTECTION_MS; in da9063_wdt_probe()
231 wdd->parent = dev; in da9063_wdt_probe()
232 wdd->status = WATCHDOG_NOWAYOUT_INIT_STATUS; in da9063_wdt_probe()
238 wdd->timeout = DA9063_WDG_TIMEOUT; in da9063_wdt_probe()
240 /* Use pre-configured timeout if watchdog is already running. */ in da9063_wdt_probe()
243 wdd->timeout = timeout; in da9063_wdt_probe()
247 da9063_wdt_set_timeout(wdd, wdd->timeout); in da9063_wdt_probe()
251 da9063_wdt_update_timeout(da9063, wdd->timeout); in da9063_wdt_probe()
252 set_bit(WDOG_HW_RUNNING, &wdd->status); in da9063_wdt_probe()
291 .pm = &da9063_wdt_pm_ops,