firmware: scmi_agent: add SCMI pin control protocol support
This patch adds SCMI pin control protocol support to make the pin controller driver based on SCMI, such as drivers/pinctrl/nxp/pinctrl-imx-scmi.c, can be bound to the SCMI agent device whose protocol id is 0x19. Signed-off-by: Alice Guo <alice.guo@nxp.com>
This commit is contained in:
@@ -97,6 +97,9 @@ struct udevice *scmi_get_protocol(struct udevice *dev,
|
||||
case SCMI_PROTOCOL_ID_VOLTAGE_DOMAIN:
|
||||
proto = priv->voltagedom_dev;
|
||||
break;
|
||||
case SCMI_PROTOCOL_ID_PINCTRL:
|
||||
proto = priv->pinctrl_dev;
|
||||
break;
|
||||
default:
|
||||
dev_err(dev, "Protocol not supported\n");
|
||||
proto = NULL;
|
||||
@@ -147,6 +150,9 @@ static int scmi_add_protocol(struct udevice *dev,
|
||||
case SCMI_PROTOCOL_ID_VOLTAGE_DOMAIN:
|
||||
priv->voltagedom_dev = proto;
|
||||
break;
|
||||
case SCMI_PROTOCOL_ID_PINCTRL:
|
||||
priv->pinctrl_dev = proto;
|
||||
break;
|
||||
default:
|
||||
dev_err(dev, "Protocol not supported\n");
|
||||
return -EPROTO;
|
||||
|
@@ -10,6 +10,7 @@
|
||||
#include <dm/devres.h>
|
||||
#include <dm/pinctrl.h>
|
||||
#include <scmi_agent.h>
|
||||
#include <scmi_agent-uclass.h>
|
||||
#include <scmi_protocols.h>
|
||||
|
||||
#include "pinctrl-imx.h"
|
||||
@@ -155,3 +156,10 @@ U_BOOT_DRIVER(scmi_pinctrl_imx) = {
|
||||
.ops = &imx_scmi_pinctrl_ops,
|
||||
.flags = DM_FLAG_PRE_RELOC,
|
||||
};
|
||||
|
||||
static struct scmi_proto_match match[] = {
|
||||
{ .proto_id = SCMI_PROTOCOL_ID_PINCTRL },
|
||||
{ /* Sentinel */ }
|
||||
};
|
||||
|
||||
U_BOOT_SCMI_PROTO_DRIVER(scmi_pinctrl_imx, match);
|
||||
|
@@ -27,6 +27,7 @@ struct scmi_channel;
|
||||
* @clock_dev: SCMI clock protocol device
|
||||
* @resetdom_dev: SCMI reset domain protocol device
|
||||
* @voltagedom_dev: SCMI voltage domain protocol device
|
||||
* @pinctrl_dev: SCMI pin control protocol device
|
||||
*/
|
||||
struct scmi_agent_priv {
|
||||
u32 version;
|
||||
@@ -43,6 +44,7 @@ struct scmi_agent_priv {
|
||||
struct udevice *clock_dev;
|
||||
struct udevice *resetdom_dev;
|
||||
struct udevice *voltagedom_dev;
|
||||
struct udevice *pinctrl_dev;
|
||||
};
|
||||
|
||||
static inline u32 scmi_version(struct udevice *dev)
|
||||
|
Reference in New Issue
Block a user