Lines Matching +full:spin +full:- +full:up
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
31 * specific way of configuring up pins.
64 * For now we're hard-coded to doing IPQ4018 stuff here, but
73 { "bias-disable", PIN_ID_BIAS_DISABLE, 0 },
74 { "bias-high-impedance", PIN_ID_BIAS_HIGH_IMPEDANCE, 0 },
75 { "bias-bus-hold", PIN_ID_BIAS_BUS_HOLD, 0 },
76 { "bias-pull-up", PIN_ID_BIAS_PULL_UP, 0 },
77 { "bias-pull-down", PIN_ID_BIAS_PULL_DOWN, 0 },
78 { "bias-pull-pin-default", PIN_ID_BIAS_PULL_PIN_DEFAULT, 0 },
79 { "drive-push-pull", PIN_ID_DRIVE_PUSH_PULL, 0 },
80 { "drive-open-drain", PIN_ID_DRIVE_OPEN_DRAIN, 0 },
81 { "drive-open-source", PIN_ID_DRIVE_OPEN_SOURCE, 0 },
82 { "drive-strength", PIN_ID_DRIVE_STRENGTH, 1 },
83 { "input-enable", PIN_ID_INPUT_ENABLE, 0 },
84 { "input-disable", PIN_ID_INPUT_DISABLE, 0 },
85 { "input-schmitt-enable", PIN_ID_INPUT_SCHMITT_ENABLE, 0 },
86 { "input-schmitt-disable", PIN_ID_INPUT_SCHMITT_DISABLE, 0 },
87 { "input-debounce", PIN_ID_INPUT_DEBOUNCE, 0 },
88 { "power-source", PIN_ID_POWER_SOURCE, 0 },
89 { "slew-rate", PIN_ID_SLEW_RATE, 0},
90 { "low-power-enable", PIN_ID_LOW_POWER_MODE_ENABLE, 0 },
91 { "low-power-disable", PIN_ID_LOW_POWER_MODE_DISABLE, 0 },
92 { "output-low", PIN_ID_OUTPUT_LOW, 0, },
93 { "output-high", PIN_ID_OUTPUT_HIGH, 0, },
94 { "vm-enable", PIN_ID_VM_ENABLE, 0, },
95 { "vm-disable", PIN_ID_VM_DISABLE, 0, },
103 if (sc->spec_pins == NULL) in qcom_tlmm_pinctrl_search_spin()
106 for (i = 0; sc->spec_pins[i].name != NULL; i++) { in qcom_tlmm_pinctrl_search_spin()
107 if (strcmp(pin_name, sc->spec_pins[i].name) == 0) in qcom_tlmm_pinctrl_search_spin()
108 return (&sc->spec_pins[i]); in qcom_tlmm_pinctrl_search_spin()
116 char *pin_name, const struct qcom_tlmm_spec_pin *spin, in qcom_tlmm_pinctrl_config_spin() argument
120 device_printf(sc->dev, "%s: TODO: called; pin_name=%s\n", in qcom_tlmm_pinctrl_config_spin()
130 if (sc->gpio_muxes == NULL) in qcom_tlmm_pinctrl_search_gmux()
133 for (i = 0; sc->gpio_muxes[i].id >= 0; i++) { in qcom_tlmm_pinctrl_search_gmux()
134 if (strcmp(pin_name, sc->gpio_muxes[i].name) == 0) in qcom_tlmm_pinctrl_search_gmux()
135 return (&sc->gpio_muxes[i]); in qcom_tlmm_pinctrl_search_gmux()
148 if ((gmux->functions[i] != NULL) && in qcom_tlmm_pinctrl_gmux_function()
149 (strcmp(fnc_name, gmux->functions[i]) == 0)) in qcom_tlmm_pinctrl_gmux_function()
153 return (-1); in qcom_tlmm_pinctrl_gmux_function()
168 rv = OF_getprop_alloc(node, "function", (void **)&cfg->function); in qcom_tlmm_pinctrl_read_node()
170 cfg->function = NULL; in qcom_tlmm_pinctrl_read_node()
179 * Properties that were not found/parsed with have a value of -1 in qcom_tlmm_pinctrl_read_node()
183 rv = OF_getencprop(node, prop_names[i].name, &cfg->params[i], in qcom_tlmm_pinctrl_read_node()
184 sizeof(cfg->params[i])); in qcom_tlmm_pinctrl_read_node()
187 device_printf(sc->dev, in qcom_tlmm_pinctrl_read_node()
191 cfg->params[i] = 0; in qcom_tlmm_pinctrl_read_node()
195 cfg->params[i] = 0; in qcom_tlmm_pinctrl_read_node()
198 cfg->params[i] = -1; in qcom_tlmm_pinctrl_read_node()
211 __func__, pin_name, cfg->function); in qcom_tlmm_pinctrl_config_gmux()
219 if (cfg->function != NULL) { in qcom_tlmm_pinctrl_config_gmux()
222 tmp = qcom_tlmm_pinctrl_gmux_function(gmux, cfg->function); in qcom_tlmm_pinctrl_config_gmux()
223 if (tmp == -1) { in qcom_tlmm_pinctrl_config_gmux()
224 device_printf(sc->dev, in qcom_tlmm_pinctrl_config_gmux()
228 cfg->function); in qcom_tlmm_pinctrl_config_gmux()
239 gmux->id, in qcom_tlmm_pinctrl_config_gmux()
241 err = qcom_tlmm_ipq4018_hw_pin_set_function(sc, gmux->id, in qcom_tlmm_pinctrl_config_gmux()
244 device_printf(sc->dev, in qcom_tlmm_pinctrl_config_gmux()
246 __func__, gmux->id, err); in qcom_tlmm_pinctrl_config_gmux()
256 if (cfg->params[i] == -1) in qcom_tlmm_pinctrl_config_gmux()
261 gmux->id, in qcom_tlmm_pinctrl_config_gmux()
263 cfg->params[i]); in qcom_tlmm_pinctrl_config_gmux()
267 gmux->id, QCOM_TLMM_PIN_PUPD_CONFIG_DISABLE); in qcom_tlmm_pinctrl_config_gmux()
269 device_printf(sc->dev, in qcom_tlmm_pinctrl_config_gmux()
272 __func__, gmux->id, err); in qcom_tlmm_pinctrl_config_gmux()
278 gmux->id, QCOM_TLMM_PIN_PUPD_CONFIG_PULL_DOWN); in qcom_tlmm_pinctrl_config_gmux()
280 device_printf(sc->dev, in qcom_tlmm_pinctrl_config_gmux()
283 __func__, gmux->id, err); in qcom_tlmm_pinctrl_config_gmux()
289 gmux->id, QCOM_TLMM_PIN_PUPD_CONFIG_BUS_HOLD); in qcom_tlmm_pinctrl_config_gmux()
291 device_printf(sc->dev, in qcom_tlmm_pinctrl_config_gmux()
294 __func__, gmux->id, err); in qcom_tlmm_pinctrl_config_gmux()
301 gmux->id, QCOM_TLMM_PIN_PUPD_CONFIG_PULL_UP); in qcom_tlmm_pinctrl_config_gmux()
303 device_printf(sc->dev, in qcom_tlmm_pinctrl_config_gmux()
306 __func__, gmux->id, err); in qcom_tlmm_pinctrl_config_gmux()
312 gmux->id); in qcom_tlmm_pinctrl_config_gmux()
314 device_printf(sc->dev, in qcom_tlmm_pinctrl_config_gmux()
317 __func__, gmux->id, err); in qcom_tlmm_pinctrl_config_gmux()
321 sc, gmux->id, 0); in qcom_tlmm_pinctrl_config_gmux()
323 device_printf(sc->dev, in qcom_tlmm_pinctrl_config_gmux()
326 __func__, gmux->id, err); in qcom_tlmm_pinctrl_config_gmux()
332 gmux->id); in qcom_tlmm_pinctrl_config_gmux()
334 device_printf(sc->dev, in qcom_tlmm_pinctrl_config_gmux()
337 __func__, gmux->id, err); in qcom_tlmm_pinctrl_config_gmux()
341 sc, gmux->id, 1); in qcom_tlmm_pinctrl_config_gmux()
343 device_printf(sc->dev, in qcom_tlmm_pinctrl_config_gmux()
346 __func__, gmux->id, err); in qcom_tlmm_pinctrl_config_gmux()
352 gmux->id, cfg->params[i]); in qcom_tlmm_pinctrl_config_gmux()
354 device_printf(sc->dev, in qcom_tlmm_pinctrl_config_gmux()
357 __func__, gmux->id, in qcom_tlmm_pinctrl_config_gmux()
358 cfg->params[i], err); in qcom_tlmm_pinctrl_config_gmux()
364 gmux->id, true); in qcom_tlmm_pinctrl_config_gmux()
366 device_printf(sc->dev, in qcom_tlmm_pinctrl_config_gmux()
369 __func__, gmux->id, err); in qcom_tlmm_pinctrl_config_gmux()
375 gmux->id, false); in qcom_tlmm_pinctrl_config_gmux()
377 device_printf(sc->dev, in qcom_tlmm_pinctrl_config_gmux()
380 __func__, gmux->id, err); in qcom_tlmm_pinctrl_config_gmux()
386 gmux->id, true); in qcom_tlmm_pinctrl_config_gmux()
388 device_printf(sc->dev, in qcom_tlmm_pinctrl_config_gmux()
391 __func__, gmux->id, err); in qcom_tlmm_pinctrl_config_gmux()
398 gmux->id); in qcom_tlmm_pinctrl_config_gmux()
400 device_printf(sc->dev, in qcom_tlmm_pinctrl_config_gmux()
403 __func__, gmux->id, err); in qcom_tlmm_pinctrl_config_gmux()
409 * the linux-msm GPIO driver treats this as an error; in qcom_tlmm_pinctrl_config_gmux()
427 device_printf(sc->dev, in qcom_tlmm_pinctrl_config_gmux()
431 gmux->id, in qcom_tlmm_pinctrl_config_gmux()
433 cfg->params[i]); in qcom_tlmm_pinctrl_config_gmux()
450 const struct qcom_tlmm_spec_pin *spin; in qcom_tlmm_pinctrl_config_node() local
461 spin = qcom_tlmm_pinctrl_search_spin(sc, pin_name); in qcom_tlmm_pinctrl_config_node()
462 if (spin != NULL) { in qcom_tlmm_pinctrl_config_node()
463 rv = qcom_tlmm_pinctrl_config_spin(sc, pin_name, spin, cfg); in qcom_tlmm_pinctrl_config_node()
466 device_printf(sc->dev, "Unknown pin: %s\n", pin_name); in qcom_tlmm_pinctrl_config_node()
495 device_printf(sc->dev, in qcom_tlmm_pinctrl_process_node()