summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2020-09-15 08:10:40 -0700
committerOlof Johansson <olof@lixom.net>2020-09-15 08:10:41 -0700
commit8119f4b91d54104884ceeed7d97a4eb4cf003c69 (patch)
tree085b083dc76d4dbebed62542c24b1e44d89a19eb /include
parentbd2fad8cd302ba88b9ae32ac4bfcbddfae443858 (diff)
parent66d90f6ecee755e9c19a119c9255e80091165498 (diff)
downloadlinux-8119f4b91d54104884ceeed7d97a4eb4cf003c69.tar.bz2
Merge tag 'scmi-updates-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/drivers
ARM SCMI updates for v5.10 Couple of main additions: SCMI system protocol support and ability to build SCMI driver as a single module which is needed by some transports like virtio as they may not be ready early during the boot. This also includes constification of scmi ops and related function pointers. * tag 'scmi-updates-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_scmi: Enable building as a single module firmware: arm_scmi: Move scmi protocols registration into the driver firmware: arm_scmi: Move scmi bus init and exit calls into the driver firmware: smccc: Export both smccc functions firmware: arm_scmi: Fix NULL pointer dereference in mailbox_chan_free firmware: arm_scmi: Add SCMI device for system power protocol firmware: arm_scmi: Add system power protocol support firmware: arm_scmi: Constify static scmi-ops firmware: arm_scmi: Constify ops pointers in scmi_handle cpufreq: arm_scmi: Constify scmi_perf_ops pointers Link: https://lore.kernel.org/r/20200914075018.2rvytvghxyutcbk4@bogus Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/scmi_protocol.h32
1 files changed, 25 insertions, 7 deletions
diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
index 7e5dd7d1e221..9cd312a1ff92 100644
--- a/include/linux/scmi_protocol.h
+++ b/include/linux/scmi_protocol.h
@@ -279,12 +279,12 @@ struct scmi_notify_ops {
struct scmi_handle {
struct device *dev;
struct scmi_revision_info *version;
- struct scmi_perf_ops *perf_ops;
- struct scmi_clk_ops *clk_ops;
- struct scmi_power_ops *power_ops;
- struct scmi_sensor_ops *sensor_ops;
- struct scmi_reset_ops *reset_ops;
- struct scmi_notify_ops *notify_ops;
+ const struct scmi_perf_ops *perf_ops;
+ const struct scmi_clk_ops *clk_ops;
+ const struct scmi_power_ops *power_ops;
+ const struct scmi_sensor_ops *sensor_ops;
+ const struct scmi_reset_ops *reset_ops;
+ const struct scmi_notify_ops *notify_ops;
/* for protocol internal use */
void *perf_priv;
void *clk_priv;
@@ -292,6 +292,7 @@ struct scmi_handle {
void *sensor_priv;
void *reset_priv;
void *notify_priv;
+ void *system_priv;
};
enum scmi_std_protocol {
@@ -304,6 +305,15 @@ enum scmi_std_protocol {
SCMI_PROTOCOL_RESET = 0x16,
};
+enum scmi_system_events {
+ SCMI_SYSTEM_SHUTDOWN,
+ SCMI_SYSTEM_COLDRESET,
+ SCMI_SYSTEM_WARMRESET,
+ SCMI_SYSTEM_POWERUP,
+ SCMI_SYSTEM_SUSPEND,
+ SCMI_SYSTEM_MAX
+};
+
struct scmi_device {
u32 id;
u8 protocol_id;
@@ -335,7 +345,7 @@ struct scmi_driver {
#define to_scmi_driver(d) container_of(d, struct scmi_driver, driver)
-#ifdef CONFIG_ARM_SCMI_PROTOCOL
+#if IS_REACHABLE(CONFIG_ARM_SCMI_PROTOCOL)
int scmi_driver_register(struct scmi_driver *driver,
struct module *owner, const char *mod_name);
void scmi_driver_unregister(struct scmi_driver *driver);
@@ -378,6 +388,7 @@ enum scmi_notification_events {
SCMI_EVENT_SENSOR_TRIP_POINT_EVENT = 0x0,
SCMI_EVENT_RESET_ISSUED = 0x0,
SCMI_EVENT_BASE_ERROR_EVENT = 0x0,
+ SCMI_EVENT_SYSTEM_POWER_STATE_NOTIFIER = 0x0,
};
struct scmi_power_state_changed_report {
@@ -387,6 +398,13 @@ struct scmi_power_state_changed_report {
unsigned int power_state;
};
+struct scmi_system_power_state_notifier_report {
+ ktime_t timestamp;
+ unsigned int agent_id;
+ unsigned int flags;
+ unsigned int system_state;
+};
+
struct scmi_perf_limits_report {
ktime_t timestamp;
unsigned int agent_id;