@@ -1063,7 +1063,11 @@ static struct pinctrl *create_pinctrl(struct device *dev,
INIT_LIST_HEAD(&p->states);
INIT_LIST_HEAD(&p->dt_maps);
- ret = pinctrl_dt_to_map(p, pctldev);
+ if (pctldev && pctldev->desc->pctlops->dt_dev_to_map) {
+ ret = pctldev->desc->pctlops->dt_dev_to_map(pctldev, dev);
+ } else {
+ ret = pinctrl_dt_to_map(p, pctldev);
+ }
if (ret < 0) {
kfree(p);
return ERR_PTR(ret);
@@ -95,6 +95,7 @@ struct pinctrl_ops {
unsigned *num_pins);
void (*pin_dbg_show) (struct pinctrl_dev *pctldev, struct seq_file *s,
unsigned offset);
+ int (*dt_dev_to_map) (struct pinctrl_dev *pctldev, struct device *dev);
int (*dt_node_to_map) (struct pinctrl_dev *pctldev,
struct device_node *np_config,
struct pinctrl_map **map, unsigned *num_maps);
The devicetree binding for the PCA955x LED/GPIO expanders was not written with pinctrl in mind. To maintain compatibility with existing devicetrees while implementing pinctrl support for the PCA955x devices, add the ability to parse a custom device node layout to pinctrl. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> --- drivers/pinctrl/core.c | 6 +++++- include/linux/pinctrl/pinctrl.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-)