27.11.2012 Views

[PATCH 1/2] davinci: MMC: Add a function to control reset ... - Linux

[PATCH 1/2] davinci: MMC: Add a function to control reset ... - Linux

[PATCH 1/2] davinci: MMC: Add a function to control reset ... - Linux

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

[<strong>PATCH</strong> 1/2] <strong>davinci</strong>: <strong>MMC</strong>: <strong>Add</strong> a <strong>function</strong> <strong>to</strong> <strong>control</strong> <strong>reset</strong> state of the <strong>control</strong>ler<br />

[<strong>PATCH</strong> 1/2] <strong>davinci</strong>: <strong>MMC</strong>: <strong>Add</strong> a <strong>function</strong> <strong>to</strong><br />

<strong>control</strong> <strong>reset</strong> state of the <strong>control</strong>ler<br />

Source: http://linux.derkeiler.com/Mailing−Lists/Kernel/2010−03/msg06886.html<br />

• From: Kevin Hilman <br />

• Date: Tue, 16 Mar 2010 13:30:24 −0700<br />

From: Chaithrika U S <br />

<strong>Add</strong> a helper <strong>function</strong> which will aid in changing the <strong>reset</strong><br />

status of the <strong>control</strong>ler.<br />

Signed−off−by: Chaithrika U S <br />

Acked−by: Kevin Hilman <br />

−−−<br />

I thought this series had made it in<strong>to</strong> −mm for 2.6.34, but I guess not.<br />

Here it is again for 2.6.35.<br />

drivers/mmc/host/<strong>davinci</strong>_mmc.c | 37 ++++++++++++++++−−−−−−−−−−−−−−−−−−−−−<br />

1 files changed, 16 insertions(+), 21 deletions(−)<br />

diff −−git a/drivers/mmc/host/<strong>davinci</strong>_mmc.c b/drivers/mmc/host/<strong>davinci</strong>_mmc.c<br />

index 547d29c..56afe0a 100644<br />

−−− a/drivers/mmc/host/<strong>davinci</strong>_mmc.c<br />

+++ b/drivers/mmc/host/<strong>davinci</strong>_mmc.c<br />

@@ −909,19 +909,26 @@ static void mmc_<strong>davinci</strong>_cmd_done(struct mmc_<strong>davinci</strong>_host *host,<br />

}<br />

}<br />

−static void<br />

−<strong>davinci</strong>_abort_data(struct mmc_<strong>davinci</strong>_host *host, struct mmc_data *data)<br />

+static inline void mmc_<strong>davinci</strong>_<strong>reset</strong>_ctrl(struct mmc_<strong>davinci</strong>_host *host,<br />

+ int val)<br />

{<br />

u32 temp;<br />

− /* <strong>reset</strong> command and data state machines */<br />

temp = readl(host−>base + DAVINCI_<strong>MMC</strong>CTL);<br />

− writel(temp | <strong>MMC</strong>CTL_CMDRST | <strong>MMC</strong>CTL_DATRST,<br />

− host−>base + DAVINCI_<strong>MMC</strong>CTL);<br />

+ if (val) /* <strong>reset</strong> */<br />

+ temp |= <strong>MMC</strong>CTL_CMDRST | <strong>MMC</strong>CTL_DATRST;<br />

+ else /* enable */<br />

+ temp &= ~(<strong>MMC</strong>CTL_CMDRST | <strong>MMC</strong>CTL_DATRST);<br />

[<strong>PATCH</strong> 1/2] <strong>davinci</strong>: <strong>MMC</strong>: <strong>Add</strong> a <strong>function</strong> <strong>to</strong> <strong>control</strong> <strong>reset</strong> state of the <strong>control</strong>ler 1


[<strong>PATCH</strong> 1/2] <strong>davinci</strong>: <strong>MMC</strong>: <strong>Add</strong> a <strong>function</strong> <strong>to</strong> <strong>control</strong> <strong>reset</strong> state of the <strong>control</strong>ler<br />

− temp &= ~(<strong>MMC</strong>CTL_CMDRST | <strong>MMC</strong>CTL_DATRST);<br />

− udelay(10);<br />

writel(temp, host−>base + DAVINCI_<strong>MMC</strong>CTL);<br />

+ udelay(10);<br />

+}<br />

