Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pinctrl-v4.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control fixes from Linus Walleij:
"Some pin control driver fixes came in. One headed for stable and the
other two are just ordinary merge window fixes.

- Make the i.MX driver select REGMAP as a dependency
- Fix up the Mediatek debounce time unit
- Fix a real hairy ffs vs __ffs issue in the Single pinctrl driver"

* tag 'pinctrl-v4.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
pinctrl: single: Fix pcs_parse_bits_in_pinctrl_entry to use __ffs than ffs
pinctrl: mediatek: correct debounce time unit in mtk_gpio_set_debounce
pinctrl: imx: Kconfig: PINCTRL_IMX select REGMAP

+9 -7
+1
drivers/pinctrl/freescale/Kconfig
··· 2 2 bool 3 3 select PINMUX 4 4 select PINCONF 5 + select REGMAP 5 6 6 7 config PINCTRL_IMX1_CORE 7 8 bool
+5 -4
drivers/pinctrl/mediatek/pinctrl-mtk-common.c
··· 1004 1004 struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent); 1005 1005 int eint_num, virq, eint_offset; 1006 1006 unsigned int set_offset, bit, clr_bit, clr_offset, rst, i, unmask, dbnc; 1007 - static const unsigned int dbnc_arr[] = {0 , 1, 16, 32, 64, 128, 256}; 1007 + static const unsigned int debounce_time[] = {500, 1000, 16000, 32000, 64000, 1008 + 128000, 256000}; 1008 1009 const struct mtk_desc_pin *pin; 1009 1010 struct irq_data *d; 1010 1011 ··· 1023 1022 if (!mtk_eint_can_en_debounce(pctl, eint_num)) 1024 1023 return -ENOSYS; 1025 1024 1026 - dbnc = ARRAY_SIZE(dbnc_arr); 1027 - for (i = 0; i < ARRAY_SIZE(dbnc_arr); i++) { 1028 - if (debounce <= dbnc_arr[i]) { 1025 + dbnc = ARRAY_SIZE(debounce_time); 1026 + for (i = 0; i < ARRAY_SIZE(debounce_time); i++) { 1027 + if (debounce <= debounce_time[i]) { 1029 1028 dbnc = i; 1030 1029 break; 1031 1030 }
+3 -3
drivers/pinctrl/pinctrl-single.c
··· 1280 1280 1281 1281 /* Parse pins in each row from LSB */ 1282 1282 while (mask) { 1283 - bit_pos = ffs(mask); 1283 + bit_pos = __ffs(mask); 1284 1284 pin_num_from_lsb = bit_pos / pcs->bits_per_pin; 1285 - mask_pos = ((pcs->fmask) << (bit_pos - 1)); 1285 + mask_pos = ((pcs->fmask) << bit_pos); 1286 1286 val_pos = val & mask_pos; 1287 1287 submask = mask & mask_pos; 1288 1288 ··· 1852 1852 ret = of_property_read_u32(np, "pinctrl-single,function-mask", 1853 1853 &pcs->fmask); 1854 1854 if (!ret) { 1855 - pcs->fshift = ffs(pcs->fmask) - 1; 1855 + pcs->fshift = __ffs(pcs->fmask); 1856 1856 pcs->fmax = pcs->fmask >> pcs->fshift; 1857 1857 } else { 1858 1858 /* If mask property doesn't exist, function mux is invalid. */