Lines Matching +full:gpa0 +full:- +full:1
1 // SPDX-License-Identifier: GPL-2.0+
12 #include "pinctrl-exynos.h"
35 /* given a pin-name, return the address of pin config registers */
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()
61 return priv->base + bank_data[idx].offset; in pin_to_bank_base()
71 const void *fdt = gd->fdt_blob; 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()
105 value &= ~(0x3 << (pin_num << 1)); in exynos_pinctrl_set_state()
106 value |= (pinpud << (pin_num << 1)); in exynos_pinctrl_set_state()
110 if (pindrv != -1) { in exynos_pinctrl_set_state()
112 value &= ~(0x3 << (pin_num << 1)); in exynos_pinctrl_set_state()
113 value |= (pindrv << (pin_num << 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()