Lines Matching +full:pinctrl +full:- +full:pin +full:- +full:array

1 // SPDX-License-Identifier: GPL-2.0+
3 * Exynos pinctrl driver common code.
12 #include "pinctrl-exynos.h"
17 * exynos_pinctrl_setup_peri: setup pinctrl for a peripheral.
18 * conf: soc specific pin configuration data array
19 * num_conf: number of configurations in the conf array.
20 * base: base address of the pin controller.
35 /* given a pin-name, return the address of pin config registers */
37 u32 *pin) in pin_to_bank_base() argument
40 const struct samsung_pin_ctrl *pin_ctrl = priv->pin_ctrl; in pin_to_bank_base()
41 const struct samsung_pin_bank_data *bank_data = pin_ctrl->pin_banks; in pin_to_bank_base()
42 u32 nr_banks = pin_ctrl->nr_banks, idx = 0; in pin_to_bank_base()
46 * The format of the pin name is <bank name>-<pin_number>. in pin_to_bank_base()
47 * Example: gpa0-4 (gpa0 is the bank name and 4 is the pin number. in pin_to_bank_base()
49 while (pin_name[idx] != '-') { in pin_to_bank_base()
54 *pin = pin_name[++idx] - '0'; in pin_to_bank_base()
56 /* lookup the pin bank data using the pin bank name */ in pin_to_bank_base()
61 return priv->base + bank_data[idx].offset; in pin_to_bank_base()
65 * exynos_pinctrl_set_state: configure a pin state.
66 * dev: the pinctrl device to be configured.
71 const void *fdt = gd->fdt_blob; in exynos_pinctrl_set_state()
79 * refer to the following document for the pinctrl bindings in exynos_pinctrl_set_state()
80 * linux/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt in exynos_pinctrl_set_state()
84 return -EINVAL; in exynos_pinctrl_set_state()
86 pinfunc = fdtdec_get_int(fdt, node, "samsung,pin-function", -1); in exynos_pinctrl_set_state()
87 pinpud = fdtdec_get_int(fdt, node, "samsung,pin-pud", -1); in exynos_pinctrl_set_state()
88 pindrv = fdtdec_get_int(fdt, node, "samsung,pin-drv", -1); in exynos_pinctrl_set_state()
96 if (pinfunc != -1) { in exynos_pinctrl_set_state()
103 if (pinpud != -1) { in exynos_pinctrl_set_state()
110 if (pindrv != -1) { in exynos_pinctrl_set_state()
128 return -EINVAL; in exynos_pinctrl_probe()
132 return -EINVAL; in exynos_pinctrl_probe()
134 priv->base = base; in exynos_pinctrl_probe()
135 priv->pin_ctrl = (struct samsung_pin_ctrl *)dev_get_driver_data(dev) + in exynos_pinctrl_probe()
136 dev->req_seq; in exynos_pinctrl_probe()