• Home
  • Raw
  • Download

Lines Matching +full:- +full:pins

1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2012 ST-Ericsson SA
6 * Written on behalf of Linaro for ST-Ericsson
18 * pinctrl_bind_pins() - called by the device core before probe
25 if (dev->of_node_reused) in pinctrl_bind_pins()
28 dev->pins = devm_kzalloc(dev, sizeof(*(dev->pins)), GFP_KERNEL); in pinctrl_bind_pins()
29 if (!dev->pins) in pinctrl_bind_pins()
30 return -ENOMEM; in pinctrl_bind_pins()
32 dev->pins->p = devm_pinctrl_get(dev); in pinctrl_bind_pins()
33 if (IS_ERR(dev->pins->p)) { in pinctrl_bind_pins()
35 ret = PTR_ERR(dev->pins->p); in pinctrl_bind_pins()
39 dev->pins->default_state = pinctrl_lookup_state(dev->pins->p, in pinctrl_bind_pins()
41 if (IS_ERR(dev->pins->default_state)) { in pinctrl_bind_pins()
47 dev->pins->init_state = pinctrl_lookup_state(dev->pins->p, in pinctrl_bind_pins()
49 if (IS_ERR(dev->pins->init_state)) { in pinctrl_bind_pins()
53 ret = pinctrl_select_state(dev->pins->p, in pinctrl_bind_pins()
54 dev->pins->default_state); in pinctrl_bind_pins()
56 ret = pinctrl_select_state(dev->pins->p, dev->pins->init_state); in pinctrl_bind_pins()
68 * <linux/pinctrl/pinctrl-state.h> in pinctrl_bind_pins()
70 dev->pins->sleep_state = pinctrl_lookup_state(dev->pins->p, in pinctrl_bind_pins()
72 if (IS_ERR(dev->pins->sleep_state)) in pinctrl_bind_pins()
76 dev->pins->idle_state = pinctrl_lookup_state(dev->pins->p, in pinctrl_bind_pins()
78 if (IS_ERR(dev->pins->idle_state)) in pinctrl_bind_pins()
91 devm_pinctrl_put(dev->pins->p); in pinctrl_bind_pins()
93 devm_kfree(dev, dev->pins); in pinctrl_bind_pins()
94 dev->pins = NULL; in pinctrl_bind_pins()
97 if (ret == -EPROBE_DEFER) in pinctrl_bind_pins()
100 if (ret == -EINVAL) in pinctrl_bind_pins()
102 /* We ignore errors like -ENOENT meaning no pinctrl state */ in pinctrl_bind_pins()