Skip to content

Commit 545c80a

Browse files
committed
Merge tag 'pinctrl-v6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control fixes from Linus Walleij: "Some assorted pin control fixes, the most interesting will be the Intel patch fixing a classic problem: laptop touchpad IRQs... - Some pin drive register fixes in the Mediatek driver. - Return proper error code in the Aspeed driver, and revert and ill-advised force-disablement patch that needs to be reworked. - Fix AMD driver debug output. - Fix potential NULL dereference in the Single driver. - Fix a group definition error in the Qualcomm SM8450 LPASS driver. - Restore pins used in direct IRQ mode in the Intel driver (This fixes some laptop touchpads!)" * tag 'pinctrl-v6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: intel: Restore the pins that used to be in Direct IRQ mode pinctrl: qcom: sm8450-lpass-lpi: correct swr_rx_data group pinctrl: aspeed: Revert "Force to disable the function's signal" pinctrl: single: fix potential NULL dereference pinctrl: amd: Fix debug output for debounce time pinctrl: aspeed: Fix confusing types in return value pinctrl: mediatek: Fix the drive register definition of some Pins
2 parents 4cfd5af + a8520be commit 545c80a

File tree

6 files changed

+30
-8
lines changed

6 files changed

+30
-8
lines changed

drivers/pinctrl/aspeed/pinctrl-aspeed.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,19 @@ static int aspeed_sig_expr_enable(struct aspeed_pinmux_data *ctx,
9393
static int aspeed_sig_expr_disable(struct aspeed_pinmux_data *ctx,
9494
const struct aspeed_sig_expr *expr)
9595
{
96+
int ret;
97+
9698
pr_debug("Disabling signal %s for %s\n", expr->signal,
9799
expr->function);
98100

99-
return aspeed_sig_expr_set(ctx, expr, false);
101+
ret = aspeed_sig_expr_eval(ctx, expr, true);
102+
if (ret < 0)
103+
return ret;
104+
105+
if (ret)
106+
return aspeed_sig_expr_set(ctx, expr, false);
107+
108+
return 0;
100109
}
101110

102111
/**
@@ -114,7 +123,7 @@ static int aspeed_disable_sig(struct aspeed_pinmux_data *ctx,
114123
int ret = 0;
115124

116125
if (!exprs)
117-
return true;
126+
return -EINVAL;
118127

119128
while (*exprs && !ret) {
120129
ret = aspeed_sig_expr_disable(ctx, *exprs);

drivers/pinctrl/intel/pinctrl-intel.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,6 +1709,12 @@ const struct intel_pinctrl_soc_data *intel_pinctrl_get_soc_data(struct platform_
17091709
EXPORT_SYMBOL_GPL(intel_pinctrl_get_soc_data);
17101710

17111711
#ifdef CONFIG_PM_SLEEP
1712+
static bool __intel_gpio_is_direct_irq(u32 value)
1713+
{
1714+
return (value & PADCFG0_GPIROUTIOXAPIC) && (value & PADCFG0_GPIOTXDIS) &&
1715+
(__intel_gpio_get_gpio_mode(value) == PADCFG0_PMODE_GPIO);
1716+
}
1717+
17121718
static bool intel_pinctrl_should_save(struct intel_pinctrl *pctrl, unsigned int pin)
17131719
{
17141720
const struct pin_desc *pd = pin_desc_get(pctrl->pctldev, pin);
@@ -1742,8 +1748,7 @@ static bool intel_pinctrl_should_save(struct intel_pinctrl *pctrl, unsigned int
17421748
* See https://bugzilla.kernel.org/show_bug.cgi?id=214749.
17431749
*/
17441750
value = readl(intel_get_padcfg(pctrl, pin, PADCFG0));
1745-
if ((value & PADCFG0_GPIROUTIOXAPIC) && (value & PADCFG0_GPIOTXDIS) &&
1746-
(__intel_gpio_get_gpio_mode(value) == PADCFG0_PMODE_GPIO))
1751+
if (__intel_gpio_is_direct_irq(value))
17471752
return true;
17481753

17491754
return false;
@@ -1873,7 +1878,12 @@ int intel_pinctrl_resume_noirq(struct device *dev)
18731878
for (i = 0; i < pctrl->soc->npins; i++) {
18741879
const struct pinctrl_pin_desc *desc = &pctrl->soc->pins[i];
18751880

1876-
if (!intel_pinctrl_should_save(pctrl, desc->number))
1881+
if (!(intel_pinctrl_should_save(pctrl, desc->number) ||
1882+
/*
1883+
* If the firmware mangled the register contents too much,
1884+
* check the saved value for the Direct IRQ mode.
1885+
*/
1886+
__intel_gpio_is_direct_irq(pads[i].padcfg0)))
18771887
continue;
18781888

18791889
intel_restore_padcfg(pctrl, desc->number, PADCFG0, pads[i].padcfg0);

drivers/pinctrl/mediatek/pinctrl-mt8195.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ static const struct mtk_pin_field_calc mt8195_pin_drv_range[] = {
659659
PIN_FIELD_BASE(10, 10, 4, 0x010, 0x10, 9, 3),
660660
PIN_FIELD_BASE(11, 11, 4, 0x000, 0x10, 24, 3),
661661
PIN_FIELD_BASE(12, 12, 4, 0x010, 0x10, 12, 3),
662-
PIN_FIELD_BASE(13, 13, 4, 0x010, 0x10, 27, 3),
662+
PIN_FIELD_BASE(13, 13, 4, 0x000, 0x10, 27, 3),
663663
PIN_FIELD_BASE(14, 14, 4, 0x010, 0x10, 15, 3),
664664
PIN_FIELD_BASE(15, 15, 4, 0x010, 0x10, 0, 3),
665665
PIN_FIELD_BASE(16, 16, 4, 0x010, 0x10, 18, 3),
@@ -708,7 +708,7 @@ static const struct mtk_pin_field_calc mt8195_pin_drv_range[] = {
708708
PIN_FIELD_BASE(78, 78, 3, 0x000, 0x10, 15, 3),
709709
PIN_FIELD_BASE(79, 79, 3, 0x000, 0x10, 18, 3),
710710
PIN_FIELD_BASE(80, 80, 3, 0x000, 0x10, 21, 3),
711-
PIN_FIELD_BASE(81, 81, 3, 0x000, 0x10, 28, 3),
711+
PIN_FIELD_BASE(81, 81, 3, 0x000, 0x10, 24, 3),
712712
PIN_FIELD_BASE(82, 82, 3, 0x000, 0x10, 27, 3),
713713
PIN_FIELD_BASE(83, 83, 3, 0x010, 0x10, 0, 3),
714714
PIN_FIELD_BASE(84, 84, 3, 0x010, 0x10, 3, 3),

drivers/pinctrl/pinctrl-amd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ static void amd_gpio_dbg_show(struct seq_file *s, struct gpio_chip *gc)
365365

366366
} else {
367367
debounce_enable = " ∅";
368+
time = 0;
368369
}
369370
snprintf(debounce_value, sizeof(debounce_value), "%u", time * unit);
370371
seq_printf(s, "debounce %s (🕑 %sus)| ", debounce_enable, debounce_value);

drivers/pinctrl/pinctrl-single.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ static int pcs_set_mux(struct pinctrl_dev *pctldev, unsigned fselector,
372372
if (!pcs->fmask)
373373
return 0;
374374
function = pinmux_generic_get_function(pctldev, fselector);
375+
if (!function)
376+
return -EINVAL;
375377
func = function->data;
376378
if (!func)
377379
return -EINVAL;

drivers/pinctrl/qcom/pinctrl-sm8450-lpass-lpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static const struct pinctrl_pin_desc sm8450_lpi_pins[] = {
105105
static const char * const swr_tx_clk_groups[] = { "gpio0" };
106106
static const char * const swr_tx_data_groups[] = { "gpio1", "gpio2", "gpio14" };
107107
static const char * const swr_rx_clk_groups[] = { "gpio3" };
108-
static const char * const swr_rx_data_groups[] = { "gpio4", "gpio5", "gpio15" };
108+
static const char * const swr_rx_data_groups[] = { "gpio4", "gpio5" };
109109
static const char * const dmic1_clk_groups[] = { "gpio6" };
110110
static const char * const dmic1_data_groups[] = { "gpio7" };
111111
static const char * const dmic2_clk_groups[] = { "gpio8" };

0 commit comments

Comments
 (0)