Skip to content

Commit

Permalink
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/sameo/mfd-2.6

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (73 commits)
  power: Revert "power_supply: Mark twl4030_charger as broken"
  mfd: Fix a memory leak when unload mc13xxx-core module
  mfd: Fix resource reclaim for max8998
  mfd: Remove unneeded ret value checking for max8998 register updates
  mfd: Add free max8998->ono irq in max8998_irq_exit()
  mfd: Fix resource reclaim in pcf50633_remove()
  omap4: pandaboard: fix up mmc card detect logic
  mfd: Fix ezx_pcap_probe error path
  mfd: Fix off-by-one value range checking for tps6507x
  mfd: Remove __devinitdata from tc6393xb_mmc_resources
  mfd: Add WM831x SPI support
  mfd: Factor out WM831x I2C I/O from the core driver
  mfd: Remove DEBUG defines from mc13xxx-core
  mfd: Fix jz4740_adc_set_enabled
  mfd: Add TPS658621C device ID
  mfd: Fix twl-irq function declaration warnings
  regulator: max8998 BUCK1/2 voltage change with use of GPIOs
  mfd: Voltages and GPIOs platform_data definitions for max8998
  regulator: max8998 BUCK1/2 internal voltages and indexes defined
  mfd: Support for ICs compliant with max8998
  ...
  • Loading branch information
torvalds committed Oct 28, 2010
2 parents a0cadc2 + 0f48285 commit b779b33
Show file tree
Hide file tree
Showing 77 changed files with 5,648 additions and 2,033 deletions.
7 changes: 6 additions & 1 deletion arch/arm/mach-omap2/board-4430sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,14 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev)
struct omap_mmc_platform_data *pdata = dev->platform_data;

/* Setting MMC1 Card detect Irq */
if (pdev->id == 0)
if (pdev->id == 0) {
ret = twl6030_mmc_card_detect_config();
if (ret)
pr_err("Failed configuring MMC1 card detect\n");
pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE +
MMCDETECT_INTR_OFFSET;
pdata->slots[0].card_detect = twl6030_mmc_card_detect;
}
return ret;
}

Expand Down
15 changes: 12 additions & 3 deletions arch/arm/mach-omap2/board-omap4panda.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,19 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev)
struct platform_device, dev);
struct omap_mmc_platform_data *pdata = dev->platform_data;

if (!pdata) {
dev_err(dev, "%s: NULL platform data\n", __func__);
return -EINVAL;
}
/* Setting MMC1 Card detect Irq */
if (pdev->id == 0)
pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE +
MMCDETECT_INTR_OFFSET;
if (pdev->id == 0) {
ret = twl6030_mmc_card_detect_config();
if (ret)
dev_err(dev, "%s: Error card detect config(%d)\n",
__func__, ret);
else
pdata->slots[0].card_detect = twl6030_mmc_card_detect;
}
return ret;
}

Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c64xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ config SMDK6410_WM1192_EV1
select REGULATOR_WM831X
select S3C24XX_GPIO_EXTRA64
select MFD_WM831X
select MFD_WM831X_I2C
help
The Wolfson Microelectronics 1192-EV1 is a WM831x based PMIC
daughtercard for the Samsung SMDK6410 reference platform.
Expand Down
19 changes: 19 additions & 0 deletions arch/arm/mach-shmobile/board-ap4evb.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,18 @@ static struct platform_device smc911x_device = {
},
};

/*
* The card detect pin of the top SD/MMC slot (CN7) is active low and is
* connected to GPIO A22 of SH7372 (GPIO_PORT41).
*/
static int slot_cn7_get_cd(struct platform_device *pdev)
{
if (gpio_is_valid(GPIO_PORT41))
return !gpio_get_value(GPIO_PORT41);
else
return -ENXIO;
}

