public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/5] mmc: dw-mmc: add the platdata related with clock
@ 2012-08-23 11:31 Jaehoon Chung
  2012-08-23 12:10 ` Will Newton
  0 siblings, 1 reply; 5+ messages in thread
From: Jaehoon Chung @ 2012-08-23 11:31 UTC (permalink / raw)
  To: linux-mmc; +Cc: Chris Ball, Kyungmin Park, Will Newton, James Hogan

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

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/mmc/host/dw_mmc.c  |    3 +++
 include/linux/mmc/dw_mmc.h |    8 ++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 8bef3c2..feafa2d 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -824,6 +824,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
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
index 7a7ebd3..f20979c 100644
--- a/include/linux/mmc/dw_mmc.h
+++ b/include/linux/mmc/dw_mmc.h
@@ -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 */
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/5] mmc: dw-mmc: add the platdata related with clock
  2012-08-23 11:31 [PATCH 3/5] mmc: dw-mmc: add the platdata related with clock Jaehoon Chung
@ 2012-08-23 12:10 ` Will Newton
  2012-08-23 12:18   ` Jaehoon Chung
  0 siblings, 1 reply; 5+ messages in thread
From: Will Newton @ 2012-08-23 12:10 UTC (permalink / raw)
  To: Jaehoon Chung
  Cc: linux-mmc, Chris Ball, Kyungmin Park, Will Newton, James Hogan

On Thu, Aug 23, 2012 at 12:31 PM, Jaehoon Chung <jh80.chung@samsung.com> wrote:

Hi Jaehoon,

> Some SoC need to set the clock-phase shift.
> So Add the callback function into platdata for using phase-shift
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  drivers/mmc/host/dw_mmc.c  |    3 +++
>  include/linux/mmc/dw_mmc.h |    8 ++++++++
>  2 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 8bef3c2..feafa2d 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -824,6 +824,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
> diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
> index 7a7ebd3..f20979c 100644
> --- a/include/linux/mmc/dw_mmc.h
> +++ b/include/linux/mmc/dw_mmc.h
> @@ -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 members...

>         /* 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 *);

...and these members do not seem to be used in the rest of this patch.
Should they be included?

> +       void (*set_clk_drv_sample)(struct dw_mci *host, struct mmc_ios *ios);
> +
>  };
>
>  #endif /* LINUX_MMC_DW_MMC_H */
> --
> 1.7.4.1
> --
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/5] mmc: dw-mmc: add the platdata related with clock
  2012-08-23 12:10 ` Will Newton
@ 2012-08-23 12:18   ` Jaehoon Chung
  2012-08-24  4:03     ` Seungwon Jeon
  0 siblings, 1 reply; 5+ messages in thread
From: Jaehoon Chung @ 2012-08-23 12:18 UTC (permalink / raw)
  To: Will Newton
  Cc: Jaehoon Chung, linux-mmc, Chris Ball, Kyungmin Park, Will Newton,
	James Hogan

Hi Will,

On 08/23/2012 09:10 PM, Will Newton wrote:
> On Thu, Aug 23, 2012 at 12:31 PM, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> 
> Hi Jaehoon,
> 
>> Some SoC need to set the clock-phase shift.
>> So Add the callback function into platdata for using phase-shift
>>
>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>>  drivers/mmc/host/dw_mmc.c  |    3 +++
>>  include/linux/mmc/dw_mmc.h |    8 ++++++++
>>  2 files changed, 11 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>> index 8bef3c2..feafa2d 100644
>> --- a/drivers/mmc/host/dw_mmc.c
>> +++ b/drivers/mmc/host/dw_mmc.c
>> @@ -824,6 +824,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
>> diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
>> index 7a7ebd3..f20979c 100644
>> --- a/include/linux/mmc/dw_mmc.h
>> +++ b/include/linux/mmc/dw_mmc.h
>> @@ -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 members...
> 
>>         /* 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 *);
> 
> ...and these members do not seem to be used in the rest of this patch.
> Should they be included?
These member should be used at exynos-soc.
I will also send the patch related with them.

Thanks for comments.

Best Regards,
Jaehoon Chung
> 
>> +       void (*set_clk_drv_sample)(struct dw_mci *host, struct mmc_ios *ios);
>> +
>>  };
>>
>>  #endif /* LINUX_MMC_DW_MMC_H */
>> --
>> 1.7.4.1
>> --
>> 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
> --
> 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
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 3/5] mmc: dw-mmc: add the platdata related with clock
  2012-08-23 12:18   ` Jaehoon Chung
@ 2012-08-24  4:03     ` Seungwon Jeon
  2012-08-24  5:03       ` Jaehoon Chung
  0 siblings, 1 reply; 5+ messages in thread
From: Seungwon Jeon @ 2012-08-24  4:03 UTC (permalink / raw)
  To: 'Jaehoon Chung', 'Will Newton'
  Cc: 'linux-mmc', 'Chris Ball',
	'Kyungmin Park', 'Will Newton',
	'James Hogan'

On Thursday, August 23, 2012, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> Hi Will,
> 
> On 08/23/2012 09:10 PM, Will Newton wrote:
> > On Thu, Aug 23, 2012 at 12:31 PM, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> >
> > Hi Jaehoon,
> >
> >> Some SoC need to set the clock-phase shift.
> >> So Add the callback function into platdata for using phase-shift
> >>
> >> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> >> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> >> ---
> >>  drivers/mmc/host/dw_mmc.c  |    3 +++
> >>  include/linux/mmc/dw_mmc.h |    8 ++++++++
> >>  2 files changed, 11 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> >> index 8bef3c2..feafa2d 100644
> >> --- a/drivers/mmc/host/dw_mmc.c
> >> +++ b/drivers/mmc/host/dw_mmc.c
> >> @@ -824,6 +824,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
> >> diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
> >> index 7a7ebd3..f20979c 100644
> >> --- a/include/linux/mmc/dw_mmc.h
> >> +++ b/include/linux/mmc/dw_mmc.h
> >> @@ -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 members...
> >
> >>         /* 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 *);
> >
> > ...and these members do not seem to be used in the rest of this patch.
> > Should they be included?
> These member should be used at exynos-soc.
> I will also send the patch related with them.
These are needed.
Actually, we have applied it for Exynos internally.
But I can't make sure that other host can apply it with the same way.
It is a good chance that we can find out implementation of other host based on Synopsys.

> 
> Thanks for comments.
> 
> Best Regards,
> Jaehoon Chung
> >
> >> +       void (*set_clk_drv_sample)(struct dw_mci *host, struct mmc_ios *ios);
> >> +
> >>  };
> >>
> >>  #endif /* LINUX_MMC_DW_MMC_H */
> >> --
> >> 1.7.4.1
> >> --
> >> 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
> > --
> > 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
> >
> 
> --
> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/5] mmc: dw-mmc: add the platdata related with clock
  2012-08-24  4:03     ` Seungwon Jeon