+<br />

+static void<br />

+<strong>davinci</strong>_abort_data(struct mmc_<strong>davinci</strong>_host *host, struct mmc_data *data)<br />

+{<br />

+ mmc_<strong>davinci</strong>_<strong>reset</strong>_ctrl(host, 1);<br />

+ mmc_<strong>davinci</strong>_<strong>reset</strong>_ctrl(host, 0);<br />

}<br />

static irqreturn_t mmc_<strong>davinci</strong>_irq(int irq, void *dev_id)<br />

@@ −1125,15 +1132,8 @@ static inline void mmc_<strong>davinci</strong>_cpufreq_deregister(struct mmc_<strong>davinci</strong>_host<br />

*host)<br />

#endif<br />

static void __init init_mmcsd_host(struct mmc_<strong>davinci</strong>_host *host)<br />

{<br />

− /* DAT line portion is diabled and in <strong>reset</strong> state */<br />

− writel(readl(host−>base + DAVINCI_<strong>MMC</strong>CTL) | <strong>MMC</strong>CTL_DATRST,<br />

− host−>base + DAVINCI_<strong>MMC</strong>CTL);<br />

−<br />

− /* CMD line portion is diabled and in <strong>reset</strong> state */<br />

− writel(readl(host−>base + DAVINCI_<strong>MMC</strong>CTL) | <strong>MMC</strong>CTL_CMDRST,<br />

− host−>base + DAVINCI_<strong>MMC</strong>CTL);<br />

− udelay(10);<br />

+ mmc_<strong>davinci</strong>_<strong>reset</strong>_ctrl(host, 1);<br />

writel(0, host−>base + DAVINCI_<strong>MMC</strong>CLK);<br />

writel(<strong>MMC</strong>CLK_CLKEN, host−>base + DAVINCI_<strong>MMC</strong>CLK);<br />

@@ −1141,12 +1141,7 @@ static void __init init_mmcsd_host(struct mmc_<strong>davinci</strong>_host *host)<br />

writel(0x1FFF, host−>base + DAVINCI_<strong>MMC</strong>TOR);<br />

writel(0xFFFF, host−>base + DAVINCI_<strong>MMC</strong>TOD);<br />

− writel(readl(host−>base + DAVINCI_<strong>MMC</strong>CTL) & ~<strong>MMC</strong>CTL_DATRST,<br />

− host−>base + DAVINCI_<strong>MMC</strong>CTL);<br />

− writel(readl(host−>base + DAVINCI_<strong>MMC</strong>CTL) & ~<strong>MMC</strong>CTL_CMDRST,<br />

− host−>base + DAVINCI_<strong>MMC</strong>CTL);<br />

−<br />

− udelay(10);<br />

+ mmc_<strong>davinci</strong>_<strong>reset</strong>_ctrl(host, 0);<br />

}<br />

static int __init <strong>davinci</strong>_mmcsd_probe(struct platform_device *pdev)<br />

−−<br />

1.7.0.2<br />

−−<br />

To unsubscribe from this list: send the line "unsubscribe linux−kernel" in<br />

[<strong>PATCH</strong> 1/2] <strong>davinci</strong>: <strong>MMC</strong>: <strong>Add</strong> a <strong>function</strong> <strong>to</strong> <strong>control</strong> <strong>reset</strong> state of the <strong>control</strong>ler 2


[<strong>PATCH</strong> 1/2] <strong>davinci</strong>: <strong>MMC</strong>: <strong>Add</strong> a <strong>function</strong> <strong>to</strong> <strong>control</strong> <strong>reset</strong> state of the <strong>control</strong>ler<br />

the body of a message <strong>to</strong> majordomo@xxxxxxxxxxxxxxx<br />

More majordomo info at http://vger.kernel.org/majordomo−info.html<br />

Please read the FAQ at http://www.tux.org/lkml/<br />

[<strong>PATCH</strong> 1/2] <strong>davinci</strong>: <strong>MMC</strong>: <strong>Add</strong> a <strong>function</strong> <strong>to</strong> <strong>control</strong> <strong>reset</strong> state of the <strong>control</strong>ler 3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!