diff mbox

[v2] mmc: sdhci: fix driver type B and D handling in sdhci_do_set_ios()

Message ID 20150520213501.15A7322078C@puck.mtv.corp.google.com (mailing list archive)
State New, archived
Headers show

Commit Message

Petri Gynther May 20, 2015, 9:35 p.m. UTC
sdhci_do_set_ios() doesn't currently program SDHCI_HOST_CONTROL2
register correctly when host->preset_enabled == false.

Add code to handle the missing cases MMC_SET_DRIVER_TYPE_B and
MMC_SET_DRIVER_TYPE_D.

Signed-off-by: Petri Gynther <pgynther@google.com>
---
 drivers/mmc/host/sdhci.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Ulf Hansson May 22, 2015, 1:47 p.m. UTC | #1
On 20 May 2015 at 23:35, Petri Gynther <pgynther@google.com> wrote:
> sdhci_do_set_ios() doesn't currently program SDHCI_HOST_CONTROL2
> register correctly when host->preset_enabled == false.
>
> Add code to handle the missing cases MMC_SET_DRIVER_TYPE_B and
> MMC_SET_DRIVER_TYPE_D.
>
> Signed-off-by: Petri Gynther <pgynther@google.com>

Thanks, applied.

Kind regards
Uffe

> ---
>  drivers/mmc/host/sdhci.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index c80287a..5d32a00 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1562,8 +1562,17 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
>                         ctrl_2 &= ~SDHCI_CTRL_DRV_TYPE_MASK;
>                         if (ios->drv_type == MMC_SET_DRIVER_TYPE_A)
>                                 ctrl_2 |= SDHCI_CTRL_DRV_TYPE_A;
> +                       else if (ios->drv_type == MMC_SET_DRIVER_TYPE_B)
> +                               ctrl_2 |= SDHCI_CTRL_DRV_TYPE_B;
>                         else if (ios->drv_type == MMC_SET_DRIVER_TYPE_C)
>                                 ctrl_2 |= SDHCI_CTRL_DRV_TYPE_C;
> +                       else if (ios->drv_type == MMC_SET_DRIVER_TYPE_D)
> +                               ctrl_2 |= SDHCI_CTRL_DRV_TYPE_D;
> +                       else {
> +                               pr_warn("%s: invalid driver type, default to "
> +                                       "driver type B\n", mmc_hostname(mmc));
> +                               ctrl_2 |= SDHCI_CTRL_DRV_TYPE_B;
> +                       }
>
>                         sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
>                 } else {
> --
> 2.2.0.rc0.207.ga3a616c
>
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index c80287a..5d32a00 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1562,8 +1562,17 @@  static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
 			ctrl_2 &= ~SDHCI_CTRL_DRV_TYPE_MASK;
 			if (ios->drv_type == MMC_SET_DRIVER_TYPE_A)
 				ctrl_2 |= SDHCI_CTRL_DRV_TYPE_A;
+			else if (ios->drv_type == MMC_SET_DRIVER_TYPE_B)
+				ctrl_2 |= SDHCI_CTRL_DRV_TYPE_B;
 			else if (ios->drv_type == MMC_SET_DRIVER_TYPE_C)
 				ctrl_2 |= SDHCI_CTRL_DRV_TYPE_C;
+			else if (ios->drv_type == MMC_SET_DRIVER_TYPE_D)
+				ctrl_2 |= SDHCI_CTRL_DRV_TYPE_D;
+			else {
+				pr_warn("%s: invalid driver type, default to "
+					"driver type B\n", mmc_hostname(mmc));
+				ctrl_2 |= SDHCI_CTRL_DRV_TYPE_B;
+			}
 
 			sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
 		} else {