Re: [PATCH] sdhci: add quirk for controllers that don't support write only detect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There are a couple of other items that I wanted to fix which I can submit patches for separately or can incorporate into your structure or we can work together.  Advise.

a) There needs to be a distinction between PRESENT STATE broken and a SD card that IS present (as in mounted on the board).  There is no need to poll for the later case.  The current quirk makes no distinction between these two cases.

b) Some eMMC chips require 74 clocks to start working.  The current code assumes turning on the clock (in the core/ directory) does this.  This is not always the case.  I modified the set_ios function to fix this.

snippet below (WILL not patch into 2.6.36 tree since I have other code) -- just so you get the idea --

--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -383,7 +383,7 @@ struct sdhci_ops {
 	void		(*platform_set_8_bit)(struct sdhci_host *host);
 	void		(*platform_clear_8_bit)(struct sdhci_host *host);
 	void		(*platform_specific_sdhci_enable_dummy_cmd) (struct sdhci_host *host, int dummycmd);
-	void		(*platform_specific_init_clocks)(struct sdhci_host *host);
+	void		(*platform_generate_initial_74_clocks)(struct sdhci_host *host, u8 power_mode);
 };


--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1279,8 +1279,11 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 
 	if (ios->power_mode == MMC_POWER_OFF)
 		sdhci_set_power(host, -1);
-	else
+	else {
 		sdhci_set_power(host, ios->vdd);
+		if (host->ops->platform_generate_initial_74_clocks)
+			host->ops->platform_generate_initial_74_clocks(host, ios->power_mode);
+	}

In my adaption layer 
+void generate_init_clocks(struct sdhci_host *host, u8 power_mode)
+{
+	if (slot->power_mode == MMC_POWER_UP 
+	&& power_mode == MMC_POWER_ON) {
		/* slot has old state */
+		/* now do chip/board specific activity */
+	}
+	slot->power_mode = power_mode;
+}


Philip

On Sep 19, 2010, at 11:14 PM, Wolfram Sang wrote:

> On Sun, Sep 19, 2010 at 02:46:40PM -0700, Philip Rakity wrote:
>> 
>> 
>> Some board designs for embedded systems  do not always bring up the SD Host Write Protect Signal.  
>> This patch defines a new quirk that when enabled enables write access.
> 
> I am preparing a patch series which will also make get_ro an overloadable
> function. Then, board specific things could be handled there.
> 
> Regards,
> 
>   Wolfram
> 
> -- 
> Pengutronix e.K.                           | Wolfram Sang                |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux