Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 339527
b: refs/heads/master
c: 07c9249
h: refs/heads/master
i:
  339525: b7fac0d
  339523: bb94343
  339519: 63dcdaf
v: v3
  • Loading branch information
Linus Walleij authored and Russell King committed Oct 18, 2012
1 parent 98278d4 commit 1784547
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 63 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4b85da08c4d19f5de48d904d4f879dcfa04ec14c
refs/heads/master: 07c9249f1fa90cc8189bed44c0bcece664596a72
18 changes: 6 additions & 12 deletions trunk/arch/arm/common/vic.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static void __init vic_register(void __iomem *base, unsigned int irq,
v->resume_sources = resume_sources;
v->irq = irq;
vic_id++;
v->domain = irq_domain_add_legacy(node, fls(valid_sources), irq, 0,
v->domain = irq_domain_add_simple(node, fls(valid_sources), irq,
&vic_irqdomain_ops, v);
}

Expand Down Expand Up @@ -350,7 +350,7 @@ static void __init vic_init_st(void __iomem *base, unsigned int irq_start,
vic_register(base, irq_start, vic_sources, 0, node);
}

void __init __vic_init(void __iomem *base, unsigned int irq_start,
void __init __vic_init(void __iomem *base, int irq_start,
u32 vic_sources, u32 resume_sources,
struct device_node *node)
{
Expand Down Expand Up @@ -416,18 +416,12 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent)
if (WARN_ON(!regs))
return -EIO;

irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id());
if (WARN_ON(irq_base < 0))
goto out_unmap;

__vic_init(regs, irq_base, ~0, ~0, node);
/*
* Passing -1 as first IRQ makes the simple domain allocate descriptors
*/
__vic_init(regs, -1, ~0, ~0, node);

return 0;

out_unmap:
iounmap(regs);

return -EIO;
}
#endif /* CONFIG OF */

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/include/asm/hardware/vic.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
struct device_node;
struct pt_regs;

void __vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources,
void __vic_init(void __iomem *base, int irq_start, u32 vic_sources,
u32 resume_sources, struct device_node *node);
void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, u32 resume_sources);
int vic_of_init(struct device_node *node, struct device_node *parent);
Expand Down
66 changes: 21 additions & 45 deletions trunk/drivers/mmc/host/mmci.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <linux/amba/mmci.h>
#include <linux/pm_runtime.h>
#include <linux/types.h>
#include <linux/pinctrl/consumer.h>

#include <asm/div64.h>
#include <asm/io.h>
Expand Down Expand Up @@ -655,31 +654,9 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)

/* The ST Micro variants has a special bit to enable SDIO */
if (variant->sdio && host->mmc->card)
if (mmc_card_sdio(host->mmc->card)) {
/*
* The ST Micro variants has a special bit
* to enable SDIO.
*/
u32 clk;

if (mmc_card_sdio(host->mmc->card))
datactrl |= MCI_ST_DPSM_SDIOEN;

/*
* The ST Micro variant for SDIO small write transfers
* needs to have clock H/W flow control disabled,
* otherwise the transfer will not start. The threshold
* depends on the rate of MCLK.
*/
if (data->flags & MMC_DATA_WRITE &&
(host->size < 8 ||
(host->size <= 8 && host->mclk > 50000000)))
clk = host->clk_reg & ~variant->clkreg_enable;
else
clk = host->clk_reg | variant->clkreg_enable;

mmci_write_clkreg(host, clk);
}

/*
* Attempt to use DMA operation mode, if this
* should fail, fall back to PIO mode
Expand Down Expand Up @@ -863,14 +840,14 @@ static int mmci_pio_read(struct mmci_host *host, char *buffer, unsigned int rema
if (unlikely(count & 0x3)) {
if (count < 4) {
unsigned char buf[4];
ioread32_rep(base + MMCIFIFO, buf, 1);
readsl(base + MMCIFIFO, buf, 1);
memcpy(ptr, buf, count);
} else {
ioread32_rep(base + MMCIFIFO, ptr, count >> 2);
readsl(base + MMCIFIFO, ptr, count >> 2);
count &= ~0x3;
}
} else {
ioread32_rep(base + MMCIFIFO, ptr, count >> 2);
readsl(base + MMCIFIFO, ptr, count >> 2);
}

ptr += count;
Expand Down Expand Up @@ -899,6 +876,22 @@ static int mmci_pio_write(struct mmci_host *host, char *buffer, unsigned int rem
variant->fifosize : variant->fifohalfsize;
count = min(remain, maxcnt);

/*
* The ST Micro variant for SDIO transfer sizes
* less then 8 bytes should have clock H/W flow
* control disabled.
*/
if (variant->sdio &&
mmc_card_sdio(host->mmc->card)) {
u32 clk;
if (count < 8)
clk = host->clk_reg & ~variant->clkreg_enable;
else
clk = host->clk_reg | variant->clkreg_enable;

mmci_write_clkreg(host, clk);
}

/*
* SDIO especially may want to send something that is
* not divisible by 4 (as opposed to card sectors
Expand All @@ -907,7 +900,7 @@ static int mmci_pio_write(struct mmci_host *host, char *buffer, unsigned int rem
* byte become a 32bit write, 7 bytes will be two
* 32bit writes etc.
*/
iowrite32_rep(base + MMCIFIFO, ptr, (count + 3) >> 2);
writesl(base + MMCIFIFO, ptr, (count + 3) >> 2);

ptr += count;
remain -= count;
Expand Down Expand Up @@ -1367,23 +1360,6 @@ static int __devinit mmci_probe(struct amba_device *dev,
mmc->f_max = min(host->mclk, fmax);
dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max);

host->pinctrl = devm_pinctrl_get(&dev->dev);
if (IS_ERR(host->pinctrl)) {
ret = PTR_ERR(host->pinctrl);
goto clk_disable;
}

host->pins_default = pinctrl_lookup_state(host->pinctrl,
PINCTRL_STATE_DEFAULT);

/* enable pins to be muxed in and configured */
if (!IS_ERR(host->pins_default)) {
ret = pinctrl_select_state(host->pinctrl, host->pins_default);
if (ret)
dev_warn(&dev->dev, "could not set default pins\n");
} else
dev_warn(&dev->dev, "could not get default pinstate\n");

#ifdef CONFIG_REGULATOR
/* If we're using the regulator framework, try to fetch a regulator */
host->vcc = regulator_get(&dev->dev, "vmmc");
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/mmc/host/mmci.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,6 @@ struct mmci_host {
unsigned int size;
struct regulator *vcc;

/* pinctrl handles */
struct pinctrl *pinctrl;
struct pinctrl_state *pins_default;

#ifdef CONFIG_DMA_ENGINE
/* DMA stuff */
struct dma_chan *dma_current;
Expand Down

0 comments on commit 1784547

Please sign in to comment.