Skip to contentSkip to conversation

mmc: dw-mmc: add the platdata related with clock

PATCH In review Jaehoon Chung 3 participants 3 messages Aug 28, 2012 – Sep 4, 2012

Subsystems (2)
lore
Share & tools
lore

Jaehoon Chung

author maintainer
#0 lore raw

PATCH v2 2/5 mmc: dw-mmc: add the platdata related with clock

Some SoC need to set the clock-phase shift.
So Add the callback function into platdata for using phase-shift

---
 drivers/mmc/host/dw_mmc.c  |    3 +++
 include/linux/mmc/dw_mmc.h |    8 ++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
drivers/mmc/host/dw_mmc.c +3 -0
index e30d3ed..437fdf8 100644
@@ -821,6 +821,9 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 
 	mci_writel(slot->host, UHS_REG, regs);
 
+	if (slot->host->pdata->set_clk_drv_sample)
+		slot->host->pdata->set_clk_drv_sample(slot->host, ios);
+
 	if (ios->clock) {
 		/*
 		 * Use mirror of ios->clock to prevent race with mmc
include/linux/mmc/dw_mmc.h +8 -0
index 7a7ebd3..f20979c 100644
@@ -229,6 +229,9 @@ struct dw_mci_board {
 	 */
 	unsigned int fifo_depth;
 
+	u32 ddr_timing;		/* DDR clock phase timing value */
+	u32 sdr_timing;		/* SDR clock phase timing value */
+
 	/* delay in mS before detecting cards after interrupt */
 	u32 detect_delay_ms;
 
@@ -249,6 +252,11 @@ struct dw_mci_board {
 	struct dw_mci_dma_ops *dma_ops;
 	struct dma_pdata *data;
 	struct block_settings *blk_settings;
+
+	int (*get_clk_drv)(struct dw_mci *);
+	int (*get_clk_sample)(struct dw_mci *);
+	void (*set_clk_drv_sample)(struct dw_mci *host, struct mmc_ios *ios);
+
 };
 
 #endif /* LINUX_MMC_DW_MMC_H */
Signature · 1 line
1.7.4.1
Reviewed-by on v2 2/5
#1 lore raw
Quoted 51 lines · Jaehoon Chung

Some SoC need to set the clock-phase shift.
So Add the callback function into platdata for using phase-shift

---
 drivers/mmc/host/dw_mmc.c  |    3 +++
 include/linux/mmc/dw_mmc.h |    8 ++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
drivers/mmc/host/dw_mmc.c +3 -0
index e30d3ed..437fdf8 100644
@@ -821,6 +821,9 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 
        mci_writel(slot->host, UHS_REG, regs);
 
+       if (slot->host->pdata->set_clk_drv_sample)
+               slot->host->pdata->set_clk_drv_sample(slot->host, ios);
+
        if (ios->clock) {
                /*
                 * Use mirror of ios->clock to prevent race with mmc
include/linux/mmc/dw_mmc.h +8 -1
index 7a7ebd3..f20979c 100644
@@ -229,6 +229,9 @@ struct dw_mci_board {
         */
        unsigned int fifo_depth;
 
+       u32 ddr_timing;         /* DDR clock phase timing value */
+       u32 sdr_timing;         /* SDR clock phase timing value */
+
        /* delay in mS before detecting cards after interrupt */
        u32 detect_delay_ms;
 
@@ -249,6 +252,11 @@ struct dw_mci_board {
        struct dw_mci_dma_ops *dma_ops;
        struct dma_pdata *data;
        struct block_settings *blk_settings;
+
+       int (*get_clk_drv)(struct dw_mci *);
+       int (*get_clk_sample)(struct dw_mci *);
+       void (*set_clk_drv_sample)(struct dw_mci *host, struct mmc_ios *ios);
+
 };
 
 #endif /* LINUX_MMC_DW_MMC_H */
--
Quoted 1 line

1.7.4.1

#2 lore raw
In reply to Jaehoon Chung

Hi,

Quoted 29 lines · Jaehoon Chung

Some SoC need to set the clock-phase shift.
So Add the callback function into platdata for using phase-shift

---
 drivers/mmc/host/dw_mmc.c  |    3 +++
 include/linux/mmc/dw_mmc.h |    8 ++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
drivers/mmc/host/dw_mmc.c +3 -0
index e30d3ed..437fdf8 100644
@@ -821,6 +821,9 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 
 	mci_writel(slot->host, UHS_REG, regs);
 
+	if (slot->host->pdata->set_clk_drv_sample)
+		slot->host->pdata->set_clk_drv_sample(slot->host, ios);
+
 	if (ios->clock) {
 		/*
 		 * Use mirror of ios->clock to prevent race with mmc
include/linux/mmc/dw_mmc.h +0 -0
index 7a7ebd3..f20979c 100644

include/linux/mmc/dw_mmc.h struct dw_mci_board { · line 234

Quoted 6 lines
include/linux/mmc/dw_mmc.h +3 -0
@@ -229,6 +229,9 @@ struct dw_mci_board {
 	 */
 	unsigned int fifo_depth;
 
+	u32 ddr_timing;		/* DDR clock phase timing value */
+	u32 sdr_timing;		/* SDR clock phase timing value */
+

These don't appear to be used. Are they meant to be there?

include/linux/mmc/dw_mmc.h struct dw_mci_board { · line 257

Quoted 10 lines
include/linux/mmc/dw_mmc.h +3 -0
 	/* delay in mS before detecting cards after interrupt */
 	u32 detect_delay_ms;
 
@@ -249,6 +252,11 @@ struct dw_mci_board {
 	struct dw_mci_dma_ops *dma_ops;
 	struct dma_pdata *data;
 	struct block_settings *blk_settings;
+
+	int (*get_clk_drv)(struct dw_mci *);
+	int (*get_clk_sample)(struct dw_mci *);

same with these two functions?

Thanks
James

Quoted 6 lines
include/linux/mmc/dw_mmc.h +2 -0
+	void (*set_clk_drv_sample)(struct dw_mci *host, struct mmc_ios *ios);
+
 };
 
 #endif /* LINUX_MMC_DW_MMC_H */