diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-01 11:34:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-01 11:34:13 -0500 |
commit | c325b3533730016ca5cdaf902d62550b4243fe43 (patch) | |
tree | 03d2690d6df1c449b1f8db597d3e574d894e3ddc | |
parent | a2ca3d617944417e9dd5f09fc8a4549cda115f4f (diff) | |
parent | cdca06e4e85974d8a3503ab15709dbbaf90d3dd1 (diff) |
Merge tag 'pinctrl-v4.10-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control fixes from Linus Walleij:
"Another week, another set of pin control fixes. The subsystem has seen
high patch-spot activity recently.
The majority of the patches are for Intel, I vaguely think it mostly
concern phones, tablets and maybe chromebooks and even laptops with
this Intel Atom family chips.
Driver fixes only:
- one fix to the Berlin driver making the SD card work fully again.
- one fix to the Allwinner/sunxi bias function: one premature change
needs to be partially reverted.
- the remaining four patches are to Intel embedded SoCs: baytrail
(three patches) and merrifield (one patch): register access
debounce fixes and a missing spinlock"
* tag 'pinctrl-v4.10-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
pinctrl: baytrail: Add missing spinlock usage in byt_gpio_irq_handler
pinctrl: baytrail: Debounce register is one per community
pinctrl: baytrail: Rectify debounce support (part 2)
pinctrl: intel: merrifield: Add missed check in mrfld_config_set()
pinctrl: sunxi: Don't enforce bias disable (for now)
pinctrl: berlin-bg4ct: fix the value for "sd1a" of pin SCRD0_CRD_PRES
-rw-r--r-- | drivers/pinctrl/berlin/berlin-bg4ct.c | 2 | ||||
-rw-r--r-- | drivers/pinctrl/intel/pinctrl-baytrail.c | 27 | ||||
-rw-r--r-- | drivers/pinctrl/intel/pinctrl-merrifield.c | 3 | ||||
-rw-r--r-- | drivers/pinctrl/sunxi/pinctrl-sunxi.c | 3 |
4 files changed, 25 insertions, 10 deletions
diff --git a/drivers/pinctrl/berlin/berlin-bg4ct.c b/drivers/pinctrl/berlin/berlin-bg4ct.c index 09172043d589..c617ec49e9ed 100644 --- a/drivers/pinctrl/berlin/berlin-bg4ct.c +++ b/drivers/pinctrl/berlin/berlin-bg4ct.c | |||
@@ -217,7 +217,7 @@ static const struct berlin_desc_group berlin4ct_soc_pinctrl_groups[] = { | |||
217 | BERLIN_PINCTRL_GROUP("SCRD0_CRD_PRES", 0xc, 0x3, 0x15, | 217 | BERLIN_PINCTRL_GROUP("SCRD0_CRD_PRES", 0xc, 0x3, 0x15, |
218 | BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO20 */ | 218 | BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO20 */ |
219 | BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"), /* crd pres */ | 219 | BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"), /* crd pres */ |
220 | BERLIN_PINCTRL_FUNCTION(0x1, "sd1a")), /* DAT3 */ | 220 | BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")), /* DAT3 */ |
221 | BERLIN_PINCTRL_GROUP("SPI1_SS0n", 0xc, 0x3, 0x18, | 221 | BERLIN_PINCTRL_GROUP("SPI1_SS0n", 0xc, 0x3, 0x18, |
222 | BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SS0n */ | 222 | BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SS0n */ |
223 | BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO37 */ | 223 | BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO37 */ |
diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c index c123488266ce..d94aef17348b 100644 --- a/drivers/pinctrl/intel/pinctrl-baytrail.c +++ b/drivers/pinctrl/intel/pinctrl-baytrail.c | |||
@@ -731,16 +731,23 @@ static void __iomem *byt_gpio_reg(struct byt_gpio *vg, unsigned int offset, | |||
731 | int reg) | 731 | int reg) |
732 | { | 732 | { |
733 | struct byt_community *comm = byt_get_community(vg, offset); | 733 | struct byt_community *comm = byt_get_community(vg, offset); |
734 | u32 reg_offset = 0; | 734 | u32 reg_offset; |
735 | 735 | ||
736 | if (!comm) | 736 | if (!comm) |
737 | return NULL; | 737 | return NULL; |
738 | 738 | ||
739 | offset -= comm->pin_base; | 739 | offset -= comm->pin_base; |
740 | if (reg == BYT_INT_STAT_REG) | 740 | switch (reg) { |
741 | case BYT_INT_STAT_REG: | ||
741 | reg_offset = (offset / 32) * 4; | 742 | reg_offset = (offset / 32) * 4; |
742 | else | 743 | break; |
744 | case BYT_DEBOUNCE_REG: | ||
745 | reg_offset = 0; | ||
746 | break; | ||
747 | default: | ||
743 | reg_offset = comm->pad_map[offset] * 16; | 748 | reg_offset = comm->pad_map[offset] * 16; |
749 | break; | ||
750 | } | ||
744 | 751 | ||
745 | return comm->reg_base + reg_offset + reg; | 752 | return comm->reg_base + reg_offset + reg; |
746 | } | 753 | } |
@@ -1243,10 +1250,12 @@ static int byt_pin_config_set(struct pinctrl_dev *pctl_dev, | |||
1243 | debounce = readl(db_reg); | 1250 | debounce = readl(db_reg); |
1244 | debounce &= ~BYT_DEBOUNCE_PULSE_MASK; | 1251 | debounce &= ~BYT_DEBOUNCE_PULSE_MASK; |
1245 | 1252 | ||
1253 | if (arg) | ||
1254 | conf |= BYT_DEBOUNCE_EN; | ||
1255 | else | ||
1256 | conf &= ~BYT_DEBOUNCE_EN; | ||
1257 | |||
1246 | switch (arg) { | 1258 | switch (arg) { |
1247 | case 0: | ||
1248 | conf &= BYT_DEBOUNCE_EN; | ||
1249 | break; | ||
1250 | case 375: | 1259 | case 375: |
1251 | debounce |= BYT_DEBOUNCE_PULSE_375US; | 1260 | debounce |= BYT_DEBOUNCE_PULSE_375US; |
1252 | break; | 1261 | break; |
@@ -1269,7 +1278,9 @@ static int byt_pin_config_set(struct pinctrl_dev *pctl_dev, | |||
1269 | debounce |= BYT_DEBOUNCE_PULSE_24MS; | 1278 | debounce |= BYT_DEBOUNCE_PULSE_24MS; |
1270 | break; | 1279 | break; |
1271 | default: | 1280 | default: |
1272 | ret = -EINVAL; | 1281 | if (arg) |
1282 | ret = -EINVAL; | ||
1283 | break; | ||
1273 | } | 1284 | } |
1274 | 1285 | ||
1275 | if (!ret) | 1286 | if (!ret) |
@@ -1612,7 +1623,9 @@ static void byt_gpio_irq_handler(struct irq_desc *desc) | |||
1612 | continue; | 1623 | continue; |
1613 | } | 1624 | } |
1614 | 1625 | ||
1626 | raw_spin_lock(&vg->lock); | ||
1615 | pending = readl(reg); | 1627 | pending = readl(reg); |
1628 | raw_spin_unlock(&vg->lock); | ||
1616 | for_each_set_bit(pin, &pending, 32) { | 1629 | for_each_set_bit(pin, &pending, 32) { |
1617 | virq = irq_find_mapping(vg->chip.irqdomain, base + pin); | 1630 | virq = irq_find_mapping(vg->chip.irqdomain, base + pin); |
1618 | generic_handle_irq(virq); | 1631 | generic_handle_irq(virq); |
diff --git a/drivers/pinctrl/intel/pinctrl-merrifield.c b/drivers/pinctrl/intel/pinctrl-merrifield.c index b21896126f76..4d4ef42a39b5 100644 --- a/drivers/pinctrl/intel/pinctrl-merrifield.c +++ b/drivers/pinctrl/intel/pinctrl-merrifield.c | |||
@@ -794,6 +794,9 @@ static int mrfld_config_set(struct pinctrl_dev *pctldev, unsigned int pin, | |||
794 | unsigned int i; | 794 | unsigned int i; |
795 | int ret; | 795 | int ret; |
796 | 796 | ||
797 | if (!mrfld_buf_available(mp, pin)) | ||
798 | return -ENOTSUPP; | ||
799 | |||
797 | for (i = 0; i < nconfigs; i++) { | 800 | for (i = 0; i < nconfigs; i++) { |
798 | switch (pinconf_to_config_param(configs[i])) { | 801 | switch (pinconf_to_config_param(configs[i])) { |
799 | case PIN_CONFIG_BIAS_DISABLE: | 802 | case PIN_CONFIG_BIAS_DISABLE: |
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index 0eb51e33cb1b..207a8de4e1ed 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c | |||
@@ -564,8 +564,7 @@ static int sunxi_pconf_group_set(struct pinctrl_dev *pctldev, | |||
564 | val = arg / 10 - 1; | 564 | val = arg / 10 - 1; |
565 | break; | 565 | break; |
566 | case PIN_CONFIG_BIAS_DISABLE: | 566 | case PIN_CONFIG_BIAS_DISABLE: |
567 | val = 0; | 567 | continue; |
568 | break; | ||
569 | case PIN_CONFIG_BIAS_PULL_UP: | 568 | case PIN_CONFIG_BIAS_PULL_UP: |
570 | if (arg == 0) | 569 | if (arg == 0) |
571 | return -EINVAL; | 570 | return -EINVAL; |