Skip to contentSkip to conversation

mmc: sdhci-of-arasan: Add ability to export card clock

PATCH In review Douglas Anderson 2 participants 2 messages Jun 15, 2016 – Jun 16, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 7/11 mmc: sdhci-of-arasan: Add ability to export card clock

Some SD/eMMC PHYs (like the PHY from Arasan that is designed to work with arasan,sdhci-5.1) need to know the card clock in order to function properly. Let's add the ability to expose this clock. Any PHY that needs to know the clock rate can add a reference and query the clock rate.

At the moment we register a CLK_GET_RATE_NOCACHE clock that simply allows querying the clock. This allows us to be less intrusive with regards to the main SDHCI driver, which has complex logic for adjusting the SD clock. Right now we always fully power cycle the PHY when the clock changes and that gives the PHY a good chance to query our clock.

---
Note: just sending the one quick fix as v2.1. If further spins are needed I'll send out a full v3.

Changes in v2.1:
- Add dependency on COMMON_CLK (Guenter Roeck)

Changes in v2: None

 drivers/mmc/host/Kconfig           |   1 +
 drivers/mmc/host/sdhci-of-arasan.c | 125 ++++++++++++++++++++++++++++++++++++-
 2 files changed, 123 insertions(+), 3 deletions(-)
drivers/mmc/host/Kconfig +1 -0
index 0aa484c10c0a..6725dc9e644b 100644
@@ -122,6 +122,7 @@ config MMC_SDHCI_OF_ARASAN
 	tristate "SDHCI OF support for the Arasan SDHCI controllers"
 	depends on MMC_SDHCI_PLTFM
 	depends on OF
+	depends on COMMON_CLK
 	help
 	  This selects the Arasan Secure Digital Host Controller Interface
 	  (SDHCI). This hardware is found e.g. in Xilinx' Zynq SoC.
drivers/mmc/host/sdhci-of-arasan.c +122 -3

198 lines not on this page · raw message

Signature · 1 line
2.8.0.rc3.226.g39d4020
maintainer Reviewed-by Tested-by on v1 7/11
#1 lore raw

Am Mittwoch, 15. Juni 2016, 09:37:51 schrieb Douglas Anderson:

Quoted 6 lines

Some SD/eMMC PHYs (like the PHY from Arasan that is designed to work with arasan,sdhci-5.1) need to know the card clock in order to function properly. Let's add the ability to expose this clock. Any PHY that needs to know the clock rate can add a reference and query the clock rate.

Quoted 7 lines

At the moment we register a CLK_GET_RATE_NOCACHE clock that simply allows querying the clock. This allows us to be less intrusive with regards to the main SDHCI driver, which has complex logic for adjusting the SD clock. Right now we always fully power cycle the PHY when the clock changes and that gives the PHY a good chance to query our clock.

for me this looks very nice implementation-wise and I also didn't spot glaring things, so

and as states in the original series, on a rk3399-evb