1 // SPDX-License-Identifier: GPL-2.0+
3 * Qualcomm APQ8096 pinctrl
5 * (C) Copyright 2019 Ramon Fried <ramon.fried@gmail.com>
9 #include "pinctrl-snapdragon.h"
12 #define MAX_PIN_NAME_LEN 32
13 static char pin_name[MAX_PIN_NAME_LEN];
14 static const char * const msm_pinctrl_pins[] = {
24 static const struct pinctrl_function msm_pinctrl_functions[] = {
28 static const char *apq8096_get_function_name(struct udevice *dev,
29 unsigned int selector)
31 return msm_pinctrl_functions[selector].name;
34 static const char *apq8096_get_pin_name(struct udevice *dev,
35 unsigned int selector)
38 snprintf(pin_name, MAX_PIN_NAME_LEN, "GPIO_%u", selector);
41 return msm_pinctrl_pins[selector - 150];
45 static unsigned int apq8096_get_function_mux(unsigned int selector)
47 return msm_pinctrl_functions[selector].val;
50 struct msm_pinctrl_data apq8096_data = {
52 .functions_count = ARRAY_SIZE(msm_pinctrl_functions),
53 .get_function_name = apq8096_get_function_name,
54 .get_function_mux = apq8096_get_function_mux,
55 .get_pin_name = apq8096_get_pin_name,