FROMLIST: firmware: arm_scmi: port Sensor protocol to new protocols interface
Convert internals of protocol implementation to use protocol handles and expose a new protocol operations interface for SCMI driver using the new get/put common operations, while keeping the old handle->sensor_ops still around to ease transition. Remove handle->sensor_priv now unused. Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Bug: 171409184 Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/ Change-Id: I5928b7dfa0828139c9c4edf81169ea875119ebc6 Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
This commit is contained in:

committed by
Todd Kjos

parent
7552e331c6
commit
5d63c651d6
@@ -431,7 +431,7 @@ enum scmi_sensor_class {
|
||||
};
|
||||
|
||||
/**
|
||||
* struct scmi_sensor_ops - represents the various operations provided
|
||||
* struct scmi_sensor_proto_ops - represents the various operations provided
|
||||
* by SCMI Sensor Protocol
|
||||
*
|
||||
* @count_get: get the count of sensors provided by SCMI
|
||||
@@ -446,6 +446,23 @@ enum scmi_sensor_class {
|
||||
* @config_get: Get sensor current configuration
|
||||
* @config_set: Set sensor current configuration
|
||||
*/
|
||||
struct scmi_sensor_proto_ops {
|
||||
int (*count_get)(const struct scmi_protocol_handle *ph);
|
||||
const struct scmi_sensor_info *(*info_get)
|
||||
(const struct scmi_protocol_handle *ph, u32 sensor_id);
|
||||
int (*trip_point_config)(const struct scmi_protocol_handle *ph,
|
||||
u32 sensor_id, u8 trip_id, u64 trip_value);
|
||||
int (*reading_get)(const struct scmi_protocol_handle *ph, u32 sensor_id,
|
||||
u64 *value);
|
||||
int (*reading_get_timestamped)(const struct scmi_protocol_handle *ph,
|
||||
u32 sensor_id, u8 count,
|
||||
struct scmi_sensor_reading *readings);
|
||||
int (*config_get)(const struct scmi_protocol_handle *ph,
|
||||
u32 sensor_id, u32 *sensor_config);
|
||||
int (*config_set)(const struct scmi_protocol_handle *ph,
|
||||
u32 sensor_id, u32 sensor_config);
|
||||
};
|
||||
|
||||
struct scmi_sensor_ops {
|
||||
int (*count_get)(const struct scmi_handle *handle);
|
||||
const struct scmi_sensor_info *(*info_get)
|
||||
@@ -614,8 +631,6 @@ struct scmi_notify_ops {
|
||||
* @devm_put_protocol: devres managed method to release a protocol acquired
|
||||
* with devm_acquire/get_protocol
|
||||
* @notify_ops: pointer to set of notifications related operations
|
||||
* @sensor_priv: pointer to private data structure specific to sensors
|
||||
* protocol(for internal use only)
|
||||
* @voltage_priv: pointer to private data structure specific to voltage
|
||||
* protocol(for internal use only)
|
||||
* @notify_priv: pointer to private data structure specific to notifications
|
||||
@@ -636,7 +651,6 @@ struct scmi_handle {
|
||||
|
||||
const struct scmi_notify_ops *notify_ops;
|
||||
/* for protocol internal use */
|
||||
void *sensor_priv;
|
||||
void *voltage_priv;
|
||||
void *notify_priv;
|
||||
void *system_priv;
|
||||
|
Reference in New Issue
Block a user