* [PATCH 1/5] sdhci-s3c: depend on plat-samsung
2010-06-09 9:39 [PATCH] SDHCI-S3C fixes and enhancements (driver specific code) Marek Szyprowski
@ 2010-06-09 9:39 ` Marek Szyprowski
2010-06-11 0:29 ` Kukjin Kim
2010-06-09 9:39 ` [PATCH 2/5] sdhci-s3c: add missing remove function Marek Szyprowski
` (3 subsequent siblings)
4 siblings, 1 reply; 15+ messages in thread
From: Marek Szyprowski @ 2010-06-09 9:39 UTC (permalink / raw)
To: linux-arm-kernel
Most Samsung SoC have support for SDHCI block, so make the driver
dependent on the Samsung platform instead on listing all SoCs in the
Kconfig (and updating it again when support for the new SoC variant is
added).
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/mmc/host/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index e171e77..acf5bf6 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -123,7 +123,7 @@ config MMC_SDHCI_PLTFM
config MMC_SDHCI_S3C
tristate "SDHCI support on Samsung S3C SoC"
- depends on MMC_SDHCI && (PLAT_S3C24XX || PLAT_S3C64XX)
+ depends on MMC_SDHCI && PLAT_SAMSUNG
help
This selects the Secure Digital Host Controller Interface (SDHCI)
often referrered to as the HSMMC block in some of the Samsung S3C
--
1.7.1.240.g225c
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH 1/5] sdhci-s3c: depend on plat-samsung
2010-06-09 9:39 ` [PATCH 1/5] sdhci-s3c: depend on plat-samsung Marek Szyprowski
@ 2010-06-11 0:29 ` Kukjin Kim
2010-06-11 5:24 ` Ben Dooks
0 siblings, 1 reply; 15+ messages in thread
From: Kukjin Kim @ 2010-06-11 0:29 UTC (permalink / raw)
To: linux-arm-kernel
Marek Szyprowski wrote:
>
> Most Samsung SoC have support for SDHCI block, so make the driver
> dependent on the Samsung platform instead on listing all SoCs in the
> Kconfig (and updating it again when support for the new SoC variant is
> added).
>
Hi, Marek
Kyungmin Park already submitted same patch.
And Andrew Morton added to the -mm tree.
http://www.spinics.net/lists/mm-commits/msg79159.html
But, I think your comment is better...
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> drivers/mmc/host/Kconfig | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
> index e171e77..acf5bf6 100644
> --- a/drivers/mmc/host/Kconfig
> +++ b/drivers/mmc/host/Kconfig
> @@ -123,7 +123,7 @@ config MMC_SDHCI_PLTFM
>
> config MMC_SDHCI_S3C
> tristate "SDHCI support on Samsung S3C SoC"
> - depends on MMC_SDHCI && (PLAT_S3C24XX || PLAT_S3C64XX)
> + depends on MMC_SDHCI && PLAT_SAMSUNG
> help
> This selects the Secure Digital Host Controller Interface (SDHCI)
> often referrered to as the HSMMC block in some of the Samsung S3C
> --
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/5] sdhci-s3c: depend on plat-samsung
2010-06-11 0:29 ` Kukjin Kim
@ 2010-06-11 5:24 ` Ben Dooks
2010-06-11 5:42 ` Kyungmin Park
2010-06-11 10:30 ` Mark Brown
0 siblings, 2 replies; 15+ messages in thread
From: Ben Dooks @ 2010-06-11 5:24 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jun 11, 2010 at 09:29:38AM +0900, Kukjin Kim wrote:
> Marek Szyprowski wrote:
> >
> > Most Samsung SoC have support for SDHCI block, so make the driver
> > dependent on the Samsung platform instead on listing all SoCs in the
> > Kconfig (and updating it again when support for the new SoC variant is
> > added).
> >
> Hi, Marek
>
> Kyungmin Park already submitted same patch.
Hmm, Mr Park and Co really need to learn how to handle the treatment of
patches. I'm really disapointed that these patches get submitted without
the proper authour accreditation. If this isn't sorted out then I for
one will start thinking about giving this stuff an automatic reject.
Please ensure that the original authour of a patch is accredited for
the work, and the right sign-off and any other ack data is kept with
the patch. There's documentation about most of this in the kernel
already at Documentation/SubmittingPatches.
> And Andrew Morton added to the -mm tree.
> http://www.spinics.net/lists/mm-commits/msg79159.html
>
> But, I think your comment is better...
>
> > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > ---
> > drivers/mmc/host/Kconfig | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
> > index e171e77..acf5bf6 100644
> > --- a/drivers/mmc/host/Kconfig
> > +++ b/drivers/mmc/host/Kconfig
> > @@ -123,7 +123,7 @@ config MMC_SDHCI_PLTFM
> >
> > config MMC_SDHCI_S3C
> > tristate "SDHCI support on Samsung S3C SoC"
> > - depends on MMC_SDHCI && (PLAT_S3C24XX || PLAT_S3C64XX)
> > + depends on MMC_SDHCI && PLAT_SAMSUNG
> > help
> > This selects the Secure Digital Host Controller Interface (SDHCI)
> > often referrered to as the HSMMC block in some of the Samsung S3C
> > --
>
>
> Thanks.
>
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/5] sdhci-s3c: depend on plat-samsung
2010-06-11 5:24 ` Ben Dooks
@ 2010-06-11 5:42 ` Kyungmin Park
2010-06-11 10:30 ` Mark Brown
1 sibling, 0 replies; 15+ messages in thread
From: Kyungmin Park @ 2010-06-11 5:42 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jun 11, 2010 at 2:24 PM, Ben Dooks <ben-linux@fluff.org> wrote:
> On Fri, Jun 11, 2010 at 09:29:38AM +0900, Kukjin Kim wrote:
>> Marek Szyprowski wrote:
>> >
>> > Most Samsung SoC have support for SDHCI block, so make the driver
>> > dependent on the Samsung platform instead on listing all SoCs in the
>> > Kconfig (and updating it again when support for the new SoC variant is
>> > added).
>> >
>> Hi, Marek
>>
>> Kyungmin Park already submitted same patch.
>
> Hmm, Mr Park and Co really need to learn how to handle the treatment of
> patches. I'm really disapointed that these patches get submitted without
> the proper authour accreditation. If this isn't sorted out then I for
> one will start thinking about giving this stuff an automatic reject.
It's just Marek missed the previous my patch, and I reply there's
duplicated patch already.
Thank you,
Kyungmin Park
>
> Please ensure that the original authour of a patch is accredited for
> the work, and the right sign-off and any other ack data is kept with
> the patch. There's documentation about most of this in the kernel
> already at Documentation/SubmittingPatches.
>
>> And Andrew Morton added to the -mm tree.
>> http://www.spinics.net/lists/mm-commits/msg79159.html
>>
>> But, I think your comment is better...
>>
>> > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> > ---
>> > ?drivers/mmc/host/Kconfig | ? ?2 +-
>> > ?1 files changed, 1 insertions(+), 1 deletions(-)
>> >
>> > diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
>> > index e171e77..acf5bf6 100644
>> > --- a/drivers/mmc/host/Kconfig
>> > +++ b/drivers/mmc/host/Kconfig
>> > @@ -123,7 +123,7 @@ config MMC_SDHCI_PLTFM
>> >
>> > ?config MMC_SDHCI_S3C
>> > ? ? tristate "SDHCI support on Samsung S3C SoC"
>> > - ? depends on MMC_SDHCI && (PLAT_S3C24XX || PLAT_S3C64XX)
>> > + ? depends on MMC_SDHCI && PLAT_SAMSUNG
>> > ? ? help
>> > ? ? ? This selects the Secure Digital Host Controller Interface (SDHCI)
>> > ? ? ? often referrered to as the HSMMC block in some of the Samsung S3C
>> > --
>>
>>
>> Thanks.
>>
>> Best regards,
>> Kgene.
>> --
>> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
>> SW Solution Development Team, Samsung Electronics Co., Ltd.
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
> --
> --
> Ben
>
> Q: ? ? ?What's a light-year?
> A: ? ? ?One-third less calories than a regular year.
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/5] sdhci-s3c: depend on plat-samsung
2010-06-11 5:24 ` Ben Dooks
2010-06-11 5:42 ` Kyungmin Park
@ 2010-06-11 10:30 ` Mark Brown
1 sibling, 0 replies; 15+ messages in thread
From: Mark Brown @ 2010-06-11 10:30 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jun 11, 2010 at 06:24:07AM +0100, Ben Dooks wrote:
> Hmm, Mr Park and Co really need to learn how to handle the treatment of
> patches. I'm really disapointed that these patches get submitted without
> the proper authour accreditation. If this isn't sorted out then I for
> one will start thinking about giving this stuff an automatic reject.
For this specific patch it looks more like the patch was sufficiently
straightforward that two different people ended up coming up with
identical implementations rather than anything else?
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 2/5] sdhci-s3c: add missing remove function
2010-06-09 9:39 [PATCH] SDHCI-S3C fixes and enhancements (driver specific code) Marek Szyprowski
2010-06-09 9:39 ` [PATCH 1/5] sdhci-s3c: depend on plat-samsung Marek Szyprowski
@ 2010-06-09 9:39 ` Marek Szyprowski
2010-06-09 9:39 ` [PATCH 3/5] sdhci-s3c: increase the timeout value Marek Szyprowski
` (2 subsequent siblings)
4 siblings, 0 replies; 15+ messages in thread
From: Marek Szyprowski @ 2010-06-09 9:39 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/mmc/host/sdhci-s3c.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index af21792..ad30f07 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -365,6 +365,26 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
{
+ struct sdhci_host *host = platform_get_drvdata(pdev);
+ struct sdhci_s3c *sc = sdhci_priv(host);
+ int ptr;
+
+ sdhci_remove_host(host, 1);
+
+ for (ptr = 0; ptr < 3; ptr++) {
+ clk_disable(sc->clk_bus[ptr]);
+ clk_put(sc->clk_bus[ptr]);
+ }
+ clk_disable(sc->clk_io);
+ clk_put(sc->clk_io);
+
+ iounmap(host->ioaddr);
+ release_resource(sc->ioarea);
+ kfree(sc->ioarea);
+
+ sdhci_free_host(host);
+ platform_set_drvdata(pdev, NULL);
+
return 0;
}
--
1.7.1.240.g225c
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH 3/5] sdhci-s3c: increase the timeout value
2010-06-09 9:39 [PATCH] SDHCI-S3C fixes and enhancements (driver specific code) Marek Szyprowski
2010-06-09 9:39 ` [PATCH 1/5] sdhci-s3c: depend on plat-samsung Marek Szyprowski
2010-06-09 9:39 ` [PATCH 2/5] sdhci-s3c: add missing remove function Marek Szyprowski
@ 2010-06-09 9:39 ` Marek Szyprowski
2010-06-10 10:46 ` Kukjin Kim
2010-08-27 19:53 ` Chris Ball
2010-06-09 9:39 ` [PATCH 4/5] sdhci-s3c: add support for the non standard minimal clock value Marek Szyprowski
2010-06-09 9:39 ` [PATCH 5/5] sdhci-s3c: add support for new card detection methods Marek Szyprowski
4 siblings, 2 replies; 15+ messages in thread
From: Marek Szyprowski @ 2010-06-09 9:39 UTC (permalink / raw)
To: linux-arm-kernel
This patch increases the timeout value on sdhci-s3c controller by using
SDHCI_QUIRK_BROKEN_TIMEOUT_VAL quirk. Without it most transfers from
external mmc cards fails on Samsung s5pv210 SoCs based systems. Tested
on Samsung Aquila board.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/mmc/host/sdhci-s3c.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index ad30f07..2b6cb44 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -331,6 +331,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
* transfers, not sure if this is a problem with this specific
* SDHCI block, or a missing configuration that needs to be set. */
host->quirks |= SDHCI_QUIRK_NO_BUSY_IRQ;
+ host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
host->quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR |
SDHCI_QUIRK_32BIT_DMA_SIZE);
--
1.7.1.240.g225c
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 3/5] sdhci-s3c: increase the timeout value
2010-06-09 9:39 ` [PATCH 3/5] sdhci-s3c: increase the timeout value Marek Szyprowski
@ 2010-06-10 10:46 ` Kukjin Kim
2010-08-27 19:53 ` Chris Ball
1 sibling, 0 replies; 15+ messages in thread
From: Kukjin Kim @ 2010-06-10 10:46 UTC (permalink / raw)
To: linux-arm-kernel
Marek Szyprowski wrote:
>
> This patch increases the timeout value on sdhci-s3c controller by using
> SDHCI_QUIRK_BROKEN_TIMEOUT_VAL quirk. Without it most transfers from
> external mmc cards fails on Samsung s5pv210 SoCs based systems. Tested
> on Samsung Aquila board.
>
Hi,
Seems to use max timeout value, 0xE.
However, should be use SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK.
Because basically, Samsung MMC used sdclock as timeout clock.
Please refer to below URL:
http://article.gmane.org/gmane.linux.kernel.mmc/304
And new patch with SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK will be submitted.
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> drivers/mmc/host/sdhci-s3c.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index ad30f07..2b6cb44 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -331,6 +331,7 @@ static int __devinit sdhci_s3c_probe(struct
platform_device
> *pdev)
> * transfers, not sure if this is a problem with this specific
> * SDHCI block, or a missing configuration that needs to be set. */
> host->quirks |= SDHCI_QUIRK_NO_BUSY_IRQ;
> + host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
>
> host->quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR |
> SDHCI_QUIRK_32BIT_DMA_SIZE);
> --
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 3/5] sdhci-s3c: increase the timeout value
2010-06-09 9:39 ` [PATCH 3/5] sdhci-s3c: increase the timeout value Marek Szyprowski
2010-06-10 10:46 ` Kukjin Kim
@ 2010-08-27 19:53 ` Chris Ball
1 sibling, 0 replies; 15+ messages in thread
From: Chris Ball @ 2010-08-27 19:53 UTC (permalink / raw)
To: linux-arm-kernel
Hi Marek,
On Wed, Jun 09, 2010 at 11:39:41AM +0200, Marek Szyprowski wrote:
> This patch increases the timeout value on sdhci-s3c controller by using
> SDHCI_QUIRK_BROKEN_TIMEOUT_VAL quirk. Without it most transfers from
> external mmc cards fails on Samsung s5pv210 SoCs based systems. Tested
> on Samsung Aquila board.
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> drivers/mmc/host/sdhci-s3c.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index ad30f07..2b6cb44 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -331,6 +331,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
> * transfers, not sure if this is a problem with this specific
> * SDHCI block, or a missing configuration that needs to be set. */
> host->quirks |= SDHCI_QUIRK_NO_BUSY_IRQ;
> + host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
>
> host->quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR |
> SDHCI_QUIRK_32BIT_DMA_SIZE);
> --
> 1.7.1.240.g225c
Kukjin Kim suggested using SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK instead,
so this wasn't merged. Would you like to resubmit with that change?
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 4/5] sdhci-s3c: add support for the non standard minimal clock value
2010-06-09 9:39 [PATCH] SDHCI-S3C fixes and enhancements (driver specific code) Marek Szyprowski
` (2 preceding siblings ...)
2010-06-09 9:39 ` [PATCH 3/5] sdhci-s3c: increase the timeout value Marek Szyprowski
@ 2010-06-09 9:39 ` Marek Szyprowski
2010-08-27 19:54 ` Chris Ball
2010-06-09 9:39 ` [PATCH 5/5] sdhci-s3c: add support for new card detection methods Marek Szyprowski
4 siblings, 1 reply; 15+ messages in thread
From: Marek Szyprowski @ 2010-06-09 9:39 UTC (permalink / raw)
To: linux-arm-kernel
S3C SDHCI host controller can change the source for generating mmc clock.
By default host bus clock is used, what causes some problems on machines
with 133MHz bus, because the SDHCI divider cannot be as high get proper
clock value for identification mode. This is not a problem for the
controller, because it can generate lower frequencies from other clock
sources. This patch adds a new quirk to SDHCI driver to calculate the
minimal supported clock frequency.
This fixes the flood of the following warnings on Samsung S5PV210 SoCs:
mmc0: Minimum clock frequency too high for identification mode
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/mmc/host/sdhci-of-esdhc.c | 1 +
drivers/mmc/host/sdhci-s3c.c | 29 +++++++++++++++++++++++++++++
drivers/mmc/host/sdhci.c | 2 +-
drivers/mmc/host/sdhci.h | 2 ++
4 files changed, 33 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index c8623de..64b3f79 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -124,6 +124,7 @@ struct sdhci_of_data sdhci_esdhc = {
SDHCI_QUIRK_BROKEN_CARD_DETECTION |
SDHCI_QUIRK_NO_BUSY_IRQ |
SDHCI_QUIRK_NONSTANDARD_CLOCK |
+ SDHCI_QUIRK_NONSTANDARD_MINCLOCK |
SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
SDHCI_QUIRK_PIO_NEEDS_DELAY |
SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET |
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 2b6cb44..615008d 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -209,10 +209,37 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, unsigned int clock)
}
}
+/**
+ * sdhci_s3c_get_min_clock - callback to get minimal supported clock value
+ * @host: The SDHCI host being queried
+ *
+ * To init mmc host properly a minimal clock value is needed. For high system
+ * bus clock's values the standard formula gives values out of allowed range.
+ * The clock still can be set to lower values, if clock source other then
+ * system bus is selected.
+*/
+static unsigned int sdhci_s3c_get_min_clock(struct sdhci_host *host)
+{
+ struct sdhci_s3c *ourhost = to_s3c(host);
+ unsigned int delta, min = UINT_MAX;
+ int src;
+
+ for (src = 0; src < MAX_BUS_CLK; src++) {
+ delta = sdhci_s3c_consider_clock(ourhost, src, 0);
+ if (delta == UINT_MAX)
+ continue;
+ /* delta is a negative value in this case */
+ if (-delta < min)
+ min = -delta;
+ }
+ return min;
+}
+
static struct sdhci_ops sdhci_s3c_ops = {
.get_max_clock = sdhci_s3c_get_max_clk,
.get_timeout_clock = sdhci_s3c_get_timeout_clk,
.set_clock = sdhci_s3c_set_clock,
+ .get_min_clock = sdhci_s3c_get_min_clock,
};
static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
@@ -316,6 +343,8 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
host->quirks = 0;
host->irq = irq;
+ host->quirks |= SDHCI_QUIRK_NONSTANDARD_MINCLOCK;
+
/* Setup quirks for the controller */
host->quirks |= SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC;
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index c6d1bd8..8b3ee53 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1785,7 +1785,7 @@ int sdhci_add_host(struct sdhci_host *host)
* Set host parameters.
*/
mmc->ops = &sdhci_ops;
- if (host->quirks & SDHCI_QUIRK_NONSTANDARD_CLOCK &&
+ if (host->quirks & SDHCI_QUIRK_NONSTANDARD_MINCLOCK &&
host->ops->set_clock && host->ops->get_min_clock)
mmc->f_min = host->ops->get_min_clock(host);
else
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index c846813..3fd87c2 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -240,6 +240,8 @@ struct sdhci_host {
#define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN (1<<25)
/* Controller cannot support End Attribute in NOP ADMA descriptor */
#define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC (1<<26)
+/* Controller has nonstandard clock management */
+#define SDHCI_QUIRK_NONSTANDARD_MINCLOCK (1<<27)
int irq; /* Device IRQ */
void __iomem * ioaddr; /* Mapped address */
--
1.7.1.240.g225c
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH 4/5] sdhci-s3c: add support for the non standard minimal clock value
2010-06-09 9:39 ` [PATCH 4/5] sdhci-s3c: add support for the non standard minimal clock value Marek Szyprowski
@ 2010-08-27 19:54 ` Chris Ball
2010-08-28 0:54 ` Kukjin Kim
0 siblings, 1 reply; 15+ messages in thread
From: Chris Ball @ 2010-08-27 19:54 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
Looks like this wasn't merged. Any thoughts on doing so?
On Wed, Jun 09, 2010 at 11:39:42AM +0200, Marek Szyprowski wrote:
> S3C SDHCI host controller can change the source for generating mmc clock.
> By default host bus clock is used, what causes some problems on machines
> with 133MHz bus, because the SDHCI divider cannot be as high get proper
> clock value for identification mode. This is not a problem for the
> controller, because it can generate lower frequencies from other clock
> sources. This patch adds a new quirk to SDHCI driver to calculate the
> minimal supported clock frequency.
>
> This fixes the flood of the following warnings on Samsung S5PV210 SoCs:
> mmc0: Minimum clock frequency too high for identification mode
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> drivers/mmc/host/sdhci-of-esdhc.c | 1 +
> drivers/mmc/host/sdhci-s3c.c | 29 +++++++++++++++++++++++++++++
> drivers/mmc/host/sdhci.c | 2 +-
> drivers/mmc/host/sdhci.h | 2 ++
> 4 files changed, 33 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
> index c8623de..64b3f79 100644
> --- a/drivers/mmc/host/sdhci-of-esdhc.c
> +++ b/drivers/mmc/host/sdhci-of-esdhc.c
> @@ -124,6 +124,7 @@ struct sdhci_of_data sdhci_esdhc = {
> SDHCI_QUIRK_BROKEN_CARD_DETECTION |
> SDHCI_QUIRK_NO_BUSY_IRQ |
> SDHCI_QUIRK_NONSTANDARD_CLOCK |
> + SDHCI_QUIRK_NONSTANDARD_MINCLOCK |
> SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
> SDHCI_QUIRK_PIO_NEEDS_DELAY |
> SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET |
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index 2b6cb44..615008d 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -209,10 +209,37 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, unsigned int clock)
> }
> }
>
> +/**
> + * sdhci_s3c_get_min_clock - callback to get minimal supported clock value
> + * @host: The SDHCI host being queried
> + *
> + * To init mmc host properly a minimal clock value is needed. For high system
> + * bus clock's values the standard formula gives values out of allowed range.
> + * The clock still can be set to lower values, if clock source other then
> + * system bus is selected.
> +*/
> +static unsigned int sdhci_s3c_get_min_clock(struct sdhci_host *host)
> +{
> + struct sdhci_s3c *ourhost = to_s3c(host);
> + unsigned int delta, min = UINT_MAX;
> + int src;
> +
> + for (src = 0; src < MAX_BUS_CLK; src++) {
> + delta = sdhci_s3c_consider_clock(ourhost, src, 0);
> + if (delta == UINT_MAX)
> + continue;
> + /* delta is a negative value in this case */
> + if (-delta < min)
> + min = -delta;
> + }
> + return min;
> +}
> +
> static struct sdhci_ops sdhci_s3c_ops = {
> .get_max_clock = sdhci_s3c_get_max_clk,
> .get_timeout_clock = sdhci_s3c_get_timeout_clk,
> .set_clock = sdhci_s3c_set_clock,
> + .get_min_clock = sdhci_s3c_get_min_clock,
> };
>
> static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
> @@ -316,6 +343,8 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
> host->quirks = 0;
> host->irq = irq;
>
> + host->quirks |= SDHCI_QUIRK_NONSTANDARD_MINCLOCK;
> +
> /* Setup quirks for the controller */
> host->quirks |= SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC;
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index c6d1bd8..8b3ee53 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1785,7 +1785,7 @@ int sdhci_add_host(struct sdhci_host *host)
> * Set host parameters.
> */
> mmc->ops = &sdhci_ops;
> - if (host->quirks & SDHCI_QUIRK_NONSTANDARD_CLOCK &&
> + if (host->quirks & SDHCI_QUIRK_NONSTANDARD_MINCLOCK &&
> host->ops->set_clock && host->ops->get_min_clock)
> mmc->f_min = host->ops->get_min_clock(host);
> else
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index c846813..3fd87c2 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -240,6 +240,8 @@ struct sdhci_host {
> #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN (1<<25)
> /* Controller cannot support End Attribute in NOP ADMA descriptor */
> #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC (1<<26)
> +/* Controller has nonstandard clock management */
> +#define SDHCI_QUIRK_NONSTANDARD_MINCLOCK (1<<27)
>
> int irq; /* Device IRQ */
> void __iomem * ioaddr; /* Mapped address */
> --
> 1.7.1.240.g225c
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH 4/5] sdhci-s3c: add support for the non standard minimal clock value
2010-08-27 19:54 ` Chris Ball
@ 2010-08-28 0:54 ` Kukjin Kim
0 siblings, 0 replies; 15+ messages in thread
From: Kukjin Kim @ 2010-08-28 0:54 UTC (permalink / raw)
To: linux-arm-kernel
Chris Ball wrote:
>
> Hi,
>
Hi again ;-)
> Looks like this wasn't merged. Any thoughts on doing so?
>
Updated patch(v3) of this was merged.
http://marc.info/?l=linux-arm-kernel&m=128040710023029&w=2
(commit ID: ce5f036bbbfc6c21d7b55b8fdaa2e2bd56392d94)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
> On Wed, Jun 09, 2010 at 11:39:42AM +0200, Marek Szyprowski wrote:
> > S3C SDHCI host controller can change the source for generating mmc
clock.
> > By default host bus clock is used, what causes some problems on machines
> > with 133MHz bus, because the SDHCI divider cannot be as high get proper
> > clock value for identification mode. This is not a problem for the
> > controller, because it can generate lower frequencies from other clock
> > sources. This patch adds a new quirk to SDHCI driver to calculate the
> > minimal supported clock frequency.
> >
> > This fixes the flood of the following warnings on Samsung S5PV210 SoCs:
> > mmc0: Minimum clock frequency too high for identification mode
> >
> > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > ---
> > drivers/mmc/host/sdhci-of-esdhc.c | 1 +
> > drivers/mmc/host/sdhci-s3c.c | 29
> +++++++++++++++++++++++++++++
> > drivers/mmc/host/sdhci.c | 2 +-
> > drivers/mmc/host/sdhci.h | 2 ++
> > 4 files changed, 33 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/mmc/host/sdhci-of-esdhc.c
b/drivers/mmc/host/sdhci-of-
> esdhc.c
> > index c8623de..64b3f79 100644
> > --- a/drivers/mmc/host/sdhci-of-esdhc.c
> > +++ b/drivers/mmc/host/sdhci-of-esdhc.c
> > @@ -124,6 +124,7 @@ struct sdhci_of_data sdhci_esdhc = {
> > SDHCI_QUIRK_BROKEN_CARD_DETECTION |
> > SDHCI_QUIRK_NO_BUSY_IRQ |
> > SDHCI_QUIRK_NONSTANDARD_CLOCK |
> > + SDHCI_QUIRK_NONSTANDARD_MINCLOCK |
> > SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
> > SDHCI_QUIRK_PIO_NEEDS_DELAY |
> > SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET |
> > diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> > index 2b6cb44..615008d 100644
> > --- a/drivers/mmc/host/sdhci-s3c.c
> > +++ b/drivers/mmc/host/sdhci-s3c.c
> > @@ -209,10 +209,37 @@ static void sdhci_s3c_set_clock(struct sdhci_host
> *host, unsigned int clock)
> > }
> > }
> >
> > +/**
> > + * sdhci_s3c_get_min_clock - callback to get minimal supported clock
value
> > + * @host: The SDHCI host being queried
> > + *
> > + * To init mmc host properly a minimal clock value is needed. For high
system
> > + * bus clock's values the standard formula gives values out of allowed
range.
> > + * The clock still can be set to lower values, if clock source other
then
> > + * system bus is selected.
> > +*/
> > +static unsigned int sdhci_s3c_get_min_clock(struct sdhci_host *host)
> > +{
> > + struct sdhci_s3c *ourhost = to_s3c(host);
> > + unsigned int delta, min = UINT_MAX;
> > + int src;
> > +
> > + for (src = 0; src < MAX_BUS_CLK; src++) {
> > + delta = sdhci_s3c_consider_clock(ourhost, src, 0);
> > + if (delta == UINT_MAX)
> > + continue;
> > + /* delta is a negative value in this case */
> > + if (-delta < min)
> > + min = -delta;
> > + }
> > + return min;
> > +}
> > +
> > static struct sdhci_ops sdhci_s3c_ops = {
> > .get_max_clock = sdhci_s3c_get_max_clk,
> > .get_timeout_clock = sdhci_s3c_get_timeout_clk,
> > .set_clock = sdhci_s3c_set_clock,
> > + .get_min_clock = sdhci_s3c_get_min_clock,
> > };
> >
> > static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
> > @@ -316,6 +343,8 @@ static int __devinit sdhci_s3c_probe(struct
> platform_device *pdev)
> > host->quirks = 0;
> > host->irq = irq;
> >
> > + host->quirks |= SDHCI_QUIRK_NONSTANDARD_MINCLOCK;
> > +
> > /* Setup quirks for the controller */
> > host->quirks |= SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC;
> >
> > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> > index c6d1bd8..8b3ee53 100644
> > --- a/drivers/mmc/host/sdhci.c
> > +++ b/drivers/mmc/host/sdhci.c
> > @@ -1785,7 +1785,7 @@ int sdhci_add_host(struct sdhci_host *host)
> > * Set host parameters.
> > */
> > mmc->ops = &sdhci_ops;
> > - if (host->quirks & SDHCI_QUIRK_NONSTANDARD_CLOCK &&
> > + if (host->quirks & SDHCI_QUIRK_NONSTANDARD_MINCLOCK &&
> > host->ops->set_clock && host->ops->get_min_clock)
> > mmc->f_min = host->ops->get_min_clock(host);
> > else
> > diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> > index c846813..3fd87c2 100644
> > --- a/drivers/mmc/host/sdhci.h
> > +++ b/drivers/mmc/host/sdhci.h
> > @@ -240,6 +240,8 @@ struct sdhci_host {
> > #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN (1<<25)
> > /* Controller cannot support End Attribute in NOP ADMA descriptor */
> > #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC (1<<26)
> > +/* Controller has nonstandard clock management */
> > +#define SDHCI_QUIRK_NONSTANDARD_MINCLOCK (1<<27)
> >
> > int irq; /* Device IRQ */
> > void __iomem * ioaddr; /* Mapped address */
> > --
> > 1.7.1.240.g225c
>
> --
> Chris Ball <cjb@laptop.org> <http://printf.net/>
> One Laptop Per Child
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 5/5] sdhci-s3c: add support for new card detection methods
2010-06-09 9:39 [PATCH] SDHCI-S3C fixes and enhancements (driver specific code) Marek Szyprowski
` (3 preceding siblings ...)
2010-06-09 9:39 ` [PATCH 4/5] sdhci-s3c: add support for the non standard minimal clock value Marek Szyprowski
@ 2010-06-09 9:39 ` Marek Szyprowski
2010-06-10 12:06 ` [PATCH 5/5 fixed] " Marek Szyprowski
4 siblings, 1 reply; 15+ messages in thread
From: Marek Szyprowski @ 2010-06-09 9:39 UTC (permalink / raw)
To: linux-arm-kernel
On some Samsung SoCs not all SDHCI controllers have card detect (CD)
line. For some embedded designs it is not even needed, because ususally
the device (like SDIO flash memory or wifi controller) is permanently
wired to the controller. There are also systems which have a card detect
line connected to some of the external interrupt lines or the presence
of the card depends on some other actions (like enabling a power
regulator).
This patch adds support for all these cases. The following card
detection methods are possible:
1. internal sdhci host card detect line
2. external event
3. no card detect line, controller will poll for the card
4. no card detect line, card is permanently wired to the controller
(once detected host won't poll it any more)
By default, all existing code would use method #1, what is compatible
with the previous version of the driver.
In case of external event, two callbacks must be provided in platdata:
ext_cd_init and ext_cd_cleanup. Both of them get a callback to a
function that notifies the s3c-sdhci host contoller as their argument.
That callback function should be called from the even dispatcher to let
host notice the card insertion/removal.
This patch adds changes to sdhci-s3c driver.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/mmc/host/sdhci-s3c.c | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 615008d..7de801d 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -242,6 +242,29 @@ static struct sdhci_ops sdhci_s3c_ops = {
.get_min_clock = sdhci_s3c_get_min_clock,
};
+static void sdhci_s3c_notify_change(struct platform_device *dev, int state)
+{
+ struct sdhci_host *host;
+ unsigned long flags;
+
+ local_irq_save(flags);
+ host = platform_get_drvdata(dev);
+ if (host) {
+ if (state) {
+ dev_info(&dev->dev, "card inserted.\n");
+ host->flags &= ~SDHCI_DEVICE_DEAD;
+ host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+ tasklet_schedule(&host->card_tasklet);
+ } else {
+ dev_info(&dev->dev, "card removed.\n");
+ host->flags |= SDHCI_DEVICE_DEAD;
+ host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+ tasklet_schedule(&host->card_tasklet);
+ }
+ }
+ local_irq_restore(flags);
+}
+
static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
{
struct s3c_sdhci_platdata *pdata = pdev->dev.platform_data;
@@ -362,6 +385,13 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
host->quirks |= SDHCI_QUIRK_NO_BUSY_IRQ;
host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
+ if (pdata->cd_type == S3C_SDHCI_CD_NONE ||
+ pdata->cd_type == S3C_SDHCI_CD_PERMANENT)
+ host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+
+ if (pdata->cd_type == S3C_SDHCI_CD_PERMANENT)
+ host->mmc->caps = MMC_CAP_NONREMOVABLE;
+
host->quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR |
SDHCI_QUIRK_32BIT_DMA_SIZE);
@@ -371,6 +401,11 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
goto err_add_host;
}
+ /* pdata->ext_cd_init might call sdhci_s3c_notify_change immediately,
+ so it can be called only after sdhci_add_host() */
+ if (pdata->cd_type == S3C_SDHCI_CD_EXTERNAL && pdata->ext_cd_init)
+ pdata->ext_cd_init(&sdhci_s3c_notify_change);
+
return 0;
err_add_host:
@@ -399,6 +434,9 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
struct sdhci_s3c *sc = sdhci_priv(host);
int ptr;
+ if (pdata->cd_type == S3C_SDHCI_CD_EXTERNAL && pdata->ext_cd_cleanup)
+ pdata->ext_cd_cleanup(&sdhci_s3c_notify_change);
+
sdhci_remove_host(host, 1);
for (ptr = 0; ptr < 3; ptr++) {
--
1.7.1.240.g225c
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH 5/5 fixed] sdhci-s3c: add support for new card detection methods
2010-06-09 9:39 ` [PATCH 5/5] sdhci-s3c: add support for new card detection methods Marek Szyprowski
@ 2010-06-10 12:06 ` Marek Szyprowski
0 siblings, 0 replies; 15+ messages in thread
From: Marek Szyprowski @ 2010-06-10 12:06 UTC (permalink / raw)
To: linux-arm-kernel
On some Samsung SoCs not all SDHCI controllers have card detect (CD)
line. For some embedded designs it is not even needed, because ususally
the device (like SDIO flash memory or wifi controller) is permanently
wired to the controller. There are also systems which have a card detect
line connected to some of the external interrupt lines or the presence
of the card depends on some other actions (like enabling a power
regulator).
This patch adds support for all these cases. The following card
detection methods are possible:
1. internal sdhci host card detect line
2. external event
3. no card detect line, controller will poll for the card
4. no card detect line, card is permanently wired to the controller
(once detected host won't poll it any more)
By default, all existing code would use method #1, what is compatible
with the previous version of the driver.
In case of external event, two callbacks must be provided in platdata:
ext_cd_init and ext_cd_cleanup. Both of them get a callback to a
function that notifies the s3c-sdhci host contoller as their argument.
That callback function should be called from the even dispatcher to let
host notice the card insertion/removal.
This patch adds changes to sdhci-s3c driver.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
This is a quick resend, in the previous version one line was missing in the
sdhci_s3c_remove() function causing a compilation break.
drivers/mmc/host/sdhci-s3c.c | 39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 615008d..f472295 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -242,6 +242,29 @@ static struct sdhci_ops sdhci_s3c_ops = {
.get_min_clock = sdhci_s3c_get_min_clock,
};
+static void sdhci_s3c_notify_change(struct platform_device *dev, int state)
+{
+ struct sdhci_host *host;
+ unsigned long flags;
+
+ local_irq_save(flags);
+ host = platform_get_drvdata(dev);
+ if (host) {
+ if (state) {
+ dev_info(&dev->dev, "card inserted.\n");
+ host->flags &= ~SDHCI_DEVICE_DEAD;
+ host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+ tasklet_schedule(&host->card_tasklet);
+ } else {
+ dev_info(&dev->dev, "card removed.\n");
+ host->flags |= SDHCI_DEVICE_DEAD;
+ host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+ tasklet_schedule(&host->card_tasklet);
+ }
+ }
+ local_irq_restore(flags);
+}
+
static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
{
struct s3c_sdhci_platdata *pdata = pdev->dev.platform_data;
@@ -362,6 +385,13 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
host->quirks |= SDHCI_QUIRK_NO_BUSY_IRQ;
host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
+ if (pdata->cd_type == S3C_SDHCI_CD_NONE ||
+ pdata->cd_type == S3C_SDHCI_CD_PERMANENT)
+ host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+
+ if (pdata->cd_type == S3C_SDHCI_CD_PERMANENT)
+ host->mmc->caps = MMC_CAP_NONREMOVABLE;
+
host->quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR |
SDHCI_QUIRK_32BIT_DMA_SIZE);
@@ -371,6 +401,11 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
goto err_add_host;
}
+ /* pdata->ext_cd_init might call sdhci_s3c_notify_change immediately,
+ so it can be called only after sdhci_add_host() */
+ if (pdata->cd_type == S3C_SDHCI_CD_EXTERNAL && pdata->ext_cd_init)
+ pdata->ext_cd_init(&sdhci_s3c_notify_change);
+
return 0;
err_add_host:
@@ -395,10 +430,14 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
{
+ struct s3c_sdhci_platdata *pdata = pdev->dev.platform_data;
struct sdhci_host *host = platform_get_drvdata(pdev);
struct sdhci_s3c *sc = sdhci_priv(host);
int ptr;
+ if (pdata->cd_type == S3C_SDHCI_CD_EXTERNAL && pdata->ext_cd_cleanup)
+ pdata->ext_cd_cleanup(&sdhci_s3c_notify_change);
+
sdhci_remove_host(host, 1);
for (ptr = 0; ptr < 3; ptr++) {
--
1.7.1.240.g225c
^ permalink raw reply related [flat|nested] 15+ messages in thread