To be used as interrupt controller, pin control callbacks needed to setup the registers. Signed-off-by: Joe Burmeister <joe.burmeister@xxxxxxxxxxxxx> --- drivers/pinctrl/pinctrl-mcp23s08.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/pinctrl/pinctrl-mcp23s08.c b/drivers/pinctrl/pinctrl-mcp23s08.c index 98905d4a79ca..3fc63cb5b332 100644 --- a/drivers/pinctrl/pinctrl-mcp23s08.c +++ b/drivers/pinctrl/pinctrl-mcp23s08.c @@ -264,6 +264,12 @@ static int mcp_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin, return ret; status = (data & BIT(pin)) ? 1 : 0; break; + case PIN_CONFIG_OUTPUT: + ret = mcp_read(mcp, MCP_IODIR, &data); + if (ret < 0) + return ret; + status = (data & BIT(pin)) ? 0 : 1; /* true is input */ + break; default: dev_err(mcp->dev, "Invalid config param %04x\n", param); return -ENOTSUPP; @@ -291,6 +297,13 @@ static int mcp_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin, case PIN_CONFIG_BIAS_PULL_UP: ret = mcp_set_bit(mcp, MCP_GPPU, pin, arg); break; + case PIN_CONFIG_OUTPUT: + ret = mcp_set_bit(mcp, MCP_IODIR, pin, false); + if (!ret && arg) + ret = mcp_set_bit(mcp, MCP_GPPU, pin, true); + else + ret = mcp_set_bit(mcp, MCP_GPPU, pin, false); + break; default: dev_err(mcp->dev, "Invalid config param %04x\n", param); return -ENOTSUPP; -- 2.20.1