From: Shivnandan Kumar <quic_kshivnan@xxxxxxxxxxx>
SCMI QCOM vendor protocol provides interface to communicate with SCMI
controller and enable vendor specific features like bus scaling capable
of running on it.
Signed-off-by: Shivnandan Kumar <quic_kshivnan@xxxxxxxxxxx>
Co-developed-by: Ramakrishna Gottimukkula <quic_rgottimu@xxxxxxxxxxx>
Signed-off-by: Ramakrishna Gottimukkula <quic_rgottimu@xxxxxxxxxxx>
Co-developed-by: Amir Vajid <avajid@xxxxxxxxxxx>
Signed-off-by: Amir Vajid <avajid@xxxxxxxxxxx>
Co-developed-by: Sibi Sankar <quic_sibis@xxxxxxxxxxx>
Signed-off-by: Sibi Sankar <quic_sibis@xxxxxxxxxxx>
---
+
+static int qcom_scmi_set_param(const struct scmi_protocol_handle *ph, void *buf, u64 algo_str,
+ u32 param_id, size_t size)
+{
+ int ret = -EINVAL;
+ struct scmi_xfer *t;
+ u32 *msg;
+ msg = t->tx.buf;
+ *msg++ = cpu_to_le32(EXTENDED_MSG_ID);
+ *msg++ = cpu_to_le32(algo_str & GENMASK(31, 0));
+ *msg++ = cpu_to_le32((algo_str & GENMASK(63, 32)) >> 32);
+ if (t->rx.len > rx_size) {
+ pr_err("SCMI received buffer size %zu is more than expected size %zu\n",
+ t->rx.len, rx_size);
+ return -EMSGSIZE;