firmware: arm_scpi: Extend to support sensors

ARM System Control Processor (SCP) provides an API to query and use
the sensors available in the system. Extend the SCPI driver to support
 sensor messages.

Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
This commit is contained in:
Punit Agrawal
2015-06-19 15:31:46 +01:00
committed by Sudeep Holla
parent d8a44fe7b5
commit 38a1bdc9ff
2 changed files with 77 additions and 0 deletions

View File

@@ -28,6 +28,20 @@ struct scpi_dvfs_info {
struct scpi_opp *opps;
};
enum scpi_sensor_class {
TEMPERATURE,
VOLTAGE,
CURRENT,
POWER,
};
struct scpi_sensor_info {
u16 sensor_id;
u8 class;
u8 trigger_type;
char name[20];
} __packed;
/**
* struct scpi_ops - represents the various operations provided
* by SCP through SCPI message protocol
@@ -52,6 +66,9 @@ struct scpi_ops {
int (*dvfs_get_idx)(u8);
int (*dvfs_set_idx)(u8, u8);
struct scpi_dvfs_info *(*dvfs_get_info)(u8);
int (*sensor_get_capability)(u16 *sensors);
int (*sensor_get_info)(u16 sensor_id, struct scpi_sensor_info *);
int (*sensor_get_value)(u16, u32 *);
};
#if IS_ENABLED(CONFIG_ARM_SCPI_PROTOCOL)