/* SH_MMCIF */
static struct resource sh_mmcif_resources[] = {
[0] = {
Expand All @@ -261,6 +273,7 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = {
.caps = MMC_CAP_4_BIT_DATA |
MMC_CAP_8_BIT_DATA |
MMC_CAP_NEEDS_POLL,
.get_cd = slot_cn7_get_cd,
};

static struct platform_device sh_mmcif_device = {
Expand Down Expand Up @@ -310,6 +323,8 @@ static struct sh_mobile_sdhi_info sdhi1_info = {
.dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,
.tmio_ocr_mask = MMC_VDD_165_195,
.tmio_flags = TMIO_MMC_WRPROTECT_DISABLE,
.tmio_caps = MMC_CAP_NEEDS_POLL,
.get_cd = slot_cn7_get_cd,
};

static struct resource sdhi1_resources[] = {
Expand Down Expand Up @@ -948,6 +963,10 @@ static void __init ap4evb_init(void)
gpio_no_direction(GPIO_PORT9CR); /* FSIAOBT needs no direction */
gpio_no_direction(GPIO_PORT10CR); /* FSIAOLR needs no direction */

/* card detect pin for MMC slot (CN7) */
gpio_request(GPIO_PORT41, NULL);
gpio_direction_input(GPIO_PORT41);

/* set SPU2 clock to 119.6 MHz */
clk = clk_get(NULL, "spu_clk");
if (!IS_ERR(clk)) {
Expand Down
12 changes: 12 additions & 0 deletions drivers/gpio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@ config GPIO_SCH
This driver can also be built as a module. If so, the module
will be called sch-gpio.

config GPIO_VX855
tristate "VIA VX855/VX875 GPIO"
depends on GPIOLIB
select MFD_CORE
select MFD_VX855
help
Support access to the VX855/VX875 GPIO lines through the gpio library.

This driver provides common support for accessing the device,
additional drivers must be enabled in order to use the
functionality of the device.

comment "I2C GPIO expanders:"

config GPIO_MAX7300
Expand Down
1 change: 1 addition & 0 deletions drivers/gpio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ obj-$(CONFIG_GPIO_SCH) += sch_gpio.o
obj-$(CONFIG_GPIO_RDC321X) += rdc321x-gpio.o
obj-$(CONFIG_GPIO_JANZ_TTL) += janz-ttl.o
obj-$(CONFIG_GPIO_SX150X) += sx150x.o
obj-$(CONFIG_GPIO_VX855) += vx855_gpio.o
13 changes: 9 additions & 4 deletions drivers/gpio/stmpe-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ struct stmpe_gpio {
struct mutex irq_lock;

int irq_base;
unsigned norequest_mask;

/* Caches of interrupt control registers for bus_lock */
u8 regs[CACHE_NR_REGS][CACHE_NR_BANKS];
Expand Down Expand Up @@ -103,6 +104,9 @@ static int stmpe_gpio_request(struct gpio_chip *chip, unsigned offset)
struct stmpe_gpio *stmpe_gpio = to_stmpe_gpio(chip);
struct stmpe *stmpe = stmpe_gpio->stmpe;

if (stmpe_gpio->norequest_mask & (1 << offset))
return -EINVAL;

return stmpe_set_altfunc(stmpe, 1 << offset, STMPE_BLOCK_GPIO);
}

Expand Down Expand Up @@ -287,8 +291,6 @@ static int __devinit stmpe_gpio_probe(struct platform_device *pdev)
int irq;

pdata = stmpe->pdata->gpio;
if (!pdata)
return -ENODEV;

irq = platform_get_irq(pdev, 0);
if (irq < 0)
Expand All @@ -302,6 +304,7 @@ static int __devinit stmpe_gpio_probe(struct platform_device *pdev)

stmpe_gpio->dev = &pdev->dev;
stmpe_gpio->stmpe = stmpe;
stmpe_gpio->norequest_mask = pdata ? pdata->norequest_mask : 0;

stmpe_gpio->chip = template_chip;
stmpe_gpio->chip.ngpio = stmpe->num_gpios;
Expand All @@ -312,11 +315,11 @@ static int __devinit stmpe_gpio_probe(struct platform_device *pdev)

ret = stmpe_enable(stmpe, STMPE_BLOCK_GPIO);
if (ret)
return ret;
goto out_free;

ret = stmpe_gpio_irq_init(stmpe_gpio);
if (ret)
goto out_free;
goto out_disable;

ret = request_threaded_irq(irq, NULL, stmpe_gpio_irq, IRQF_ONESHOT,
"stmpe-gpio", stmpe_gpio);
Expand All @@ -342,6 +345,8 @@ static int __devinit stmpe_gpio_probe(struct platform_device *pdev)
free_irq(irq, stmpe_gpio);
out_removeirq:
stmpe_gpio_irq_remove(stmpe_gpio);
out_disable:
stmpe_disable(stmpe, STMPE_BLOCK_GPIO);
out_free:
kfree(stmpe_gpio);
return ret;
Expand Down
Loading

0 comments on commit b779b33

Please sign in to comment.