Lines Matching +full:mt6323 +full:- +full:rtc
1 // SPDX-License-Identifier: GPL-2.0
16 #include <linux/mfd/mt6397/rtc.h>
27 struct mt6323_pwrc *pwrc = data->cb_data; in mt6323_do_pwroff()
31 regmap_write(pwrc->regmap, pwrc->base + RTC_BBPU, RTC_BBPU_KEY); in mt6323_do_pwroff()
32 regmap_write(pwrc->regmap, pwrc->base + RTC_WRTGR_MT6323, 1); in mt6323_do_pwroff()
34 ret = regmap_read_poll_timeout(pwrc->regmap, in mt6323_do_pwroff()
35 pwrc->base + RTC_BBPU, val, in mt6323_do_pwroff()
40 dev_err(pwrc->dev, "failed to write BBPU: %d\n", ret); in mt6323_do_pwroff()
52 struct mt6397_chip *mt6397_chip = dev_get_drvdata(pdev->dev.parent); in mt6323_pwrc_probe()
57 pwrc = devm_kzalloc(&pdev->dev, sizeof(*pwrc), GFP_KERNEL); in mt6323_pwrc_probe()
59 return -ENOMEM; in mt6323_pwrc_probe()
63 return -EINVAL; in mt6323_pwrc_probe()
65 pwrc->base = res->start; in mt6323_pwrc_probe()
66 pwrc->regmap = mt6397_chip->regmap; in mt6323_pwrc_probe()
67 pwrc->dev = &pdev->dev; in mt6323_pwrc_probe()
69 ret = devm_register_sys_off_handler(pwrc->dev, in mt6323_pwrc_probe()
75 return dev_err_probe(pwrc->dev, ret, "failed to register power-off handler\n"); in mt6323_pwrc_probe()
81 { .compatible = "mediatek,mt6323-pwrc" },
89 .name = "mt6323-pwrc",
96 MODULE_DESCRIPTION("Poweroff driver for MT6323 PMIC");