diff options
author | Tony Lindgren <tony@atomide.com> | 2016-12-27 09:19:59 -0800 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-01-03 09:26:16 +0100 |
commit | 99e4f67508e1dd51e21ebae2150c6e4f4eae068b (patch) | |
tree | 9c8b6d2e865a0f06988ca14e77a75f7bc2d5f03a /drivers/pinctrl/devicetree.h | |
parent | a51c158bf0f7cab3bd593586801a1a8b51c7c741 (diff) |
pinctrl: core: Use delayed work for hogs
Having the pin control framework call pin controller functions
before it's probe has finished is not nice as the pin controller
device driver does not yet have struct pinctrl_dev handle.
Let's fix this issue by adding deferred work for late init. This is
needed to be able to add pinctrl generic helper functions that expect
to know struct pinctrl_dev handle. Note that we now need to call
create_pinctrl() directly as we don't want to add the pin controller
to the list of controllers until the hogs are claimed. We also need
to pass the pinctrl_dev to the device tree parser functions as they
otherwise won't find the right controller at this point.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/devicetree.h')
-rw-r--r-- | drivers/pinctrl/devicetree.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/pinctrl/devicetree.h b/drivers/pinctrl/devicetree.h index c2d1a5505850..43d8d19aa5ee 100644 --- a/drivers/pinctrl/devicetree.h +++ b/drivers/pinctrl/devicetree.h @@ -20,8 +20,10 @@ struct of_phandle_args; #ifdef CONFIG_OF +bool pinctrl_dt_has_hogs(struct pinctrl_dev *pctldev); + void pinctrl_dt_free_maps(struct pinctrl *p); -int pinctrl_dt_to_map(struct pinctrl *p); +int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev); int pinctrl_count_index_with_args(const struct device_node *np, const char *list_name); @@ -32,7 +34,13 @@ int pinctrl_parse_index_with_args(const struct device_node *np, #else -static inline int pinctrl_dt_to_map(struct pinctrl *p) +static inline bool pinctrl_dt_has_hogs(struct pinctrl_dev *pctldev) +{ + return false; +} + +static inline int pinctrl_dt_to_map(struct pinctrl *p, + struct pinctrl_dev *pctldev) { return 0; } |