aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-02-08 17:31:39 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-02-08 17:31:39 -0500
commit494479038d97f1b9f76fc633a360a681acdf035c (patch)
treeda588d74320417838c15d93d568050dbe0c1f4ef
parentc132adef53739d9911326fc308d34045a0ea5446 (diff)
parent5b232c5addc02980cfce451575f1d1f975bdb04e (diff)
Merge tag 'pinctrl-v3.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pinctrl fixes from Linus Walleij: "First round of pin control fixes for v3.14: - Protect pinctrl_list_add() with the proper mutex. This was identified by RedHat. Caused nasty locking warnings was rootcased by Stanislaw Gruszka. - Avoid adding dangerous debugfs files when either half of the subsystem is unused: pinmux or pinconf. - Various fixes to various drivers: locking, hardware particulars, DT parsing, error codes" * tag 'pinctrl-v3.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: tegra: return correct error type pinctrl: do not init debugfs entries for unimplemented functionalities pinctrl: protect pinctrl_list add pinctrl: sirf: correct the pin index of ac97_pins group pinctrl: imx27: fix offset calculation in imx_read_2bit pinctrl: vt8500: Change devicetree data parsing pinctrl: imx27: fix wrong offset to ICONFB pinctrl: at91: use locked variant of irq_set_handler
-rw-r--r--drivers/pinctrl/core.c8
-rw-r--r--drivers/pinctrl/pinctrl-at91.c10
-rw-r--r--drivers/pinctrl/pinctrl-imx1-core.c10
-rw-r--r--drivers/pinctrl/pinctrl-tegra.c2
-rw-r--r--drivers/pinctrl/sirf/pinctrl-prima2.c2
-rw-r--r--drivers/pinctrl/vt8500/pinctrl-wmt.c15
6 files changed, 32 insertions, 15 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 5ee61a470016..c0fe6091566a 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -851,7 +851,9 @@ static struct pinctrl *create_pinctrl(struct device *dev)
851 kref_init(&p->users); 851 kref_init(&p->users);
852 852
853 /* Add the pinctrl handle to the global list */ 853 /* Add the pinctrl handle to the global list */
854 mutex_lock(&pinctrl_list_mutex);
854 list_add_tail(&p->node, &pinctrl_list); 855 list_add_tail(&p->node, &pinctrl_list);
856 mutex_unlock(&pinctrl_list_mutex);
855 857
856 return p; 858 return p;
857} 859}
@@ -1642,8 +1644,10 @@ static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev)
1642 device_root, pctldev, &pinctrl_groups_ops); 1644 device_root, pctldev, &pinctrl_groups_ops);
1643 debugfs_create_file("gpio-ranges", S_IFREG | S_IRUGO, 1645 debugfs_create_file("gpio-ranges", S_IFREG | S_IRUGO,
1644 device_root, pctldev, &pinctrl_gpioranges_ops); 1646 device_root, pctldev, &pinctrl_gpioranges_ops);
1645 pinmux_init_device_debugfs(device_root, pctldev); 1647 if (pctldev->desc->pmxops)
1646 pinconf_init_device_debugfs(device_root, pctldev); 1648 pinmux_init_device_debugfs(device_root, pctldev);
1649 if (pctldev->desc->confops)
1650 pinconf_init_device_debugfs(device_root, pctldev);
1647} 1651}
1648 1652
1649static void pinctrl_remove_device_debugfs(struct pinctrl_dev *pctldev) 1653static void pinctrl_remove_device_debugfs(struct pinctrl_dev *pctldev)
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 38c6f8b9790e..d990e33d8aa7 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -1286,22 +1286,22 @@ static int alt_gpio_irq_type(struct irq_data *d, unsigned type)
1286 1286
1287 switch (type) { 1287 switch (type) {
1288 case IRQ_TYPE_EDGE_RISING: 1288 case IRQ_TYPE_EDGE_RISING:
1289 irq_set_handler(d->irq, handle_simple_irq); 1289 __irq_set_handler_locked(d->irq, handle_simple_irq);
1290 writel_relaxed(mask, pio + PIO_ESR); 1290 writel_relaxed(mask, pio + PIO_ESR);
1291 writel_relaxed(mask, pio + PIO_REHLSR); 1291 writel_relaxed(mask, pio + PIO_REHLSR);
1292 break; 1292 break;
1293 case IRQ_TYPE_EDGE_FALLING: 1293 case IRQ_TYPE_EDGE_FALLING:
1294 irq_set_handler(d->irq, handle_simple_irq); 1294 __irq_set_handler_locked(d->irq, handle_simple_irq);
1295 writel_relaxed(mask, pio + PIO_ESR); 1295 writel_relaxed(mask, pio + PIO_ESR);
1296 writel_relaxed(mask, pio + PIO_FELLSR); 1296 writel_relaxed(mask, pio + PIO_FELLSR);
1297 break; 1297 break;
1298 case IRQ_TYPE_LEVEL_LOW: 1298 case IRQ_TYPE_LEVEL_LOW:
1299 irq_set_handler(d->irq, handle_level_irq); 1299 __irq_set_handler_locked(d->irq, handle_level_irq);
1300 writel_relaxed(mask, pio + PIO_LSR); 1300 writel_relaxed(mask, pio + PIO_LSR);
1301 writel_relaxed(mask, pio + PIO_FELLSR); 1301 writel_relaxed(mask, pio + PIO_FELLSR);
1302 break; 1302 break;
1303 case IRQ_TYPE_LEVEL_HIGH: 1303 case IRQ_TYPE_LEVEL_HIGH:
1304 irq_set_handler(d->irq, handle_level_irq); 1304 __irq_set_handler_locked(d->irq, handle_level_irq);
1305 writel_relaxed(mask, pio + PIO_LSR); 1305 writel_relaxed(mask, pio + PIO_LSR);
1306 writel_relaxed(mask, pio + PIO_REHLSR); 1306 writel_relaxed(mask, pio + PIO_REHLSR);
1307 break; 1307 break;
@@ -1310,7 +1310,7 @@ static int alt_gpio_irq_type(struct irq_data *d, unsigned type)
1310 * disable additional interrupt modes: 1310 * disable additional interrupt modes:
1311 * fall back to default behavior 1311 * fall back to default behavior
1312 */ 1312 */
1313 irq_set_handler(d->irq, handle_simple_irq); 1313 __irq_set_handler_locked(d->irq, handle_simple_irq);
1314 writel_relaxed(mask, pio + PIO_AIMDR); 1314 writel_relaxed(mask, pio + PIO_AIMDR);
1315 return 0; 1315 return 0;
1316 case IRQ_TYPE_NONE: 1316 case IRQ_TYPE_NONE:
diff --git a/drivers/pinctrl/pinctrl-imx1-core.c b/drivers/pinctrl/pinctrl-imx1-core.c
index 17aecde1b51d..815384b377b5 100644
--- a/drivers/pinctrl/pinctrl-imx1-core.c
+++ b/drivers/pinctrl/pinctrl-imx1-core.c
@@ -45,7 +45,7 @@ struct imx1_pinctrl {
45#define MX1_DDIR 0x00 45#define MX1_DDIR 0x00
46#define MX1_OCR 0x04 46#define MX1_OCR 0x04
47#define MX1_ICONFA 0x0c 47#define MX1_ICONFA 0x0c
48#define MX1_ICONFB 0x10 48#define MX1_ICONFB 0x14
49#define MX1_GIUS 0x20 49#define MX1_GIUS 0x20
50#define MX1_GPR 0x38 50#define MX1_GPR 0x38
51#define MX1_PUEN 0x40 51#define MX1_PUEN 0x40
@@ -97,13 +97,13 @@ static void imx1_write_2bit(struct imx1_pinctrl *ipctl, unsigned int pin_id,
97 u32 old_val; 97 u32 old_val;
98 u32 new_val; 98 u32 new_val;
99 99
100 dev_dbg(ipctl->dev, "write: register 0x%p offset %d value 0x%x\n",
101 reg, offset, value);
102
103 /* Use the next register if the pin's port pin number is >=16 */ 100 /* Use the next register if the pin's port pin number is >=16 */
104 if (pin_id % 32 >= 16) 101 if (pin_id % 32 >= 16)
105 reg += 0x04; 102 reg += 0x04;
106 103
104 dev_dbg(ipctl->dev, "write: register 0x%p offset %d value 0x%x\n",
105 reg, offset, value);
106
107 /* Get current state of pins */ 107 /* Get current state of pins */
108 old_val = readl(reg); 108 old_val = readl(reg);
109 old_val &= mask; 109 old_val &= mask;
@@ -139,7 +139,7 @@ static int imx1_read_2bit(struct imx1_pinctrl *ipctl, unsigned int pin_id,
139 u32 reg_offset) 139 u32 reg_offset)
140{ 140{
141 void __iomem *reg = imx1_mem(ipctl, pin_id) + reg_offset; 141 void __iomem *reg = imx1_mem(ipctl, pin_id) + reg_offset;
142 int offset = pin_id % 16; 142 int offset = (pin_id % 16) * 2;
143 143
144 /* Use the next register if the pin's port pin number is >=16 */ 144 /* Use the next register if the pin's port pin number is >=16 */
145 if (pin_id % 32 >= 16) 145 if (pin_id % 32 >= 16)
diff --git a/drivers/pinctrl/pinctrl-tegra.c b/drivers/pinctrl/pinctrl-tegra.c
index a2e93a2b5ff4..e767355ab0ad 100644
--- a/drivers/pinctrl/pinctrl-tegra.c
+++ b/drivers/pinctrl/pinctrl-tegra.c
@@ -645,7 +645,7 @@ int tegra_pinctrl_probe(struct platform_device *pdev,
645 GFP_KERNEL); 645 GFP_KERNEL);
646 if (!pmx->regs) { 646 if (!pmx->regs) {
647 dev_err(&pdev->dev, "Can't alloc regs pointer\n"); 647 dev_err(&pdev->dev, "Can't alloc regs pointer\n");
648 return -ENODEV; 648 return -ENOMEM;
649 } 649 }
650 650
651 for (i = 0; i < pmx->nbanks; i++) { 651 for (i = 0; i < pmx->nbanks; i++) {
diff --git a/drivers/pinctrl/sirf/pinctrl-prima2.c b/drivers/pinctrl/sirf/pinctrl-prima2.c
index 37b42651d76a..dde0285544d6 100644
--- a/drivers/pinctrl/sirf/pinctrl-prima2.c
+++ b/drivers/pinctrl/sirf/pinctrl-prima2.c
@@ -413,7 +413,7 @@ static const struct sirfsoc_padmux ac97_padmux = {
413 .funcval = 0, 413 .funcval = 0,
414}; 414};
415 415
416static const unsigned ac97_pins[] = { 33, 34, 35, 36 }; 416static const unsigned ac97_pins[] = { 43, 44, 45, 46 };
417 417
418static const struct sirfsoc_muxmask spi1_muxmask[] = { 418static const struct sirfsoc_muxmask spi1_muxmask[] = {
419 { 419 {
diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c
index b28d1af9c232..9802b67040cc 100644
--- a/drivers/pinctrl/vt8500/pinctrl-wmt.c
+++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c
@@ -276,7 +276,20 @@ static int wmt_pctl_dt_node_to_map_pull(struct wmt_pinctrl_data *data,
276 if (!configs) 276 if (!configs)
277 return -ENOMEM; 277 return -ENOMEM;
278 278
279 configs[0] = pull; 279 switch (pull) {
280 case 0:
281 configs[0] = PIN_CONFIG_BIAS_DISABLE;
282 break;
283 case 1:
284 configs[0] = PIN_CONFIG_BIAS_PULL_DOWN;
285 break;
286 case 2:
287 configs[0] = PIN_CONFIG_BIAS_PULL_UP;
288 break;
289 default:
290 configs[0] = PIN_CONFIG_BIAS_DISABLE;
291 dev_err(data->dev, "invalid pull state %d - disabling\n", pull);
292 }
280 293
281 map->type = PIN_MAP_TYPE_CONFIGS_PIN; 294 map->type = PIN_MAP_TYPE_CONFIGS_PIN;
282 map->data.configs.group_or_pin = data->groups[group]; 295 map->data.configs.group_or_pin = data->groups[group];