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 'gpio-fixes-v3.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO fixes from Linus Walleij:
- An OMAP fix that makes ethernet work again.
- Fix for build problem when building the MCP23S08 driver as module.
- IRQ conflicts in the Langwell driver.
- Fix IRQ coherency issues in the MXS driver.
- Return correct errorcode on errorpath when removing GPIO chips.

* tag 'gpio-fixes-v3.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
gpio: Don't override the error code in probe error handling
gpio: mxs: Use set and clear capabilities of the gpio controller
gpio-langwell: fix irq conflicts when DT is not used
gpio: mcp23s08: Fix build error when CONFIG_SPI_MASTER=y && CONFIG_I2C=m
gpio/omap: ensure gpio context is initialised

+64 -21
+1 -1
drivers/gpio/Kconfig
··· 636 636 637 637 config GPIO_MCP23S08 638 638 tristate "Microchip MCP23xxx I/O expander" 639 - depends on SPI_MASTER || I2C 639 + depends on (SPI_MASTER && !I2C) || I2C 640 640 help 641 641 SPI/I2C driver for Microchip MCP23S08/MCP23S17/MCP23008/MCP23017 642 642 I/O expanders.
+10 -7
drivers/gpio/gpio-langwell.c
··· 324 324 resource_size_t start, len; 325 325 struct lnw_gpio *lnw; 326 326 u32 gpio_base; 327 + u32 irq_base; 327 328 int retval; 328 329 int ngpio = id->driver_data; 329 330 ··· 346 345 retval = -EFAULT; 347 346 goto err_ioremap; 348 347 } 348 + irq_base = *(u32 *)base; 349 349 gpio_base = *((u32 *)base + 1); 350 350 /* release the IO mapping, since we already get the info from bar1 */ 351 351 iounmap(base); ··· 367 365 goto err_ioremap; 368 366 } 369 367 370 - lnw->domain = irq_domain_add_linear(pdev->dev.of_node, ngpio, 371 - &lnw_gpio_irq_ops, lnw); 372 - if (!lnw->domain) { 373 - retval = -ENOMEM; 374 - goto err_ioremap; 375 - } 376 - 377 368 lnw->reg_base = base; 378 369 lnw->chip.label = dev_name(&pdev->dev); 379 370 lnw->chip.request = lnw_gpio_request; ··· 379 384 lnw->chip.ngpio = ngpio; 380 385 lnw->chip.can_sleep = 0; 381 386 lnw->pdev = pdev; 387 + 388 + lnw->domain = irq_domain_add_simple(pdev->dev.of_node, ngpio, irq_base, 389 + &lnw_gpio_irq_ops, lnw); 390 + if (!lnw->domain) { 391 + retval = -ENOMEM; 392 + goto err_ioremap; 393 + } 394 + 382 395 pci_set_drvdata(pdev, lnw); 383 396 retval = gpiochip_add(&lnw->chip); 384 397 if (retval) {
+1 -2
drivers/gpio/gpio-ml-ioh.c
··· 496 496 err_gpiochip_add: 497 497 while (--i >= 0) { 498 498 chip--; 499 - ret = gpiochip_remove(&chip->gpio); 500 - if (ret) 499 + if (gpiochip_remove(&chip->gpio)) 501 500 dev_err(&pdev->dev, "Failed gpiochip_remove(%d)\n", i); 502 501 } 503 502 kfree(chip_save);
+2 -1
drivers/gpio/gpio-mxs.c
··· 326 326 327 327 err = bgpio_init(&port->bgc, &pdev->dev, 4, 328 328 port->base + PINCTRL_DIN(port), 329 - port->base + PINCTRL_DOUT(port), NULL, 329 + port->base + PINCTRL_DOUT(port) + MXS_SET, 330 + port->base + PINCTRL_DOUT(port) + MXS_CLR, 330 331 port->base + PINCTRL_DOE(port), NULL, 0); 331 332 if (err) 332 333 goto out_irqdesc_free;
+45 -3
drivers/gpio/gpio-omap.c
··· 69 69 bool is_mpuio; 70 70 bool dbck_flag; 71 71 bool loses_context; 72 + bool context_valid; 72 73 int stride; 73 74 u32 width; 74 75 int context_loss_count; ··· 1129 1128 bank->loses_context = true; 1130 1129 } else { 1131 1130 bank->loses_context = pdata->loses_context; 1131 + 1132 + if (bank->loses_context) 1133 + bank->get_context_loss_count = 1134 + pdata->get_context_loss_count; 1132 1135 } 1133 1136 1134 1137 ··· 1182 1177 omap_gpio_mod_init(bank); 1183 1178 omap_gpio_chip_init(bank); 1184 1179 omap_gpio_show_rev(bank); 1185 - 1186 - if (bank->loses_context) 1187 - bank->get_context_loss_count = pdata->get_context_loss_count; 1188 1180 1189 1181 pm_runtime_put(bank->dev); 1190 1182 ··· 1261 1259 return 0; 1262 1260 } 1263 1261 1262 + static void omap_gpio_init_context(struct gpio_bank *p); 1263 + 1264 1264 static int omap_gpio_runtime_resume(struct device *dev) 1265 1265 { 1266 1266 struct platform_device *pdev = to_platform_device(dev); ··· 1272 1268 int c; 1273 1269 1274 1270 spin_lock_irqsave(&bank->lock, flags); 1271 + 1272 + /* 1273 + * On the first resume during the probe, the context has not 1274 + * been initialised and so initialise it now. Also initialise 1275 + * the context loss count. 1276 + */ 1277 + if (bank->loses_context && !bank->context_valid) { 1278 + omap_gpio_init_context(bank); 1279 + 1280 + if (bank->get_context_loss_count) 1281 + bank->context_loss_count = 1282 + bank->get_context_loss_count(bank->dev); 1283 + } 1284 + 1275 1285 _gpio_dbck_enable(bank); 1276 1286 1277 1287 /* ··· 1402 1384 } 1403 1385 1404 1386 #if defined(CONFIG_PM_RUNTIME) 1387 + static void omap_gpio_init_context(struct gpio_bank *p) 1388 + { 1389 + struct omap_gpio_reg_offs *regs = p->regs; 1390 + void __iomem *base = p->base; 1391 + 1392 + p->context.ctrl = __raw_readl(base + regs->ctrl); 1393 + p->context.oe = __raw_readl(base + regs->direction); 1394 + p->context.wake_en = __raw_readl(base + regs->wkup_en); 1395 + p->context.leveldetect0 = __raw_readl(base + regs->leveldetect0); 1396 + p->context.leveldetect1 = __raw_readl(base + regs->leveldetect1); 1397 + p->context.risingdetect = __raw_readl(base + regs->risingdetect); 1398 + p->context.fallingdetect = __raw_readl(base + regs->fallingdetect); 1399 + p->context.irqenable1 = __raw_readl(base + regs->irqenable); 1400 + p->context.irqenable2 = __raw_readl(base + regs->irqenable2); 1401 + 1402 + if (regs->set_dataout && p->regs->clr_dataout) 1403 + p->context.dataout = __raw_readl(base + regs->set_dataout); 1404 + else 1405 + p->context.dataout = __raw_readl(base + regs->dataout); 1406 + 1407 + p->context_valid = true; 1408 + } 1409 + 1405 1410 static void omap_gpio_restore_context(struct gpio_bank *bank) 1406 1411 { 1407 1412 __raw_writel(bank->context.wake_en, ··· 1462 1421 #else 1463 1422 #define omap_gpio_runtime_suspend NULL 1464 1423 #define omap_gpio_runtime_resume NULL 1424 + static void omap_gpio_init_context(struct gpio_bank *p) {} 1465 1425 #endif 1466 1426 1467 1427 static const struct dev_pm_ops gpio_pm_ops = {
+1 -2
drivers/gpio/gpio-pch.c
··· 424 424 err_request_irq: 425 425 irq_free_descs(irq_base, gpio_pins[chip->ioh]); 426 426 427 - ret = gpiochip_remove(&chip->gpio); 428 - if (ret) 427 + if (gpiochip_remove(&chip->gpio)) 429 428 dev_err(&pdev->dev, "%s gpiochip_remove failed\n", __func__); 430 429 431 430 err_gpiochip_add:
+2 -4
drivers/gpio/gpio-sch.c
··· 272 272 return 0; 273 273 274 274 err_sch_gpio_resume: 275 - err = gpiochip_remove(&sch_gpio_core); 276 - if (err) 277 - dev_err(&pdev->dev, "%s failed, %d\n", 278 - "gpiochip_remove()", err); 275 + if (gpiochip_remove(&sch_gpio_core)) 276 + dev_err(&pdev->dev, "%s gpiochip_remove failed\n", __func__); 279 277 280 278 err_sch_gpio_core: 281 279 release_region(res->start, resource_size(res));
+2 -1
drivers/gpio/gpio-viperboard.c
··· 446 446 return ret; 447 447 448 448 err_gpiob: 449 - ret = gpiochip_remove(&vb_gpio->gpioa); 449 + if (gpiochip_remove(&vb_gpio->gpioa)) 450 + dev_err(&pdev->dev, "%s gpiochip_remove failed\n", __func__); 450 451 451 452 err_gpioa: 452 453 return ret;