aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-st.c
diff options
context:
space:
mode:
authorSherman Yin <syin@broadcom.com>2013-08-27 14:32:12 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-08-28 07:34:41 -0400
commit03b054e9696c3cbd3d5905ec96da15acd0a2fe8d (patch)
tree7123b780c194d350b3e5134c267e17262effb385 /drivers/pinctrl/pinctrl-st.c
parentf5ba9c52bf1e236c4698c240955e5f119db62a28 (diff)
pinctrl: Pass all configs to driver on pin_config_set()
When setting pin configuration in the pinctrl framework, pin_config_set() or pin_config_group_set() is called in a loop to set one configuration at a time for the specified pin or group. This patch 1) removes the loop and 2) changes the API to pass the whole pin config array to the driver. It is now up to the driver to loop through the configs. This allows the driver to potentially combine configs and reduce the number of writes to pin config registers. All c files changed have been build-tested to verify the change compiles and that the corresponding .o is successfully generated. Signed-off-by: Sherman Yin <syin@broadcom.com> Reviewed-by: Christian Daudt <csd@broadcom.com> Reviewed-by: Matt Porter <matt.porter@linaro.org> Tested-by: Stephen Warren <swarren@nvidia.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-st.c')
-rw-r--r--drivers/pinctrl/pinctrl-st.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
index 2a10a318b648..9cadc68ee572 100644
--- a/drivers/pinctrl/pinctrl-st.c
+++ b/drivers/pinctrl/pinctrl-st.c
@@ -909,15 +909,18 @@ static void st_pinconf_set_retime(struct st_pinctrl *info,
909 config, pin); 909 config, pin);
910} 910}
911 911
912static int st_pinconf_set(struct pinctrl_dev *pctldev, 912static int st_pinconf_set(struct pinctrl_dev *pctldev, unsigned pin_id,
913 unsigned pin_id, unsigned long config) 913 unsigned long *configs, unsigned num_configs)
914{ 914{
915 int pin = st_gpio_pin(pin_id); 915 int pin = st_gpio_pin(pin_id);
916 struct st_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 916 struct st_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
917 struct st_pio_control *pc = st_get_pio_control(pctldev, pin_id); 917 struct st_pio_control *pc = st_get_pio_control(pctldev, pin_id);
918 int i;
918 919
919 st_pinconf_set_config(pc, pin, config); 920 for (i = 0; i < num_configs; i++) {
920 st_pinconf_set_retime(info, pc, pin, config); 921 st_pinconf_set_config(pc, pin, configs[i]);
922 st_pinconf_set_retime(info, pc, pin, configs[i]);
923 } /* for each config */
921 924
922 return 0; 925 return 0;
923} 926}