1 From 1c11b14dd6d740e997919f0bf789bf921548dc0f Mon Sep 17 00:00:00 2001
2 From: Bjorn Andersson <bjorn.andersson@sonymobile.com>
3 Date: Mon, 31 Mar 2014 14:49:55 -0700
4 Subject: [PATCH 037/182] pinctrl: msm: Make number of functions variable
6 The various pins may have different number of functions defined, so make this
7 number definable per pin instead of just increasing it to the largest one for
10 Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
11 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
13 drivers/pinctrl/pinctrl-msm.c | 4 ++--
14 drivers/pinctrl/pinctrl-msm.h | 3 ++-
15 drivers/pinctrl/pinctrl-msm8x74.c | 3 ++-
16 3 files changed, 6 insertions(+), 4 deletions(-)
18 --- a/drivers/pinctrl/pinctrl-msm.c
19 +++ b/drivers/pinctrl/pinctrl-msm.c
20 @@ -145,12 +145,12 @@ static int msm_pinmux_enable(struct pinc
21 if (WARN_ON(g->mux_bit < 0))
24 - for (i = 0; i < ARRAY_SIZE(g->funcs); i++) {
25 + for (i = 0; i < g->nfuncs; i++) {
26 if (g->funcs[i] == function)
30 - if (WARN_ON(i == ARRAY_SIZE(g->funcs)))
31 + if (WARN_ON(i == g->nfuncs))
34 spin_lock_irqsave(&pctrl->lock, flags);
35 --- a/drivers/pinctrl/pinctrl-msm.h
36 +++ b/drivers/pinctrl/pinctrl-msm.h
37 @@ -65,7 +65,8 @@ struct msm_pingroup {
47 --- a/drivers/pinctrl/pinctrl-msm8x74.c
48 +++ b/drivers/pinctrl/pinctrl-msm8x74.c
49 @@ -341,7 +341,7 @@ static const unsigned int sdc2_data_pins
51 .pins = gpio##id##_pins, \
52 .npins = ARRAY_SIZE(gpio##id##_pins), \
55 MSM_MUX_NA, /* gpio mode */ \
58 @@ -351,6 +351,7 @@ static const unsigned int sdc2_data_pins
63 .ctl_reg = 0x1000 + 0x10 * id, \
64 .io_reg = 0x1004 + 0x10 * id, \
65 .intr_cfg_reg = 0x1008 + 0x10 * id, \