Lines Matching refs:pin

3  * Core driver for the pin muxing portions of the pin control subsystem
78 * pinmux_can_be_used_for_gpio() - check if a specific pin
81 * @pctldev: the associated pin controller device
82 * @pin: the pin number in the global pin space
87 bool pinmux_can_be_used_for_gpio(struct pinctrl_dev *pctldev, unsigned int pin)
89 struct pin_desc *desc = pin_desc_get(pctldev, pin);
92 /* Can't inspect pin, assume it can be used */
103 * pin_request() - request a single pin to be muxed in, typically for GPIO
104 * @pctldev: the associated pin controller device
105 * @pin: the pin number in the global pin space
106 * @owner: a representation of the owner of this pin; typically the device
108 * @gpio_range: the range matching the GPIO pin if this is a request for a
109 * single GPIO pin
112 int pin, const char *owner,
119 desc = pin_desc_get(pctldev, pin);
122 "pin %d is not registered so it cannot be requested\n",
123 pin);
127 dev_dbg(pctldev->dev, "request pin %d (%s) for %s\n",
128 pin, desc->name, owner);
133 "pin %s already requested by %s; cannot claim for %s\n",
140 "pin %s already requested by %s; cannot claim for %s\n",
155 /* Let each pin increase references to this module */
158 "could not increase module refcount for pin %d\n",
159 pin);
165 * If there is no kind of request function for the pin we just assume
169 /* This requests and enables a single GPIO pin */
170 status = ops->gpio_request_enable(pctldev, gpio_range, pin);
172 status = ops->request(pctldev, pin);
191 dev_err_probe(pctldev->dev, status, "pin-%d (%s)\n",
192 pin, owner);
198 * pin_free() - release a single muxed in pin so something else can be muxed
199 * @pctldev: pin controller device handling this pin
200 * @pin: the pin to free
201 * @gpio_range: the range matching the GPIO pin if this is a request for a
202 * single GPIO pin
206 * once the pin is free. This is done for GPIO request functions.
208 static const char *pin_free(struct pinctrl_dev *pctldev, int pin,
215 desc = pin_desc_get(pctldev, pin);
218 "pin is not registered so it cannot be freed\n");
224 * A pin should not be freed more times than allocated.
234 * If there is no kind of request function for the pin we just assume
238 ops->gpio_disable_free(pctldev, gpio_range, pin);
240 ops->free(pctldev, pin);
257 * pinmux_request_gpio() - request pinmuxing for a GPIO pin
258 * @pctldev: pin controller device affected
259 * @pin: the pin to mux in for GPIO
265 unsigned int pin, unsigned int gpio)
270 /* Conjure some name stating what chip and pin this is taken by */
275 ret = pin_request(pctldev, pin, owner, range);
283 * pinmux_free_gpio() - release a pin from GPIO muxing
284 * @pctldev: the pin controller device for the pin
285 * @pin: the affected currently GPIO-muxed in pin
288 void pinmux_free_gpio(struct pinctrl_dev *pctldev, unsigned int pin,
293 owner = pin_free(pctldev, pin, range);
298 * pinmux_gpio_direction() - set the direction of a single muxed-in GPIO pin
299 * @pctldev: the pin controller handling this pin
301 * @pin: the affected GPIO pin in this controller
302 * @input: true if we set the pin as input, false for output
306 unsigned int pin, bool input)
314 ret = ops->gpio_set_direction(pctldev, range, pin, input);
445 "could not request pin %d (%s) from group %s "
458 "could not get pin desc for pin %d\n",
517 "could not get pin desc for pin %d\n",
529 "not freeing pin %d (%s) as part of "
587 unsigned int i, pin;
592 seq_puts(s, "Pinmux settings per pin\n");
595 "Format: pin (name): mux_owner|gpio_owner (strict) hog?\n");
598 "Format: pin (name): mux_owner gpio_owner hog?\n");
602 /* The pin number can be retrived from the pin controller descriptor */
607 pin = pctldev->desc->pins[i].number;
608 desc = pin_desc_get(pctldev, pin);
609 /* Skip if we cannot search the pin */
619 seq_printf(s, "pin %d (%s): device %s%s",
620 pin, desc->name, desc->mux_owner,
623 seq_printf(s, "pin %d (%s): GPIO %s",
624 pin, desc->name, desc->gpio_owner);
626 seq_printf(s, "pin %d (%s): UNCLAIMED",
627 pin, desc->name);
630 seq_printf(s, "pin %d (%s): %s %s%s", pin, desc->name,
638 /* If mux: print function+group claiming the pin */
783 * @pctldev: pin controller device
793 * @pctldev: pin controller device
813 * @pctldev: pin controller device
815 * @groups: array of pin groups
816 * @num_groups: number of pin groups
841 * @pctldev: pin controller device
860 * @pctldev: pin controller device
862 * @groups: array of pin groups
863 * @num_groups: number of pin groups
864 * @data: pin controller driver specific data
905 * @pctldev: pin controller device
931 * @pctldev: pin controller device