pinctrl: core: Fix pinctrl_register_and_init() with pinctrl_enable()

Recent pinctrl changes to allow dynamic allocation of pins exposed one
more issue with the pinctrl pins claimed early by the controller itself.
This caused a regression for IMX6 pinctrl hogs.

Before enabling the pin controller driver we need to wait until it has
been properly initialized, then claim the hogs, and only then enable it.

To fix the regression, split the code into pinctrl_claim_hogs() and
pinctrl_enable(). And then let's require that pinctrl_enable() is always
called by the pin controller driver when ready after calling

Depends-on: 950b0d91dc10 ("pinctrl: core: Fix regression caused by delayed
work for hogs")
Fixes: df61b366af26 ("pinctrl: core: Use delayed work for hogs")
Fixes: e566fc11ea76 ("pinctrl: imx: use generic pinctrl helpers for
managing groups")
Cc: Haojian Zhuang <>
Cc: Masahiro Yamada <>
Cc: Mika Penttilä <>
Cc: Mika Westerberg <>
Cc: Nishanth Menon <>
Cc: Shawn Guo <>
Cc: Stefan Agner <>
Tested-by: Geert Uytterhoeven <>
Tested-by: Gary Bisson <>
Tested-by: Fabio Estevam <>
Signed-off-by: Tony Lindgren <>
Signed-off-by: Linus Walleij <>
7 files changed