@@ -1709,6 +1709,12 @@ const struct intel_pinctrl_soc_data *intel_pinctrl_get_soc_data(struct platform_
1709
1709
EXPORT_SYMBOL_GPL (intel_pinctrl_get_soc_data );
1710
1710
1711
1711
#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
+
1712
1718
static bool intel_pinctrl_should_save (struct intel_pinctrl * pctrl , unsigned int pin )
1713
1719
{
1714
1720
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
1742
1748
* See https://bugzilla.kernel.org/show_bug.cgi?id=214749.
1743
1749
*/
1744
1750
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 ))
1747
1752
return true;
1748
1753
1749
1754
return false;
@@ -1873,7 +1878,12 @@ int intel_pinctrl_resume_noirq(struct device *dev)
1873
1878
for (i = 0 ; i < pctrl -> soc -> npins ; i ++ ) {
1874
1879
const struct pinctrl_pin_desc * desc = & pctrl -> soc -> pins [i ];
1875
1880
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 )))
1877
1887
continue ;
1878
1888
1879
1889
intel_restore_padcfg (pctrl , desc -> number , PADCFG0 , pads [i ].padcfg0 );
0 commit comments