[PATCH 3/6] mmc: sdhci: add platform set_timeout hook
From: Dong Aisheng <hidden>
Date: 2013-12-11 05:03:43
Also in:
linux-mmc
On Wed, Dec 11, 2013 at 11:48 AM, Shawn Guo [off-list ref] wrote:
On Wed, Dec 11, 2013 at 11:35:17AM +0800, Dong Aisheng wrote:quoted
This actually is the register value, not the max timeout counter value. Then you may want define the API as: unsigned int (*get_max_timeout_val)(struct sdhci_host *host);Yes, something like that.quoted
But i don't think it's necessary to do the max timeout setting in two steps. First, deinfe a API to get the max timeout counter val, Second, write this val into register. Why not simply implement .set_timeout and handle the details in platform specific host driver respectively?Well, that's how sdhci host driver is structured. Doing so leaves the least details to platform driver, and calling sdhci_writeb() to access SDHCI_TIMEOUT_CONTROL in sdhci-esdhc-imx seems a layer violation to me.
The current sdhci-esdhci-imx already does something like that. You can search SDHCI_* in the code. It just reuses the register offset definition in sdhci, It's not the layer violation. Regards Dong Aisheng
quoted
Furthermore, this API does not help for the patch#1 issue.Oh, they two different issues, and should be addressed by different hooks. Shawn