Commit f274fffb authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull pin control fixes from Linus Walleij:

 - A small Kconfig fixup for the i.MX.

   In principle this could come in from the SoC tree but the bug was
   introduced from the pin control tree so let's fix it from here.

 - Fix a sleep in atomic context in the MCP23xxx GPIO expander by
   disabling the regmap locking and using explicit mutex locks.

* tag 'pinctrl-v6.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: mcp23s08: Fix sleeping in atomic context due to regmap locking
  ARM: imx: Re-introduce the PINCTRL selection
parents 4f5d3da6 a37eecb7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ menuconfig ARCH_MXC
	select CLKSRC_IMX_GPT
	select GENERIC_IRQ_CHIP
	select GPIOLIB
	select PINCTRL
	select PM_OPP if PM
	select SOC_BUS
	select SRAM
+6 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ const struct regmap_config mcp23x08_regmap = {
	.num_reg_defaults = ARRAY_SIZE(mcp23x08_defaults),
	.cache_type = REGCACHE_FLAT,
	.max_register = MCP_OLAT,
	.disable_locking = true, /* mcp->lock protects the regmap */
};
EXPORT_SYMBOL_GPL(mcp23x08_regmap);

@@ -132,6 +133,7 @@ const struct regmap_config mcp23x17_regmap = {
	.num_reg_defaults = ARRAY_SIZE(mcp23x17_defaults),
	.cache_type = REGCACHE_FLAT,
	.val_format_endian = REGMAP_ENDIAN_LITTLE,
	.disable_locking = true, /* mcp->lock protects the regmap */
};
EXPORT_SYMBOL_GPL(mcp23x17_regmap);

@@ -228,7 +230,9 @@ static int mcp_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin,

	switch (param) {
	case PIN_CONFIG_BIAS_PULL_UP:
		mutex_lock(&mcp->lock);
		ret = mcp_read(mcp, MCP_GPPU, &data);
		mutex_unlock(&mcp->lock);
		if (ret < 0)
			return ret;
		status = (data & BIT(pin)) ? 1 : 0;
@@ -257,7 +261,9 @@ static int mcp_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,

		switch (param) {
		case PIN_CONFIG_BIAS_PULL_UP:
			mutex_lock(&mcp->lock);
			ret = mcp_set_bit(mcp, MCP_GPPU, pin, arg);
			mutex_unlock(&mcp->lock);
			break;
		default:
			dev_dbg(mcp->dev, "Invalid config param %04x\n", param);