}
static int scmi_mbox_get_channel(struct udevice *dev,
+ struct udevice *protocol,
struct scmi_channel **channel)
{
struct scmi_mbox_channel *base_chan = dev_get_plat(dev);
struct scmi_mbox_channel *chan;
int ret;
- if (!dev_read_prop(dev, "shmem", NULL)) {
+ if (!dev_read_prop(protocol, "shmem", NULL)) {
/* Uses agent base channel */
*channel = container_of(base_chan, struct scmi_channel, ref);
return -ENOMEM;
/* Setup a dedicated channel for the protocol */
- ret = setup_channel(dev, chan);
+ ret = setup_channel(protocol, chan);
if (ret) {
free(chan);
return ret;
}
static int scmi_optee_get_channel(struct udevice *dev,
+ struct udevice *protocol,
struct scmi_channel **channel)
{
struct scmi_optee_channel *base_chan = dev_get_plat(dev);
u32 channel_id;
int ret;
- if (dev_read_u32(dev, "linaro,optee-channel-id", &channel_id)) {
+ if (dev_read_u32(protocol, "linaro,optee-channel-id", &channel_id)) {
/* Uses agent base channel */
*channel = container_of(base_chan, struct scmi_channel, ref);
if (!chan)
return -ENOMEM;
- ret = setup_channel(dev, chan);
+ ret = setup_channel(protocol, chan);
if (ret) {
free(chan);
return ret;
* On return, @channel will be set.
* Return 0 on success and a negative errno on failure
*/
-static int scmi_of_get_channel(struct udevice *dev, struct scmi_channel **channel)
+static int scmi_of_get_channel(struct udevice *dev, struct udevice *protocol,
+ struct scmi_channel **channel)
{
const struct scmi_agent_ops *ops;
ops = transport_dev_ops(dev);
if (ops->of_get_channel)
- return ops->of_get_channel(dev, channel);
+ return ops->of_get_channel(dev, protocol, channel);
else
return -EPROTONOSUPPORT;
}
return -ENODEV;
priv = dev_get_parent_priv(protocol);
- ret = scmi_of_get_channel(protocol->parent, &priv->channel);
+ ret = scmi_of_get_channel(protocol->parent, protocol, &priv->channel);
if (ret == -EPROTONOSUPPORT) {
/* Drivers without a get_channel operator don't need a channel ref */
priv->channel = NULL;
}
static int scmi_smccc_get_channel(struct udevice *dev,
+ struct udevice *protocol,
struct scmi_channel **channel)
{
struct scmi_smccc_channel *base_chan = dev_get_plat(dev);
u32 func_id;
int ret;
- if (dev_read_u32(dev, "arm,smc-id", &func_id)) {
+ if (dev_read_u32(protocol, "arm,smc-id", &func_id)) {
/* Uses agent base channel */
*channel = container_of(base_chan, struct scmi_channel, ref);
if (!chan)
return -ENOMEM;
- ret = setup_channel(dev, chan);
+ ret = setup_channel(protocol, chan);
if (ret) {
free(chan);
return ret;
/*
* of_get_channel - Get SCMI channel from SCMI agent device tree node
*
- * @dev: SCMI protocol device using the transport
+ * @dev: SCMI agent device using the transport
+ * @protocol: SCMI protocol device using the transport
* @channel: Output reference to SCMI channel upon success
* Return 0 upon success and a negative errno on failure
*/
- int (*of_get_channel)(struct udevice *dev, struct scmi_channel **channel);
+ int (*of_get_channel)(struct udevice *dev, struct udevice *protocol,
+ struct scmi_channel **channel);
/*
* process_msg - Request transport to get the SCMI message processed
*
- * @dev: SCMI protocol device using the transport
+ * @dev: SCMI agent device using the transport
* @msg: SCMI message to be transmitted
*/
int (*process_msg)(struct udevice *dev, struct scmi_channel *channel,