aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/nomadik/pinctrl-abx500.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pinctrl/nomadik/pinctrl-abx500.c')
-rw-r--r--drivers/pinctrl/nomadik/pinctrl-abx500.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/drivers/pinctrl/nomadik/pinctrl-abx500.c b/drivers/pinctrl/nomadik/pinctrl-abx500.c
index 228972827132..e1087c75e4f4 100644
--- a/drivers/pinctrl/nomadik/pinctrl-abx500.c
+++ b/drivers/pinctrl/nomadik/pinctrl-abx500.c
@@ -891,14 +891,13 @@ static int abx500_dt_subnode_to_map(struct pinctrl_dev *pctldev,
891 const char *function = NULL; 891 const char *function = NULL;
892 unsigned long *configs; 892 unsigned long *configs;
893 unsigned int nconfigs = 0; 893 unsigned int nconfigs = 0;
894 bool has_config = 0;
895 struct property *prop; 894 struct property *prop;
896 const char *group, *gpio_name;
897 struct device_node *np_config;
898 895
899 ret = of_property_read_string(np, "ste,function", &function); 896 ret = of_property_read_string(np, "function", &function);
900 if (ret >= 0) { 897 if (ret >= 0) {
901 ret = of_property_count_strings(np, "ste,pins"); 898 const char *group;
899
900 ret = of_property_count_strings(np, "groups");
902 if (ret < 0) 901 if (ret < 0)
903 goto exit; 902 goto exit;
904 903
@@ -907,7 +906,7 @@ static int abx500_dt_subnode_to_map(struct pinctrl_dev *pctldev,
907 if (ret < 0) 906 if (ret < 0)
908 goto exit; 907 goto exit;
909 908
910 of_property_for_each_string(np, "ste,pins", prop, group) { 909 of_property_for_each_string(np, "groups", prop, group) {
911 ret = abx500_dt_add_map_mux(map, reserved_maps, 910 ret = abx500_dt_add_map_mux(map, reserved_maps,
912 num_maps, group, function); 911 num_maps, group, function);
913 if (ret < 0) 912 if (ret < 0)
@@ -916,18 +915,11 @@ static int abx500_dt_subnode_to_map(struct pinctrl_dev *pctldev,
916 } 915 }
917 916
918 ret = pinconf_generic_parse_dt_config(np, &configs, &nconfigs); 917 ret = pinconf_generic_parse_dt_config(np, &configs, &nconfigs);
919 if (nconfigs) 918 if (nconfigs) {
920 has_config = 1; 919 const char *gpio_name;
921 np_config = of_parse_phandle(np, "ste,config", 0); 920 const char *pin;
922 if (np_config) { 921
923 ret = pinconf_generic_parse_dt_config(np_config, &configs, 922 ret = of_property_count_strings(np, "pins");
924 &nconfigs);
925 if (ret)
926 goto exit;
927 has_config |= nconfigs;
928 }
929 if (has_config) {
930 ret = of_property_count_strings(np, "ste,pins");
931 if (ret < 0) 923 if (ret < 0)
932 goto exit; 924 goto exit;
933 925
@@ -937,8 +929,8 @@ static int abx500_dt_subnode_to_map(struct pinctrl_dev *pctldev,
937 if (ret < 0) 929 if (ret < 0)
938 goto exit; 930 goto exit;
939 931
940 of_property_for_each_string(np, "ste,pins", prop, group) { 932 of_property_for_each_string(np, "pins", prop, pin) {
941 gpio_name = abx500_find_pin_name(pctldev, group); 933 gpio_name = abx500_find_pin_name(pctldev, pin);
942 934
943 ret = abx500_dt_add_map_configs(map, reserved_maps, 935 ret = abx500_dt_add_map_configs(map, reserved_maps,
944 num_maps, gpio_name, configs, 1); 936 num_maps, gpio_name, configs, 1);
@@ -1112,6 +1104,7 @@ out:
1112static const struct pinconf_ops abx500_pinconf_ops = { 1104static const struct pinconf_ops abx500_pinconf_ops = {
1113 .pin_config_get = abx500_pin_config_get, 1105 .pin_config_get = abx500_pin_config_get,
1114 .pin_config_set = abx500_pin_config_set, 1106 .pin_config_set = abx500_pin_config_set,
1107 .is_generic = true,
1115}; 1108};
1116 1109
1117static struct pinctrl_desc abx500_pinctrl_desc = { 1110static struct pinctrl_desc abx500_pinctrl_desc = {