1 /* SPDX-License-Identifier: GPL-2.0-only */ 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 2 /* 3 * SCMI Message Protocol driver NXP extension 3 * SCMI Message Protocol driver NXP extension header 4 * 4 * 5 * Copyright 2024 NXP. 5 * Copyright 2024 NXP. 6 */ 6 */ 7 7 8 #ifndef _LINUX_SCMI_NXP_PROTOCOL_H 8 #ifndef _LINUX_SCMI_NXP_PROTOCOL_H 9 #define _LINUX_SCMI_NXP_PROTOCOL_H 9 #define _LINUX_SCMI_NXP_PROTOCOL_H 10 10 11 #include <linux/bitfield.h> 11 #include <linux/bitfield.h> 12 #include <linux/device.h> 12 #include <linux/device.h> 13 #include <linux/notifier.h> 13 #include <linux/notifier.h> 14 #include <linux/types.h> 14 #include <linux/types.h> 15 15 16 enum scmi_nxp_protocol { 16 enum scmi_nxp_protocol { 17 SCMI_PROTOCOL_IMX_BBM = 0x81, 17 SCMI_PROTOCOL_IMX_BBM = 0x81, 18 SCMI_PROTOCOL_IMX_MISC = 0x84, 18 SCMI_PROTOCOL_IMX_MISC = 0x84, 19 }; 19 }; 20 20 21 struct scmi_imx_bbm_proto_ops { 21 struct scmi_imx_bbm_proto_ops { 22 int (*rtc_time_set)(const struct scmi_ 22 int (*rtc_time_set)(const struct scmi_protocol_handle *ph, u32 id, 23 uint64_t sec); 23 uint64_t sec); 24 int (*rtc_time_get)(const struct scmi_ 24 int (*rtc_time_get)(const struct scmi_protocol_handle *ph, u32 id, 25 u64 *val); 25 u64 *val); 26 int (*rtc_alarm_set)(const struct scmi 26 int (*rtc_alarm_set)(const struct scmi_protocol_handle *ph, u32 id, 27 bool enable, u64 27 bool enable, u64 sec); 28 int (*button_get)(const struct scmi_pr 28 int (*button_get)(const struct scmi_protocol_handle *ph, u32 *state); 29 }; 29 }; 30 30 31 enum scmi_nxp_notification_events { 31 enum scmi_nxp_notification_events { 32 SCMI_EVENT_IMX_BBM_RTC = 0x0, 32 SCMI_EVENT_IMX_BBM_RTC = 0x0, 33 SCMI_EVENT_IMX_BBM_BUTTON = 0x1, 33 SCMI_EVENT_IMX_BBM_BUTTON = 0x1, 34 SCMI_EVENT_IMX_MISC_CONTROL = 0x0, 34 SCMI_EVENT_IMX_MISC_CONTROL = 0x0, 35 }; 35 }; 36 36 37 struct scmi_imx_bbm_notif_report { 37 struct scmi_imx_bbm_notif_report { 38 bool is_rtc; 38 bool is_rtc; 39 bool is_button; 39 bool is_button; 40 ktime_t timestamp; 40 ktime_t timestamp; 41 unsigned int rtc_id; 41 unsigned int rtc_id; 42 unsigned int rtc_evt; 42 unsigned int rtc_evt; 43 }; 43 }; 44 44 45 struct scmi_imx_misc_ctrl_notify_report { 45 struct scmi_imx_misc_ctrl_notify_report { 46 ktime_t timestamp; 46 ktime_t timestamp; 47 unsigned int ctrl_id; 47 unsigned int ctrl_id; 48 unsigned int flags; 48 unsigned int flags; 49 }; 49 }; 50 50 51 struct scmi_imx_misc_proto_ops { 51 struct scmi_imx_misc_proto_ops { 52 int (*misc_ctrl_set)(const struct scmi 52 int (*misc_ctrl_set)(const struct scmi_protocol_handle *ph, u32 id, 53 u32 num, u32 *val 53 u32 num, u32 *val); 54 int (*misc_ctrl_get)(const struct scmi 54 int (*misc_ctrl_get)(const struct scmi_protocol_handle *ph, u32 id, 55 u32 *num, u32 *va 55 u32 *num, u32 *val); 56 int (*misc_ctrl_req_notify)(const stru 56 int (*misc_ctrl_req_notify)(const struct scmi_protocol_handle *ph, 57 u32 ctrl_i 57 u32 ctrl_id, u32 evt_id, u32 flags); 58 }; 58 }; 59 #endif 59 #endif 60 60
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.