Commit 9eefa43a authored by Sudeep Holla's avatar Sudeep Holla

firmware: arm_scmi: Align few names in sensors protocol with SCMI specification

Looks like more code developed during the draft versions of the
specification slipped through and they don't match the final
released version. This seem to have happened only with sensor
protocol.

Renaming few command and function names here to match exactly with
the released version of SCMI specification for ease of maintenance.
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent 4752544a
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
enum scmi_sensor_protocol_cmd { enum scmi_sensor_protocol_cmd {
SENSOR_DESCRIPTION_GET = 0x3, SENSOR_DESCRIPTION_GET = 0x3,
SENSOR_CONFIG_SET = 0x4, SENSOR_TRIP_POINT_NOTIFY = 0x4,
SENSOR_TRIP_POINT_SET = 0x5, SENSOR_TRIP_POINT_CONFIG = 0x5,
SENSOR_READING_GET = 0x6, SENSOR_READING_GET = 0x6,
}; };
...@@ -42,9 +42,10 @@ struct scmi_msg_resp_sensor_description { ...@@ -42,9 +42,10 @@ struct scmi_msg_resp_sensor_description {
} desc[0]; } desc[0];
}; };
struct scmi_msg_set_sensor_config { struct scmi_msg_sensor_trip_point_notify {
__le32 id; __le32 id;
__le32 event_control; __le32 event_control;
#define SENSOR_TP_NOTIFY_ALL BIT(0)
}; };
struct scmi_msg_set_sensor_trip_point { struct scmi_msg_set_sensor_trip_point {
...@@ -160,15 +161,15 @@ static int scmi_sensor_description_get(const struct scmi_handle *handle, ...@@ -160,15 +161,15 @@ static int scmi_sensor_description_get(const struct scmi_handle *handle,
return ret; return ret;
} }
static int static int scmi_sensor_trip_point_notify(const struct scmi_handle *handle,
scmi_sensor_configuration_set(const struct scmi_handle *handle, u32 sensor_id) u32 sensor_id, bool enable)
{ {
int ret; int ret;
u32 evt_cntl = BIT(0); u32 evt_cntl = enable ? SENSOR_TP_NOTIFY_ALL : 0;
struct scmi_xfer *t; struct scmi_xfer *t;
struct scmi_msg_set_sensor_config *cfg; struct scmi_msg_sensor_trip_point_notify *cfg;
ret = scmi_xfer_get_init(handle, SENSOR_CONFIG_SET, ret = scmi_xfer_get_init(handle, SENSOR_TRIP_POINT_NOTIFY,
SCMI_PROTOCOL_SENSOR, sizeof(*cfg), 0, &t); SCMI_PROTOCOL_SENSOR, sizeof(*cfg), 0, &t);
if (ret) if (ret)
return ret; return ret;
...@@ -183,15 +184,16 @@ scmi_sensor_configuration_set(const struct scmi_handle *handle, u32 sensor_id) ...@@ -183,15 +184,16 @@ scmi_sensor_configuration_set(const struct scmi_handle *handle, u32 sensor_id)
return ret; return ret;
} }
static int scmi_sensor_trip_point_set(const struct scmi_handle *handle, static int
u32 sensor_id, u8 trip_id, u64 trip_value) scmi_sensor_trip_point_config(const struct scmi_handle *handle, u32 sensor_id,
u8 trip_id, u64 trip_value)
{ {
int ret; int ret;
u32 evt_cntl = SENSOR_TP_BOTH; u32 evt_cntl = SENSOR_TP_BOTH;
struct scmi_xfer *t; struct scmi_xfer *t;
struct scmi_msg_set_sensor_trip_point *trip; struct scmi_msg_set_sensor_trip_point *trip;
ret = scmi_xfer_get_init(handle, SENSOR_TRIP_POINT_SET, ret = scmi_xfer_get_init(handle, SENSOR_TRIP_POINT_CONFIG,
SCMI_PROTOCOL_SENSOR, sizeof(*trip), 0, &t); SCMI_PROTOCOL_SENSOR, sizeof(*trip), 0, &t);
if (ret) if (ret)
return ret; return ret;
...@@ -255,8 +257,8 @@ static int scmi_sensor_count_get(const struct scmi_handle *handle) ...@@ -255,8 +257,8 @@ static int scmi_sensor_count_get(const struct scmi_handle *handle)
static struct scmi_sensor_ops sensor_ops = { static struct scmi_sensor_ops sensor_ops = {
.count_get = scmi_sensor_count_get, .count_get = scmi_sensor_count_get,
.info_get = scmi_sensor_info_get, .info_get = scmi_sensor_info_get,
.configuration_set = scmi_sensor_configuration_set, .trip_point_notify = scmi_sensor_trip_point_notify,
.trip_point_set = scmi_sensor_trip_point_set, .trip_point_config = scmi_sensor_trip_point_config,
.reading_get = scmi_sensor_reading_get, .reading_get = scmi_sensor_reading_get,
}; };
......
...@@ -167,9 +167,9 @@ enum scmi_sensor_class { ...@@ -167,9 +167,9 @@ enum scmi_sensor_class {
* *
* @count_get: get the count of sensors provided by SCMI * @count_get: get the count of sensors provided by SCMI
* @info_get: get the information of the specified sensor * @info_get: get the information of the specified sensor
* @configuration_set: control notifications on cross-over events for * @trip_point_notify: control notifications on cross-over events for
* the trip-points * the trip-points
* @trip_point_set: selects and configures a trip-point of interest * @trip_point_config: selects and configures a trip-point of interest
* @reading_get: gets the current value of the sensor * @reading_get: gets the current value of the sensor
*/ */
struct scmi_sensor_ops { struct scmi_sensor_ops {
...@@ -177,10 +177,10 @@ struct scmi_sensor_ops { ...@@ -177,10 +177,10 @@ struct scmi_sensor_ops {
const struct scmi_sensor_info *(*info_get) const struct scmi_sensor_info *(*info_get)
(const struct scmi_handle *handle, u32 sensor_id); (const struct scmi_handle *handle, u32 sensor_id);
int (*configuration_set)(const struct scmi_handle *handle, int (*trip_point_notify)(const struct scmi_handle *handle,
u32 sensor_id); u32 sensor_id, bool enable);
int (*trip_point_set)(const struct scmi_handle *handle, u32 sensor_id, int (*trip_point_config)(const struct scmi_handle *handle,
u8 trip_id, u64 trip_value); u32 sensor_id, u8 trip_id, u64 trip_value);
int (*reading_get)(const struct scmi_handle *handle, u32 sensor_id, int (*reading_get)(const struct scmi_handle *handle, u32 sensor_id,
bool async, u64 *value); bool async, u64 *value);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment