Skip to content

Commit

Permalink
Merge branch 'for-linus' 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-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
  mfd: Unlock mc13783 before subsystems initialisation, at probe time.
  mfd: WM835x GPIO direction register is not locked
  mfd: tmio_mmc hardware abstraction for CNF area
  mfd: WM8350 off by one bug
  mfd: Correct WM835x ISINK ramp time defines
  • Loading branch information
Linus Torvalds committed Jan 18, 2010
2 parents 8888be6 + 1e02b2c commit fe64454
Show file tree
Hide file tree
Showing 13 changed files with 342 additions and 169 deletions.
6 changes: 3 additions & 3 deletions drivers/mfd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ obj-$(CONFIG_HTC_PASIC3) += htc-pasic3.o

obj-$(CONFIG_MFD_DM355EVM_MSP) += dm355evm_msp.o

obj-$(CONFIG_MFD_T7L66XB) += t7l66xb.o
obj-$(CONFIG_MFD_TC6387XB) += tc6387xb.o
obj-$(CONFIG_MFD_TC6393XB) += tc6393xb.o
obj-$(CONFIG_MFD_T7L66XB) += t7l66xb.o tmio_core.o
obj-$(CONFIG_MFD_TC6387XB) += tc6387xb.o tmio_core.o
obj-$(CONFIG_MFD_TC6393XB) += tc6393xb.o tmio_core.o

obj-$(CONFIG_MFD_WM8400) += wm8400-core.o
wm831x-objs := wm831x-core.o wm831x-irq.o wm831x-otp.o
Expand Down
40 changes: 32 additions & 8 deletions drivers/mfd/asic3.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ struct asic3 {
u16 irq_bothedge[4];
struct gpio_chip gpio;
struct device *dev;
void __iomem *tmio_cnf;

struct asic3_clk clocks[ARRAY_SIZE(asic3_clk_init)];
};
Expand Down Expand Up @@ -685,8 +686,24 @@ static struct mfd_cell asic3_cell_ds1wm = {
.resources = ds1wm_resources,
};

static void asic3_mmc_pwr(struct platform_device *pdev, int state)
{
struct asic3 *asic = dev_get_drvdata(pdev->dev.parent);

tmio_core_mmc_pwr(asic->tmio_cnf, 1 - asic->bus_shift, state);
}

static void asic3_mmc_clk_div(struct platform_device *pdev, int state)
{
struct asic3 *asic = dev_get_drvdata(pdev->dev.parent);

tmio_core_mmc_clk_div(asic->tmio_cnf, 1 - asic->bus_shift, state);
}

static struct tmio_mmc_data asic3_mmc_data = {
.hclk = 24576000,
.hclk = 24576000,
.set_pwr = asic3_mmc_pwr,
.set_clk_div = asic3_mmc_clk_div,
};

static struct resource asic3_mmc_resources[] = {
Expand All @@ -695,11 +712,6 @@ static struct resource asic3_mmc_resources[] = {
.end = ASIC3_SD_CTRL_BASE + 0x3ff,
.flags = IORESOURCE_MEM,
},
{
.start = ASIC3_SD_CONFIG_BASE,
.end = ASIC3_SD_CONFIG_BASE + 0x1ff,
.flags = IORESOURCE_MEM,
},
{
.start = 0,
.end = 0,
Expand Down Expand Up @@ -743,6 +755,10 @@ static int asic3_mmc_enable(struct platform_device *pdev)
asic3_set_register(asic, ASIC3_OFFSET(SDHWCTRL, SDCONF),
ASIC3_SDHWCTRL_SDPWR, 1);

/* ASIC3_SD_CTRL_BASE assumes 32-bit addressing, TMIO is 16-bit */
tmio_core_mmc_enable(asic->tmio_cnf, 1 - asic->bus_shift,
ASIC3_SD_CTRL_BASE >> 1);

return 0;
}

Expand Down Expand Up @@ -797,10 +813,15 @@ static int __init asic3_mfd_probe(struct platform_device *pdev,
asic3_cell_ds1wm.data_size = sizeof(asic3_cell_ds1wm);

/* MMC */
asic->tmio_cnf = ioremap((ASIC3_SD_CONFIG_BASE >> asic->bus_shift) +
mem_sdio->start, 0x400 >> asic->bus_shift);
if (!asic->tmio_cnf) {
ret = -ENOMEM;
dev_dbg(asic->dev, "Couldn't ioremap SD_CONFIG\n");
goto out;
}
asic3_mmc_resources[0].start >>= asic->bus_shift;
asic3_mmc_resources[0].end >>= asic->bus_shift;
asic3_mmc_resources[1].start >>= asic->bus_shift;
asic3_mmc_resources[1].end >>= asic->bus_shift;

asic3_cell_mmc.platform_data = &asic3_cell_mmc;
asic3_cell_mmc.data_size = sizeof(asic3_cell_mmc);
Expand All @@ -820,7 +841,10 @@ static int __init asic3_mfd_probe(struct platform_device *pdev,

static void asic3_mfd_remove(struct platform_device *pdev)
{
struct asic3 *asic = platform_get_drvdata(pdev);

mfd_remove_devices(&pdev->dev);
iounmap(asic->tmio_cnf);
}

/* Core */
Expand Down
4 changes: 2 additions & 2 deletions drivers/mfd/mc13783-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@ static int mc13783_probe(struct spi_device *spi)
}
/* This should go away (END) */

mc13783_unlock(mc13783);

if (pdata->flags & MC13783_USE_ADC)
mc13783_add_subdevice(mc13783, "mc13783-adc");

Expand All @@ -641,8 +643,6 @@ static int mc13783_probe(struct spi_device *spi)
if (pdata->flags & MC13783_USE_TOUCHSCREEN)
mc13783_add_subdevice(mc13783, "mc13783-ts");

mc13783_unlock(mc13783);

return 0;
}

Expand Down
55 changes: 37 additions & 18 deletions drivers/mfd/t7l66xb.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ enum {
T7L66XB_CELL_MMC,
};

static const struct resource t7l66xb_mmc_resources[] = {
{
.start = 0x800,
.end = 0x9ff,
.flags = IORESOURCE_MEM,
},
{
.start = IRQ_T7L66XB_MMC,
.end = IRQ_T7L66XB_MMC,
.flags = IORESOURCE_IRQ,
},
};

#define SCR_REVID 0x08 /* b Revision ID */
#define SCR_IMR 0x42 /* b Interrupt Mask */
#define SCR_DEV_CTL 0xe0 /* b Device control */
Expand Down Expand Up @@ -83,6 +96,9 @@ static int t7l66xb_mmc_enable(struct platform_device *mmc)

spin_unlock_irqrestore(&t7l66xb->lock, flags);

tmio_core_mmc_enable(t7l66xb->scr + 0x200, 0,
t7l66xb_mmc_resources[0].start & 0xfffe);

return 0;
}

Expand All @@ -106,28 +122,28 @@ static int t7l66xb_mmc_disable(struct platform_device *mmc)
return 0;
}

static void t7l66xb_mmc_pwr(struct platform_device *mmc, int state)
{
struct platform_device *dev = to_platform_device(mmc->dev.parent);
struct t7l66xb *t7l66xb = platform_get_drvdata(dev);

tmio_core_mmc_pwr(t7l66xb->scr + 0x200, 0, state);
}

static void t7l66xb_mmc_clk_div(struct platform_device *mmc, int state)
{
struct platform_device *dev = to_platform_device(mmc->dev.parent);
struct t7l66xb *t7l66xb = platform_get_drvdata(dev);

tmio_core_mmc_clk_div(t7l66xb->scr + 0x200, 0, state);
}

/*--------------------------------------------------------------------------*/

static struct tmio_mmc_data t7166xb_mmc_data = {
.hclk = 24000000,
};

static const struct resource t7l66xb_mmc_resources[] = {
{
.start = 0x800,
.end = 0x9ff,
.flags = IORESOURCE_MEM,
},
{
.start = 0x200,
.end = 0x2ff,
.flags = IORESOURCE_MEM,
},
{
.start = IRQ_T7L66XB_MMC,
.end = IRQ_T7L66XB_MMC,
.flags = IORESOURCE_IRQ,
},
.set_pwr = t7l66xb_mmc_pwr,
.set_clk_div = t7l66xb_mmc_clk_div,
};

static const struct resource t7l66xb_nand_resources[] = {
Expand Down Expand Up @@ -282,6 +298,9 @@ static int t7l66xb_resume(struct platform_device *dev)
if (pdata && pdata->resume)
pdata->resume(dev);

tmio_core_mmc_enable(t7l66xb->scr + 0x200, 0,
t7l66xb_mmc_resources[0].start & 0xfffe);

return 0;
}
#else
Expand Down
Loading

0 comments on commit fe64454

Please sign in to comment.