* [PATCH 0/1] MMC DDR support
@ 2010-10-11 9:43 Adrian Hunter
2010-10-11 9:43 ` [PATCH 1/1] mmc: refine " Adrian Hunter
0 siblings, 1 reply; 3+ messages in thread
From: Adrian Hunter @ 2010-10-11 9:43 UTC (permalink / raw)
To: Chris Ball; +Cc: linux-mmc Mailing List, Adrian Hunter
Hi
Here is a tweak to MMC DDR support. It applies to the mmc-next
branch of Chris Ball's mmc tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git
Adrian Hunter (1):
mmc: refine DDR support
drivers/mmc/core/core.c | 7 ++++---
drivers/mmc/core/core.h | 3 ++-
drivers/mmc/core/mmc.c | 6 +++---
include/linux/mmc/host.h | 3 ++-
4 files changed, 11 insertions(+), 8 deletions(-)
Regards
Adrian
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH 1/1] mmc: refine DDR support 2010-10-11 9:43 [PATCH 0/1] MMC DDR support Adrian Hunter @ 2010-10-11 9:43 ` Adrian Hunter 2010-10-14 2:03 ` Chris Ball 0 siblings, 1 reply; 3+ messages in thread From: Adrian Hunter @ 2010-10-11 9:43 UTC (permalink / raw) To: Chris Ball; +Cc: linux-mmc Mailing List, Adrian Hunter >From f92528a3ebbff6e3f73fc2cb0d197ece9180324e Mon Sep 17 00:00:00 2001 From: Adrian Hunter <adrian.hunter@nokia.com> Date: Mon, 11 Oct 2010 12:30:25 +0300 Subject: [PATCH] mmc: refine DDR support One flaw with DDR support is that MMC core does not inform the driver which DDR mode it has selected. This patch expands the ios->ddr flag to do that. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> --- drivers/mmc/core/core.c | 7 ++++--- drivers/mmc/core/core.h | 3 ++- drivers/mmc/core/mmc.c | 6 +++--- include/linux/mmc/host.h | 3 ++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index c94565d..ce5f4a5 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -653,10 +653,11 @@ void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode) /* * Change data bus width and DDR mode of a host. */ -void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, int ddr) +void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, + unsigned int ddr) { host->ios.bus_width = width; - host->ios.ddr = ddr ? MMC_DDR_MODE : MMC_SDR_MODE; + host->ios.ddr = ddr; mmc_set_ios(host); } @@ -665,7 +666,7 @@ void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, int ddr) */ void mmc_set_bus_width(struct mmc_host *host, unsigned int width) { - mmc_set_bus_width_ddr(host, width, 0); + mmc_set_bus_width_ddr(host, width, MMC_SDR_MODE); } /** diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h index 90e0ac7..77240cd 100644 --- a/drivers/mmc/core/core.h +++ b/drivers/mmc/core/core.h @@ -35,7 +35,8 @@ void mmc_set_chip_select(struct mmc_host *host, int mode); void mmc_set_clock(struct mmc_host *host, unsigned int hz); void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode); void mmc_set_bus_width(struct mmc_host *host, unsigned int width); -void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, int ddr); +void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, + unsigned int ddr); u32 mmc_select_voltage(struct mmc_host *host, u32 ocr); void mmc_set_timing(struct mmc_host *host, unsigned int timing); diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 31a8bbe..995261f 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -375,7 +375,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, struct mmc_card *oldcard) { struct mmc_card *card; - int err, ddr = 0; + int err, ddr = MMC_SDR_MODE; u32 cid[4]; unsigned int max_dtr; @@ -523,10 +523,10 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, if (mmc_card_highspeed(card)) { if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_8V) && (host->caps & (MMC_CAP_1_8V_DDR))) - ddr = 1; + ddr = MMC_1_8V_DDR_MODE; else if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_2V) && (host->caps & (MMC_CAP_1_2V_DDR))) - ddr = 1; + ddr = MMC_1_2V_DDR_MODE; } /* diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index c3ffad8..6d87f68 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -54,7 +54,8 @@ struct mmc_ios { unsigned char ddr; /* dual data rate used */ #define MMC_SDR_MODE 0 -#define MMC_DDR_MODE 1 +#define MMC_1_2V_DDR_MODE 1 +#define MMC_1_8V_DDR_MODE 2 }; struct mmc_host_ops { -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] mmc: refine DDR support 2010-10-11 9:43 ` [PATCH 1/1] mmc: refine " Adrian Hunter @ 2010-10-14 2:03 ` Chris Ball 0 siblings, 0 replies; 3+ messages in thread From: Chris Ball @ 2010-10-14 2:03 UTC (permalink / raw) To: Adrian Hunter; +Cc: linux-mmc Mailing List Hi Adrian, On Mon, Oct 11, 2010 at 12:43:50PM +0300, Adrian Hunter wrote: > >From f92528a3ebbff6e3f73fc2cb0d197ece9180324e Mon Sep 17 00:00:00 2001 > From: Adrian Hunter <adrian.hunter@nokia.com> > Date: Mon, 11 Oct 2010 12:30:25 +0300 > Subject: [PATCH] mmc: refine DDR support > > One flaw with DDR support is that MMC core does > not inform the driver which DDR mode it has > selected. This patch expands the ios->ddr flag > to do that. > > Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> > --- > drivers/mmc/core/core.c | 7 ++++--- > drivers/mmc/core/core.h | 3 ++- > drivers/mmc/core/mmc.c | 6 +++--- > include/linux/mmc/host.h | 3 ++- > 4 files changed, 11 insertions(+), 8 deletions(-) > > diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c > index c94565d..ce5f4a5 100644 > --- a/drivers/mmc/core/core.c > +++ b/drivers/mmc/core/core.c > @@ -653,10 +653,11 @@ void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode) > /* > * Change data bus width and DDR mode of a host. > */ > -void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, int ddr) > +void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, > + unsigned int ddr) > { > host->ios.bus_width = width; > - host->ios.ddr = ddr ? MMC_DDR_MODE : MMC_SDR_MODE; > + host->ios.ddr = ddr; > mmc_set_ios(host); > } > > @@ -665,7 +666,7 @@ void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, int ddr) > */ > void mmc_set_bus_width(struct mmc_host *host, unsigned int width) > { > - mmc_set_bus_width_ddr(host, width, 0); > + mmc_set_bus_width_ddr(host, width, MMC_SDR_MODE); > } > > /** > diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h > index 90e0ac7..77240cd 100644 > --- a/drivers/mmc/core/core.h > +++ b/drivers/mmc/core/core.h > @@ -35,7 +35,8 @@ void mmc_set_chip_select(struct mmc_host *host, int mode); > void mmc_set_clock(struct mmc_host *host, unsigned int hz); > void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode); > void mmc_set_bus_width(struct mmc_host *host, unsigned int width); > -void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, int ddr); > +void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, > + unsigned int ddr); > u32 mmc_select_voltage(struct mmc_host *host, u32 ocr); > void mmc_set_timing(struct mmc_host *host, unsigned int timing); > > diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c > index 31a8bbe..995261f 100644 > --- a/drivers/mmc/core/mmc.c > +++ b/drivers/mmc/core/mmc.c > @@ -375,7 +375,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, > struct mmc_card *oldcard) > { > struct mmc_card *card; > - int err, ddr = 0; > + int err, ddr = MMC_SDR_MODE; > u32 cid[4]; > unsigned int max_dtr; > > @@ -523,10 +523,10 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, > if (mmc_card_highspeed(card)) { > if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_8V) > && (host->caps & (MMC_CAP_1_8V_DDR))) > - ddr = 1; > + ddr = MMC_1_8V_DDR_MODE; > else if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_2V) > && (host->caps & (MMC_CAP_1_2V_DDR))) > - ddr = 1; > + ddr = MMC_1_2V_DDR_MODE; > } > > /* > diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h > index c3ffad8..6d87f68 100644 > --- a/include/linux/mmc/host.h > +++ b/include/linux/mmc/host.h > @@ -54,7 +54,8 @@ struct mmc_ios { > unsigned char ddr; /* dual data rate used */ > > #define MMC_SDR_MODE 0 > -#define MMC_DDR_MODE 1 > +#define MMC_1_2V_DDR_MODE 1 > +#define MMC_1_8V_DDR_MODE 2 > }; > > struct mmc_host_ops { > -- Thanks, applied to mmc-next. -- Chris Ball <cjb@laptop.org> <http://printf.net/> One Laptop Per Child ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-14 2:03 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-10-11 9:43 [PATCH 0/1] MMC DDR support Adrian Hunter 2010-10-11 9:43 ` [PATCH 1/1] mmc: refine " Adrian Hunter 2010-10-14 2:03 ` Chris Ball
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.