[RFC PATCH 1/7] mmc: sdhci: add quirk for broken 3.0V support

2014-06-20 Thread Vincent Yang
This patch defines a quirk for platforms unable
to enable 3.0V support.
It is a preparation and will be used by Fujitsu
SDHCI controller f_sdh30 driver.

Signed-off-by: Vincent Yang vincent.y...@tw.fujitsu.com
---
 drivers/mmc/host/sdhci.c  | 3 +++
 include/linux/mmc/sdhci.h | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 47055f3..523075f 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -3069,6 +3069,9 @@ int sdhci_add_host(struct sdhci_host *host)
}
 #endif /* CONFIG_REGULATOR */
 
+   if (host-quirks2  SDHCI_QUIRK2_NO_3_0_V)
+   caps[0] = ~SDHCI_CAN_VDD_300;
+
/*
 * According to SD Host Controller spec v3.00, if the Host System
 * can afford more than 150mA, Host Driver should set XPC to 1. Also
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 08abe99..cac0958 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -98,6 +98,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK2_BROKEN_HS200  (16)
 /* Controller does not support DDR50 */
 #define SDHCI_QUIRK2_BROKEN_DDR50  (17)
+/* The system physically doesn't support 3.0v, even if the host does */
+#define SDHCI_QUIRK2_NO_3_0_V  (18)
 
int irq;/* Device IRQ */
void __iomem *ioaddr;   /* Mapped address */
-- 
1.9.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC PATCH 1/7] mmc: sdhci: add quirk for broken 3.0V support

2014-06-20 Thread Anton Vorontsov
On Fri, Jun 20, 2014 at 05:35:22PM +0800, Vincent Yang wrote:
 This patch defines a quirk for platforms unable
 to enable 3.0V support.
 It is a preparation and will be used by Fujitsu
 SDHCI controller f_sdh30 driver.
 
 Signed-off-by: Vincent Yang vincent.y...@tw.fujitsu.com

I don't think you need this patch. Instead, you can exclude 3V using the
voltage-ranges =  in the device tree.

Thanks,

Anton

  drivers/mmc/host/sdhci.c  | 3 +++
  include/linux/mmc/sdhci.h | 2 ++
  2 files changed, 5 insertions(+)
 
 diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
 index 47055f3..523075f 100644
 --- a/drivers/mmc/host/sdhci.c
 +++ b/drivers/mmc/host/sdhci.c
 @@ -3069,6 +3069,9 @@ int sdhci_add_host(struct sdhci_host *host)
   }
  #endif /* CONFIG_REGULATOR */
  
 + if (host-quirks2  SDHCI_QUIRK2_NO_3_0_V)
 + caps[0] = ~SDHCI_CAN_VDD_300;
 +
   /*
* According to SD Host Controller spec v3.00, if the Host System
* can afford more than 150mA, Host Driver should set XPC to 1. Also
 diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
 index 08abe99..cac0958 100644
 --- a/include/linux/mmc/sdhci.h
 +++ b/include/linux/mmc/sdhci.h
 @@ -98,6 +98,8 @@ struct sdhci_host {
  #define SDHCI_QUIRK2_BROKEN_HS200(16)
  /* Controller does not support DDR50 */
  #define SDHCI_QUIRK2_BROKEN_DDR50(17)
 +/* The system physically doesn't support 3.0v, even if the host does */
 +#define SDHCI_QUIRK2_NO_3_0_V(18)
  
   int irq;/* Device IRQ */
   void __iomem *ioaddr;   /* Mapped address */
 -- 
 1.9.0
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC PATCH 1/7] mmc: sdhci: add quirk for broken 3.0V support

2014-06-20 Thread Vincent Yang
Hi Anton,
Thanks a lot for your review.
I will update it in next version.


Best regards,
Vincent Yang

2014-06-21 4:26 GMT+08:00 Anton Vorontsov an...@enomsg.org:
 On Fri, Jun 20, 2014 at 05:35:22PM +0800, Vincent Yang wrote:
 This patch defines a quirk for platforms unable
 to enable 3.0V support.
 It is a preparation and will be used by Fujitsu
 SDHCI controller f_sdh30 driver.

 Signed-off-by: Vincent Yang vincent.y...@tw.fujitsu.com

 I don't think you need this patch. Instead, you can exclude 3V using the
 voltage-ranges =  in the device tree.

 Thanks,

 Anton

  drivers/mmc/host/sdhci.c  | 3 +++
  include/linux/mmc/sdhci.h | 2 ++
  2 files changed, 5 insertions(+)

 diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
 index 47055f3..523075f 100644
 --- a/drivers/mmc/host/sdhci.c
 +++ b/drivers/mmc/host/sdhci.c
 @@ -3069,6 +3069,9 @@ int sdhci_add_host(struct sdhci_host *host)
   }
  #endif /* CONFIG_REGULATOR */

 + if (host-quirks2  SDHCI_QUIRK2_NO_3_0_V)
 + caps[0] = ~SDHCI_CAN_VDD_300;
 +
   /*
* According to SD Host Controller spec v3.00, if the Host System
* can afford more than 150mA, Host Driver should set XPC to 1. Also
 diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
 index 08abe99..cac0958 100644
 --- a/include/linux/mmc/sdhci.h
 +++ b/include/linux/mmc/sdhci.h
 @@ -98,6 +98,8 @@ struct sdhci_host {
  #define SDHCI_QUIRK2_BROKEN_HS200(16)
  /* Controller does not support DDR50 */
  #define SDHCI_QUIRK2_BROKEN_DDR50(17)
 +/* The system physically doesn't support 3.0v, even if the host does */
 +#define SDHCI_QUIRK2_NO_3_0_V(18)

   int irq;/* Device IRQ */
   void __iomem *ioaddr;   /* Mapped address */
 --
 1.9.0
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev