Lines Matching +full:nxp +full:- +full:imx
1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2024 NXP.
23 struct scmi_protocol_handle *ph = bbnsm->ph; in scmi_imx_bbm_read_time()
27 ret = bbnsm->ops->rtc_time_get(ph, 0, &val); in scmi_imx_bbm_read_time()
39 struct scmi_protocol_handle *ph = bbnsm->ph; in scmi_imx_bbm_set_time()
44 return bbnsm->ops->rtc_time_set(ph, 0, val); in scmi_imx_bbm_set_time()
50 struct scmi_protocol_handle *ph = bbnsm->ph; in scmi_imx_bbm_alarm_irq_enable()
54 return bbnsm->ops->rtc_alarm_set(ph, 0, false, 0); in scmi_imx_bbm_alarm_irq_enable()
62 struct scmi_protocol_handle *ph = bbnsm->ph; in scmi_imx_bbm_set_alarm()
63 struct rtc_time *alrm_tm = &alrm->time; in scmi_imx_bbm_set_alarm()
68 return bbnsm->ops->rtc_alarm_set(ph, 0, true, val); in scmi_imx_bbm_set_alarm()
83 if (r->is_rtc) in scmi_imx_bbm_rtc_notifier()
84 rtc_update_irq(bbnsm->rtc_dev, 1, RTC_AF | RTC_IRQF); in scmi_imx_bbm_rtc_notifier()
93 const struct scmi_handle *handle = sdev->handle; in scmi_imx_bbm_rtc_init()
94 struct device *dev = &sdev->dev; in scmi_imx_bbm_rtc_init()
98 bbnsm->rtc_dev = devm_rtc_allocate_device(dev); in scmi_imx_bbm_rtc_init()
99 if (IS_ERR(bbnsm->rtc_dev)) in scmi_imx_bbm_rtc_init()
100 return PTR_ERR(bbnsm->rtc_dev); in scmi_imx_bbm_rtc_init()
102 bbnsm->rtc_dev->ops = &smci_imx_bbm_rtc_ops; in scmi_imx_bbm_rtc_init()
103 bbnsm->rtc_dev->range_max = U32_MAX; in scmi_imx_bbm_rtc_init()
105 bbnsm->nb.notifier_call = &scmi_imx_bbm_rtc_notifier; in scmi_imx_bbm_rtc_init()
106 ret = handle->notify_ops->devm_event_notifier_register(sdev, SCMI_PROTOCOL_IMX_BBM, in scmi_imx_bbm_rtc_init()
108 NULL, &bbnsm->nb); in scmi_imx_bbm_rtc_init()
112 return devm_rtc_register_device(bbnsm->rtc_dev); in scmi_imx_bbm_rtc_init()
117 const struct scmi_handle *handle = sdev->handle; in scmi_imx_bbm_rtc_probe()
118 struct device *dev = &sdev->dev; in scmi_imx_bbm_rtc_probe()
124 return -ENODEV; in scmi_imx_bbm_rtc_probe()
128 return -ENOMEM; in scmi_imx_bbm_rtc_probe()
130 bbnsm->ops = handle->devm_protocol_get(sdev, SCMI_PROTOCOL_IMX_BBM, &ph); in scmi_imx_bbm_rtc_probe()
131 if (IS_ERR(bbnsm->ops)) in scmi_imx_bbm_rtc_probe()
132 return PTR_ERR(bbnsm->ops); in scmi_imx_bbm_rtc_probe()
134 bbnsm->ph = ph; in scmi_imx_bbm_rtc_probe()
148 { SCMI_PROTOCOL_IMX_BBM, "imx-bbm-rtc" },
154 .name = "scmi-imx-bbm-rtc",
160 MODULE_AUTHOR("Peng Fan <peng.fan@nxp.com>");
161 MODULE_DESCRIPTION("IMX SM BBM RTC driver");