@ 2012-08-24  5:03       ` Jaehoon Chung
  0 siblings, 0 replies; 5+ messages in thread
From: Jaehoon Chung @ 2012-08-24  5:03 UTC (permalink / raw)
  To: Seungwon Jeon
  Cc: 'Jaehoon Chung', 'Will Newton',
	'linux-mmc', 'Chris Ball',
	'Kyungmin Park', 'Will Newton',
	'James Hogan'

On 08/24/2012 01:03 PM, Seungwon Jeon wrote:
> On Thursday, August 23, 2012, Jaehoon Chung <jh80.chung@samsung.com> wrote:
>> Hi Will,
>>
>> On 08/23/2012 09:10 PM, Will Newton wrote:
>>> On Thu, Aug 23, 2012 at 12:31 PM, Jaehoon Chung <jh80.chung@samsung.com> wrote:
>>>
>>> Hi Jaehoon,
>>>
>>>> Some SoC need to set the clock-phase shift.
>>>> So Add the callback function into platdata for using phase-shift
>>>>
>>>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>>>> ---
>>>>  drivers/mmc/host/dw_mmc.c  |    3 +++
>>>>  include/linux/mmc/dw_mmc.h |    8 ++++++++
>>>>  2 files changed, 11 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>>>> index 8bef3c2..feafa2d 100644
>>>> --- a/drivers/mmc/host/dw_mmc.c
>>>> +++ b/drivers/mmc/host/dw_mmc.c
>>>> @@ -824,6 +824,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
>>>> diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
>>>> index 7a7ebd3..f20979c 100644
>>>> --- a/include/linux/mmc/dw_mmc.h
>>>> +++ b/include/linux/mmc/dw_mmc.h
>>>> @@ -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 members...
>>>
>>>>         /* 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 *);
>>>
>>> ...and these members do not seem to be used in the rest of this patch.
>>> Should they be included?
>> These member should be used at exynos-soc.
>> I will also send the patch related with them.
> These are needed.
> Actually, we have applied it for Exynos internally.
> But I can't make sure that other host can apply it with the same way.
> It is a good chance that we can find out implementation of other host based on Synopsys.
As i mentioned, these are used at Exynos.
But i think that we need to add the code like this for supporting Exynos.
Thank you for comment.

Best regards,
Jaehoon Chung
> 
>>
>> Thanks for comments.
>>
>> Best Regards,
>> Jaehoon Chung
>>>
>>>> +       void (*set_clk_drv_sample)(struct dw_mci *host, struct mmc_ios *ios);
>>>> +
>>>>  };
>>>>
>>>>  #endif /* LINUX_MMC_DW_MMC_H */
>>>> --
>>>> 1.7.4.1
>>>> --
>>>> 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
>>> --
>>> 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
>>>
>>
>> --
>> 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
> 
> --
> 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
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-08-24  5:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-23 11:31 [PATCH 3/5] mmc: dw-mmc: add the platdata related with clock Jaehoon Chung
2012-08-23 12:10 ` Will Newton
2012-08-23 12:18   ` Jaehoon Chung
2012-08-24  4:03     ` Seungwon Jeon
2012-08-24  5:03       ` Jaehoon Chung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox