firmware: arm_scmi: Add support for clock_enable_latency
An SCMI platform can optionally advertise an enable latency typically associated with a specific clock resource: add support for parsing such optional message field and export such information in the usual publicly accessible clock descriptor. Link: https://lore.kernel.org/r/20220217131234.50328-8-cristian.marussi@arm.com Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
This commit is contained in:
parent
b7bd36f2e9
commit
18f295b758
2 changed files with 10 additions and 3 deletions
|
@ -28,6 +28,7 @@ struct scmi_msg_resp_clock_attributes {
|
||||||
__le32 attributes;
|
__le32 attributes;
|
||||||
#define CLOCK_ENABLE BIT(0)
|
#define CLOCK_ENABLE BIT(0)
|
||||||
u8 name[SCMI_MAX_STR_SIZE];
|
u8 name[SCMI_MAX_STR_SIZE];
|
||||||
|
__le32 clock_enable_latency;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct scmi_clock_set_config {
|
struct scmi_clock_set_config {
|
||||||
|
@ -116,10 +117,15 @@ static int scmi_clock_attributes_get(const struct scmi_protocol_handle *ph,
|
||||||
attr = t->rx.buf;
|
attr = t->rx.buf;
|
||||||
|
|
||||||
ret = ph->xops->do_xfer(ph, t);
|
ret = ph->xops->do_xfer(ph, t);
|
||||||
if (!ret)
|
if (!ret) {
|
||||||
strlcpy(clk->name, attr->name, SCMI_MAX_STR_SIZE);
|
strlcpy(clk->name, attr->name, SCMI_MAX_STR_SIZE);
|
||||||
else
|
/* Is optional field clock_enable_latency provided ? */
|
||||||
|
if (t->rx.len == sizeof(*attr))
|
||||||
|
clk->enable_latency =
|
||||||
|
le32_to_cpu(attr->clock_enable_latency);
|
||||||
|
} else {
|
||||||
clk->name[0] = '\0';
|
clk->name[0] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
ph->xops->xfer_put(ph, t);
|
ph->xops->xfer_put(ph, t);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -42,6 +42,7 @@ struct scmi_revision_info {
|
||||||
|
|
||||||
struct scmi_clock_info {
|
struct scmi_clock_info {
|
||||||
char name[SCMI_MAX_STR_SIZE];
|
char name[SCMI_MAX_STR_SIZE];
|
||||||
|
unsigned int enable_latency;
|
||||||
bool rate_discrete;
|
bool rate_discrete;
|
||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
|
|
Loading…
Add table
Reference in a new issue