Skip to content

Commit

Permalink
Merge tag 'pinctrl-v3.14-2' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/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
  • Loading branch information
torvalds committed Feb 8, 2014
2 parents c132ade + 5b232c5 commit 4944790
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 15 deletions.
8 changes: 6 additions & 2 deletions drivers/pinctrl/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,9 @@ static struct pinctrl *create_pinctrl(struct device *dev)
kref_init(&p->users);

/* Add the pinctrl handle to the global list */
mutex_lock(&pinctrl_list_mutex);
list_add_tail(&p->node, &pinctrl_list);
mutex_unlock(&pinctrl_list_mutex);

return p;
}
Expand Down Expand Up @@ -1642,8 +1644,10 @@ static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev)
device_root, pctldev, &pinctrl_groups_ops);
debugfs_create_file("gpio-ranges", S_IFREG | S_IRUGO,
device_root, pctldev, &pinctrl_gpioranges_ops);
pinmux_init_device_debugfs(device_root, pctldev);
pinconf_init_device_debugfs(device_root, pctldev);
if (pctldev->desc->pmxops)
pinmux_init_device_debugfs(device_root, pctldev);
if (pctldev->desc->confops)
pinconf_init_device_debugfs(device_root, pctldev);
}

static void pinctrl_remove_device_debugfs(struct pinctrl_dev *pctldev)
Expand Down
10 changes: 5 additions & 5 deletions drivers/pinctrl/pinctrl-at91.c
Original file line number Diff line number Diff line change
Expand Up @@ -1286,22 +1286,22 @@ static int alt_gpio_irq_type(struct irq_data *d, unsigned type)

switch (type) {
case IRQ_TYPE_EDGE_RISING:
irq_set_handler(d->irq, handle_simple_irq);
__irq_set_handler_locked(d->irq, handle_simple_irq);
writel_relaxed(mask, pio + PIO_ESR);
writel_relaxed(mask, pio + PIO_REHLSR);
break;
case IRQ_TYPE_EDGE_FALLING:
irq_set_handler(d->irq, handle_simple_irq);
__irq_set_handler_locked(d->irq, handle_simple_irq);
writel_relaxed(mask, pio + PIO_ESR);
writel_relaxed(mask, pio + PIO_FELLSR);
break;
case IRQ_TYPE_LEVEL_LOW:
irq_set_handler(d->irq, handle_level_irq);
__irq_set_handler_locked(d->irq, handle_level_irq);
writel_relaxed(mask, pio + PIO_LSR);
writel_relaxed(mask, pio + PIO_FELLSR);
break;
case IRQ_TYPE_LEVEL_HIGH:
irq_set_handler(d->irq, handle_level_irq);
__irq_set_handler_locked(d->irq, handle_level_irq);
writel_relaxed(mask, pio + PIO_LSR);
writel_relaxed(mask, pio + PIO_REHLSR);
break;
Expand All @@ -1310,7 +1310,7 @@ static int alt_gpio_irq_type(struct irq_data *d, unsigned type)
* disable additional interrupt modes:
* fall back to default behavior
*/
irq_set_handler(d->irq, handle_simple_irq);
__irq_set_handler_locked(d->irq, handle_simple_irq);
writel_relaxed(mask, pio + PIO_AIMDR);
return 0;
case IRQ_TYPE_NONE:
Expand Down
10 changes: 5 additions & 5 deletions drivers/pinctrl/pinctrl-imx1-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct imx1_pinctrl {
#define MX1_DDIR 0x00
#define MX1_OCR 0x04
#define MX1_ICONFA 0x0c
#define MX1_ICONFB 0x10
#define MX1_ICONFB 0x14
#define MX1_GIUS 0x20
#define MX1_GPR 0x38
#define MX1_PUEN 0x40
Expand Down Expand Up @@ -97,13 +97,13 @@ static void imx1_write_2bit(struct imx1_pinctrl *ipctl, unsigned int pin_id,
u32 old_val;
u32 new_val;

dev_dbg(ipctl->dev, "write: register 0x%p offset %d value 0x%x\n",
reg, offset, value);

/* Use the next register if the pin's port pin number is >=16 */
if (pin_id % 32 >= 16)
reg += 0x04;

dev_dbg(ipctl->dev, "write: register 0x%p offset %d value 0x%x\n",
reg, offset, value);

/* Get current state of pins */
old_val = readl(reg);
old_val &= mask;
Expand Down Expand Up @@ -139,7 +139,7 @@ static int imx1_read_2bit(struct imx1_pinctrl *ipctl, unsigned int pin_id,
u32 reg_offset)
{
void __iomem *reg = imx1_mem(ipctl, pin_id) + reg_offset;
int offset = pin_id % 16;
int offset = (pin_id % 16) * 2;

/* Use the next register if the pin's port pin number is >=16 */
if (pin_id % 32 >= 16)
Expand Down
2 changes: 1 addition & 1 deletion drivers/pinctrl/pinctrl-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ int tegra_pinctrl_probe(struct platform_device *pdev,
GFP_KERNEL);
if (!pmx->regs) {
dev_err(&pdev->dev, "Can't alloc regs pointer\n");
return -ENODEV;
return -ENOMEM;
}

for (i = 0; i < pmx->nbanks; i++) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/pinctrl/sirf/pinctrl-prima2.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ static const struct sirfsoc_padmux ac97_padmux = {
.funcval = 0,
};

static const unsigned ac97_pins[] = { 33, 34, 35, 36 };
static const unsigned ac97_pins[] = { 43, 44, 45, 46 };

static const struct sirfsoc_muxmask spi1_muxmask[] = {
{
Expand Down
15 changes: 14 additions & 1 deletion drivers/pinctrl/vt8500/pinctrl-wmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,20 @@ static int wmt_pctl_dt_node_to_map_pull(struct wmt_pinctrl_data *data,
if (!configs)
return -ENOMEM;

configs[0] = pull;
switch (pull) {
case 0:
configs[0] = PIN_CONFIG_BIAS_DISABLE;
break;
case 1:
configs[0] = PIN_CONFIG_BIAS_PULL_DOWN;
break;
case 2:
configs[0] = PIN_CONFIG_BIAS_PULL_UP;
break;
default:
configs[0] = PIN_CONFIG_BIAS_DISABLE;
dev_err(data->dev, "invalid pull state %d - disabling\n", pull);
}

map->type = PIN_MAP_TYPE_CONFIGS_PIN;
map->data.configs.group_or_pin = data->groups[group];
Expand Down

0 comments on commit 4944790

Please sign in to comment.