android_kernel_oneplus_msm8998/drivers/pinctrl
Keerthy ee6a1e9eef pinctrl: single: Fix pcs_parse_bits_in_pinctrl_entry to use __ffs than ffs
commit 56b367c0cd67d4c3006738e7dc9dda9273fd2bfe upstream.

pcs_parse_bits_in_pinctrl_entry uses ffs which gives bit indices
ranging from 1 to MAX. This leads to a corner case where we try to request
the pin number = MAX and fails.

bit_pos value is being calculted using ffs. pin_num_from_lsb uses
bit_pos value. pins array is populated with:

pin + pin_num_from_lsb.

The above is 1 more than usual bit indices as bit_pos uses ffs to compute
first set bit. Hence the last of the pins array is populated with the MAX
value and not MAX - 1 which causes error when we call pin_request.

mask_pos is rightly calculated as ((pcs->fmask) << (bit_pos - 1))
Consequently val_pos and submask are correct.

Hence use __ffs which gives (ffs(x) - 1) as the first bit set.

fixes: 4e7e8017a8 ("pinctrl: pinctrl-single: enhance to configure multiple pins of different modules")
Signed-off-by: Keerthy <j-keerthy@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-04 14:48:45 -07:00
..
bcm pinctrl-bcm2835: Fix cut-and-paste error in "pull" parsing 2016-04-12 09:08:37 -07:00
berlin pinctrl: berlin: fix BG2CD field widths 2015-10-16 16:42:48 +02:00
freescale pinctrl: freescale: imx: fix bogus check of of_iomap() return value 2016-04-20 15:42:08 +09:00
intel pinctrl: intel: fix offset calculation issue of register PAD_OWN 2015-12-10 23:01:42 +01:00
mediatek pinctrl: mediatek: correct debounce time unit in mtk_gpio_set_debounce 2016-05-04 14:48:45 -07:00
meson
mvebu
nomadik pinctrl: nomadik: fix pull debug print inversion 2016-04-20 15:42:08 +09:00
qcom pinctrl: fix qcom ssbi drivers for 64-bit compilation 2015-11-17 15:34:06 +01:00
samsung This is the bulk of GPIO changes for v4.4: 2015-11-02 12:59:12 -08:00
sh-pfc pinctrl: sh-pfc: only use dummy states for non-DT platforms 2016-04-20 15:42:08 +09:00
sirf pinctrl: atlas7: support atlas7 step B changes 2015-10-16 21:56:07 +02:00
spear
sunxi pinctrl: sunxi: Fix A33 external interrupts not working 2016-04-20 15:42:08 +09:00
uniphier This is the big bulk of pin control changes for the 2015-11-02 12:30:39 -08:00
vt8500 pinctrl: replace trivial implementations of gpio_chip request/free 2015-10-16 22:20:21 +02:00
core.c drivers/pinctrl: Add the concept of an "init" state 2015-10-27 11:24:23 +01:00
core.h
devicetree.c
devicetree.h
Kconfig pinctrl: remove redundant if conditional from Kconfig 2015-11-17 11:47:47 +01:00
Makefile pinctrl: uniphier: guard uniphier directory with CONFIG_PINCTRL_UNIPHIER 2015-10-31 22:13:07 +01:00
pinconf-generic.c pinctrl: pinconf-generic: add "input-schmitt" DT property 2015-10-02 15:09:11 -07:00
pinconf.c pinctrl: pinconf: remove needless loop 2015-10-31 22:13:07 +01:00
pinconf.h
pinctrl-adi2-bf54x.c
pinctrl-adi2-bf60x.c
pinctrl-adi2.c pinctrl: replace trivial implementations of gpio_chip request/free 2015-10-16 22:20:21 +02:00
pinctrl-adi2.h
pinctrl-amd.c
pinctrl-amd.h
pinctrl-as3722.c pinctrl: replace trivial implementations of gpio_chip request/free 2015-10-16 22:20:21 +02:00
pinctrl-at91-pio4.c pinctrl: at91-pio4: irq argument as been removed from irq flow handlers 2015-10-02 14:52:20 -07:00
pinctrl-at91.c This is the bulk of GPIO changes for v4.4: 2015-11-02 12:59:12 -08:00
pinctrl-at91.h
pinctrl-coh901.c pinctrl: replace trivial implementations of gpio_chip request/free 2015-10-16 22:20:21 +02:00
pinctrl-coh901.h
pinctrl-digicolor.c pinctrl: replace trivial implementations of gpio_chip request/free 2015-10-16 22:20:21 +02:00
pinctrl-falcon.c
pinctrl-lantiq.c
pinctrl-lantiq.h
pinctrl-lpc18xx.c
pinctrl-palmas.c
pinctrl-pistachio.c pinctrl: pistachio: fix mfio84-89 function description and pinmux. 2016-04-20 15:42:08 +09:00
pinctrl-rockchip.c This is the bulk of GPIO changes for v4.4: 2015-11-02 12:59:12 -08:00
pinctrl-single.c pinctrl: single: Fix pcs_parse_bits_in_pinctrl_entry to use __ffs than ffs 2016-05-04 14:48:45 -07:00
pinctrl-st.c pinctrl: replace trivial implementations of gpio_chip request/free 2015-10-16 22:20:21 +02:00
pinctrl-tb10x.c
pinctrl-tegra-xusb.c pinctrl: tegra-xusb: Correct lane mux options 2015-10-27 17:06:23 +01:00
pinctrl-tegra.c
pinctrl-tegra.h
pinctrl-tegra20.c
pinctrl-tegra30.c
pinctrl-tegra114.c
pinctrl-tegra124.c
pinctrl-tegra210.c
pinctrl-tz1090-pdc.c pinctrl: tz1090-pdc: Remove unneded semicolons 2015-10-02 04:06:46 -07:00
pinctrl-tz1090.c pinctrl: tz1090: Remove unneded semicolons 2015-10-02 04:06:46 -07:00
pinctrl-u300.c
pinctrl-utils.c
pinctrl-utils.h
pinctrl-xway.c pinctrl: replace trivial implementations of gpio_chip request/free 2015-10-16 22:20:21 +02:00
pinctrl-zynq.c pinctrl: zynq: fix UTF-8 errors 2015-10-31 22:12:59 +01:00
pinmux.c
pinmux.h