Re: [RFC v2 2/2] sdhci: Prevent SD from doing high-speed timing when broken-highspeed property is set

2016-10-17 Thread Adrian Hunter
On 12/10/16 21:40, Zach Brown wrote:
> When the broken-highspeed property is set the sdhci driver will not
> go into highspeed mode even if the controller and card appear to
> otherwise support highspeed mode.
> 
> This is useful in cases where the controller and card support highspeed,
> but the board configuration or some other issue make highspeed
> impossible. For example, we send the SDIO lines through a fpga so we
> need the data to change on the falling edge of the clock or there will
> be issues with hold time.
> 
> Signed-off-by: Zach Brown 

Assuming the DT property is accepted:

Acked-by: Adrian Hunter 

> ---
>  drivers/mmc/host/sdhci.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 4805566..17e6c50 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -22,6 +22,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include 
>  
> @@ -3274,7 +3275,8 @@ int sdhci_setup_host(struct sdhci_host *host)
>   if (host->quirks2 & SDHCI_QUIRK2_HOST_NO_CMD23)
>   mmc->caps &= ~MMC_CAP_CMD23;
>  
> - if (host->caps & SDHCI_CAN_DO_HISPD)
> + if ((host->caps & SDHCI_CAN_DO_HISPD) &&
> + !(of_property_read_bool(mmc_dev(mmc)->of_node, "broken-highspeed")))
>   mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
>  
>   if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
> 



Re: [RFC v2 2/2] sdhci: Prevent SD from doing high-speed timing when broken-highspeed property is set

2016-10-17 Thread Adrian Hunter
On 12/10/16 21:40, Zach Brown wrote:
> When the broken-highspeed property is set the sdhci driver will not
> go into highspeed mode even if the controller and card appear to
> otherwise support highspeed mode.
> 
> This is useful in cases where the controller and card support highspeed,
> but the board configuration or some other issue make highspeed
> impossible. For example, we send the SDIO lines through a fpga so we
> need the data to change on the falling edge of the clock or there will
> be issues with hold time.
> 
> Signed-off-by: Zach Brown 

Assuming the DT property is accepted:

Acked-by: Adrian Hunter 

> ---
>  drivers/mmc/host/sdhci.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 4805566..17e6c50 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -22,6 +22,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include 
>  
> @@ -3274,7 +3275,8 @@ int sdhci_setup_host(struct sdhci_host *host)
>   if (host->quirks2 & SDHCI_QUIRK2_HOST_NO_CMD23)
>   mmc->caps &= ~MMC_CAP_CMD23;
>  
> - if (host->caps & SDHCI_CAN_DO_HISPD)
> + if ((host->caps & SDHCI_CAN_DO_HISPD) &&
> + !(of_property_read_bool(mmc_dev(mmc)->of_node, "broken-highspeed")))
>   mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
>  
>   if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
> 



[RFC v2 2/2] sdhci: Prevent SD from doing high-speed timing when broken-highspeed property is set

2016-10-12 Thread Zach Brown
When the broken-highspeed property is set the sdhci driver will not
go into highspeed mode even if the controller and card appear to
otherwise support highspeed mode.

This is useful in cases where the controller and card support highspeed,
but the board configuration or some other issue make highspeed
impossible. For example, we send the SDIO lines through a fpga so we
need the data to change on the falling edge of the clock or there will
be issues with hold time.

Signed-off-by: Zach Brown 
---
 drivers/mmc/host/sdhci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 4805566..17e6c50 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -3274,7 +3275,8 @@ int sdhci_setup_host(struct sdhci_host *host)
if (host->quirks2 & SDHCI_QUIRK2_HOST_NO_CMD23)
mmc->caps &= ~MMC_CAP_CMD23;
 
-   if (host->caps & SDHCI_CAN_DO_HISPD)
+   if ((host->caps & SDHCI_CAN_DO_HISPD) &&
+   !(of_property_read_bool(mmc_dev(mmc)->of_node, "broken-highspeed")))
mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
 
if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
-- 
2.7.4



[RFC v2 2/2] sdhci: Prevent SD from doing high-speed timing when broken-highspeed property is set

2016-10-12 Thread Zach Brown
When the broken-highspeed property is set the sdhci driver will not
go into highspeed mode even if the controller and card appear to
otherwise support highspeed mode.

This is useful in cases where the controller and card support highspeed,
but the board configuration or some other issue make highspeed
impossible. For example, we send the SDIO lines through a fpga so we
need the data to change on the falling edge of the clock or there will
be issues with hold time.

Signed-off-by: Zach Brown 
---
 drivers/mmc/host/sdhci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 4805566..17e6c50 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -3274,7 +3275,8 @@ int sdhci_setup_host(struct sdhci_host *host)
if (host->quirks2 & SDHCI_QUIRK2_HOST_NO_CMD23)
mmc->caps &= ~MMC_CAP_CMD23;
 
-   if (host->caps & SDHCI_CAN_DO_HISPD)
+   if ((host->caps & SDHCI_CAN_DO_HISPD) &&
+   !(of_property_read_bool(mmc_dev(mmc)->of_node, "broken-highspeed")))
mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
 
if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
-- 
2.7.4