* mmc: dw_mmc: Add the function call for board-specific initialization.
@ 2011-07-04 7:07 Seungwon Jeon
2011-07-04 7:49 ` Kyungmin Park
2011-07-08 10:19 ` Will Newton
0 siblings, 2 replies; 6+ messages in thread
From: Seungwon Jeon @ 2011-07-04 7:07 UTC (permalink / raw)
To: linux-mmc
Cc: Chris Ball, Will Newton, Jaehoon Chung, Kyungmin Park,
James Hogan, Seungwon Jeon
Need to call init() function of dw_mci_board.
It seems to be omitted to call this function.
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
---
drivers/mmc/host/dw_mmc.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index a524416..688d58a 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1585,6 +1585,15 @@ static void dw_mci_work_routine_card(struct work_struct *work)
}
}
+static irqreturn_t dw_mci_detect_interrupt(int irq, void *dev_id)
+{
+ struct dw_mci_slot *slot = dev_id;
+
+ queue_work(dw_mci_card_workqueue, &slot->host->card_work);
+
+ return IRQ_HANDLED;
+}
+
static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id)
{
struct mmc_host *mmc;
@@ -1657,6 +1666,8 @@ static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id)
} else
regulator_enable(host->vmmc);
+ host->pdata->init(id, dw_mci_detect_interrupt, host);
+
if (dw_mci_get_cd(mmc))
set_bit(DW_MMC_CARD_PRESENT, &slot->flags);
else
--
1.7.0.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: mmc: dw_mmc: Add the function call for board-specific initialization.
2011-07-04 7:07 mmc: dw_mmc: Add the function call for board-specific initialization Seungwon Jeon
@ 2011-07-04 7:49 ` Kyungmin Park
2011-07-04 8:37 ` 전승원
2011-07-08 10:19 ` Will Newton
1 sibling, 1 reply; 6+ messages in thread
From: Kyungmin Park @ 2011-07-04 7:49 UTC (permalink / raw)
To: Seungwon Jeon
Cc: linux-mmc, Chris Ball, Will Newton, Jaehoon Chung, James Hogan
Hi,
Yes it's defined and checked, but not used.
Can you describe the reason why init call is required?
and If required, what's the meaning?
Thank you,
Kyungmin Park
On Mon, Jul 4, 2011 at 4:07 PM, Seungwon Jeon <tgih.jun@samsung.com> wrote:
> Need to call init() function of dw_mci_board.
> It seems to be omitted to call this function.
>
> Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
> ---
> drivers/mmc/host/dw_mmc.c | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index a524416..688d58a 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -1585,6 +1585,15 @@ static void dw_mci_work_routine_card(struct work_struct *work)
> }
> }
>
> +static irqreturn_t dw_mci_detect_interrupt(int irq, void *dev_id)
> +{
> + struct dw_mci_slot *slot = dev_id;
> +
> + queue_work(dw_mci_card_workqueue, &slot->host->card_work);
> +
> + return IRQ_HANDLED;
> +}
> +
> static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id)
> {
> struct mmc_host *mmc;
> @@ -1657,6 +1666,8 @@ static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id)
> } else
> regulator_enable(host->vmmc);
>
> + host->pdata->init(id, dw_mci_detect_interrupt, host);
> +
> if (dw_mci_get_cd(mmc))
> set_bit(DW_MMC_CARD_PRESENT, &slot->flags);
> else
> --
> 1.7.0.4
>
> --
> 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] 6+ messages in thread
* RE: mmc: dw_mmc: Add the function call for board-specific initialization.
2011-07-04 7:49 ` Kyungmin Park
@ 2011-07-04 8:37 ` 전승원
2011-07-08 7:25 ` Seungwon Jeon
0 siblings, 1 reply; 6+ messages in thread
From: 전승원 @ 2011-07-04 8:37 UTC (permalink / raw)
To: 'Kyungmin Park'
Cc: linux-mmc, 'Chris Ball', 'Will Newton',
'Jaehoon Chung', 'James Hogan'
Hi,
> -----Original Message-----
> From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> owner@vger.kernel.org] On Behalf Of Kyungmin Park
> Sent: Monday, July 04, 2011 4:50 PM
> To: Seungwon Jeon
> Cc: linux-mmc@vger.kernel.org; Chris Ball; Will Newton; Jaehoon Chung;
> James Hogan
> Subject: Re: mmc: dw_mmc: Add the function call for board-specific
> initialization.
>
> Hi,
>
> Yes it's defined and checked, but not used.
> Can you describe the reason why init call is required?
> and If required, what's the meaning?
I think some "board specific" init-routine may be needed, e.g. external IRQ for card detection.
But there is no call for this in dw_mmc.c currently.
If init function is just checked registration of definition and real call is performed outside,
we don't need to call this function explicitly.
Thank you for comment
Best regards,
Seungwon.
> Thank you,
> Kyungmin Park
>
> On Mon, Jul 4, 2011 at 4:07 PM, Seungwon Jeon <tgih.jun@samsung.com> wrote:
> > Need to call init() function of dw_mci_board.
> > It seems to be omitted to call this function.
> >
> > Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
> > ---
> > drivers/mmc/host/dw_mmc.c | 11 +++++++++++
> > 1 files changed, 11 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> > index a524416..688d58a 100644
> > --- a/drivers/mmc/host/dw_mmc.c
> > +++ b/drivers/mmc/host/dw_mmc.c
> > @@ -1585,6 +1585,15 @@ static void dw_mci_work_routine_card(struct
> work_struct *work)
> > }
> > }
> >
> > +static irqreturn_t dw_mci_detect_interrupt(int irq, void *dev_id)
> > +{
> > + struct dw_mci_slot *slot = dev_id;
> > +
> > + queue_work(dw_mci_card_workqueue, &slot->host->card_work);
> > +
> > + return IRQ_HANDLED;
> > +}
> > +
> > static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id)
> > {
> > struct mmc_host *mmc;
> > @@ -1657,6 +1666,8 @@ static int __init dw_mci_init_slot(struct dw_mci
> *host, unsigned int id)
> > } else
> > regulator_enable(host->vmmc);
> >
> > + host->pdata->init(id, dw_mci_detect_interrupt, host);
> > +
> > if (dw_mci_get_cd(mmc))
> > set_bit(DW_MMC_CARD_PRESENT, &slot->flags);
> > else
> > --
> > 1.7.0.4
> >
> > --
> > 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] 6+ messages in thread
* RE: mmc: dw_mmc: Add the function call for board-specific initialization.
2011-07-04 8:37 ` 전승원
@ 2011-07-08 7:25 ` Seungwon Jeon
2011-07-08 8:15 ` Kyungmin Park
0 siblings, 1 reply; 6+ messages in thread
From: Seungwon Jeon @ 2011-07-08 7:25 UTC (permalink / raw)
To: 'Kyungmin Park'
Cc: linux-mmc, 'Chris Ball', 'Will Newton',
'Jaehoon Chung', 'James Hogan'
Hi Kyungmin Park
I'd appreciate if you give me a opinion about my writing.
If init call is not used, a checking routine is also not needed.
How do you think?
Best regards,
Seungwon Jeon.
Seungwon Jeon wrote:
> Hi,
> > -----Original Message-----
> > From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> > owner@vger.kernel.org] On Behalf Of Kyungmin Park
> > Sent: Monday, July 04, 2011 4:50 PM
> > To: Seungwon Jeon
> > Cc: linux-mmc@vger.kernel.org; Chris Ball; Will Newton; Jaehoon Chung;
> > James Hogan
> > Subject: Re: mmc: dw_mmc: Add the function call for board-specific
> > initialization.
> >
> > Hi,
> >
> > Yes it's defined and checked, but not used.
> > Can you describe the reason why init call is required?
> > and If required, what's the meaning?
>
>
> I think some "board specific" init-routine may be needed, e.g. external
> IRQ for card detection.
> But there is no call for this in dw_mmc.c currently.
> If init function is just checked registration of definition and real call
> is performed outside,
> we don't need to call this function explicitly.
>
> Thank you for comment
>
> Best regards,
> Seungwon.
>
>
> > Thank you,
> > Kyungmin Park
> >
> > On Mon, Jul 4, 2011 at 4:07 PM, Seungwon Jeon <tgih.jun@samsung.com>
> wrote:
> > > Need to call init() function of dw_mci_board.
> > > It seems to be omitted to call this function.
> > >
> > > Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
> > > ---
> > > drivers/mmc/host/dw_mmc.c | 11 +++++++++++
> > > 1 files changed, 11 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> > > index a524416..688d58a 100644
> > > --- a/drivers/mmc/host/dw_mmc.c
> > > +++ b/drivers/mmc/host/dw_mmc.c
> > > @@ -1585,6 +1585,15 @@ static void dw_mci_work_routine_card(struct
> > work_struct *work)
> > > }
> > > }
> > >
> > > +static irqreturn_t dw_mci_detect_interrupt(int irq, void *dev_id)
> > > +{
> > > + struct dw_mci_slot *slot = dev_id;
> > > +
> > > + queue_work(dw_mci_card_workqueue, &slot->host->card_work);
> > > +
> > > + return IRQ_HANDLED;
> > > +}
> > > +
> > > static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int
> id)
> > > {
> > > struct mmc_host *mmc;
> > > @@ -1657,6 +1666,8 @@ static int __init dw_mci_init_slot(struct dw_mci
> > *host, unsigned int id)
> > > } else
> > > regulator_enable(host->vmmc);
> > >
> > > + host->pdata->init(id, dw_mci_detect_interrupt, host);
> > > +
> > > if (dw_mci_get_cd(mmc))
> > > set_bit(DW_MMC_CARD_PRESENT, &slot->flags);
> > > else
> > > --
> > > 1.7.0.4
> > >
> > > --
> > > 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] 6+ messages in thread
* Re: mmc: dw_mmc: Add the function call for board-specific initialization.
2011-07-08 7:25 ` Seungwon Jeon
@ 2011-07-08 8:15 ` Kyungmin Park
0 siblings, 0 replies; 6+ messages in thread
From: Kyungmin Park @ 2011-07-08 8:15 UTC (permalink / raw)
To: Seungwon Jeon
Cc: linux-mmc, Chris Ball, Will Newton, Jaehoon Chung, James Hogan
On Fri, Jul 8, 2011 at 4:25 PM, Seungwon Jeon <tgih.jun@samsung.com> wrote:
> Hi Kyungmin Park
>
> I'd appreciate if you give me a opinion about my writing.
> If init call is not used, a checking routine is also not needed.
> How do you think?
Agree, If there are no one use the pdata->init. no required to check it.
Thank you,
Kyungmin Park
>
> Seungwon Jeon wrote:
>> Hi,
>> > -----Original Message-----
>> > From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
>> > owner@vger.kernel.org] On Behalf Of Kyungmin Park
>> > Sent: Monday, July 04, 2011 4:50 PM
>> > To: Seungwon Jeon
>> > Cc: linux-mmc@vger.kernel.org; Chris Ball; Will Newton; Jaehoon Chung;
>> > James Hogan
>> > Subject: Re: mmc: dw_mmc: Add the function call for board-specific
>> > initialization.
>> >
>> > Hi,
>> >
>> > Yes it's defined and checked, but not used.
>> > Can you describe the reason why init call is required?
>> > and If required, what's the meaning?
>>
>>
>> I think some "board specific" init-routine may be needed, e.g. external
>> IRQ for card detection.
>> But there is no call for this in dw_mmc.c currently.
>> If init function is just checked registration of definition and real call
>> is performed outside,
>> we don't need to call this function explicitly.
>>
>> Thank you for comment
>>
>> Best regards,
>> Seungwon.
>>
>>
>> > Thank you,
>> > Kyungmin Park
>> >
>> > On Mon, Jul 4, 2011 at 4:07 PM, Seungwon Jeon <tgih.jun@samsung.com>
>> wrote:
>> > > Need to call init() function of dw_mci_board.
>> > > It seems to be omitted to call this function.
>> > >
>> > > Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
>> > > ---
>> > > drivers/mmc/host/dw_mmc.c | 11 +++++++++++
>> > > 1 files changed, 11 insertions(+), 0 deletions(-)
>> > >
>> > > diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>> > > index a524416..688d58a 100644
>> > > --- a/drivers/mmc/host/dw_mmc.c
>> > > +++ b/drivers/mmc/host/dw_mmc.c
>> > > @@ -1585,6 +1585,15 @@ static void dw_mci_work_routine_card(struct
>> > work_struct *work)
>> > > }
>> > > }
>> > >
>> > > +static irqreturn_t dw_mci_detect_interrupt(int irq, void *dev_id)
>> > > +{
>> > > + struct dw_mci_slot *slot = dev_id;
>> > > +
>> > > + queue_work(dw_mci_card_workqueue, &slot->host->card_work);
>> > > +
>> > > + return IRQ_HANDLED;
>> > > +}
>> > > +
>> > > static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int
>> id)
>> > > {
>> > > struct mmc_host *mmc;
>> > > @@ -1657,6 +1666,8 @@ static int __init dw_mci_init_slot(struct dw_mci
>> > *host, unsigned int id)
>> > > } else
>> > > regulator_enable(host->vmmc);
>> > >
>> > > + host->pdata->init(id, dw_mci_detect_interrupt, host);
>> > > +
>> > > if (dw_mci_get_cd(mmc))
>> > > set_bit(DW_MMC_CARD_PRESENT, &slot->flags);
>> > > else
>> > > --
>> > > 1.7.0.4
>> > >
>> > > --
>> > > 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] 6+ messages in thread
* Re: mmc: dw_mmc: Add the function call for board-specific initialization.
2011-07-04 7:07 mmc: dw_mmc: Add the function call for board-specific initialization Seungwon Jeon
2011-07-04 7:49 ` Kyungmin Park
@ 2011-07-08 10:19 ` Will Newton
1 sibling, 0 replies; 6+ messages in thread
From: Will Newton @ 2011-07-08 10:19 UTC (permalink / raw)
To: Seungwon Jeon
Cc: linux-mmc, Chris Ball, Jaehoon Chung, Kyungmin Park, James Hogan
On Mon, Jul 4, 2011 at 8:07 AM, Seungwon Jeon <tgih.jun@samsung.com> wrote:
> Need to call init() function of dw_mci_board.
> It seems to be omitted to call this function.
>
> Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
> ---
> drivers/mmc/host/dw_mmc.c | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index a524416..688d58a 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -1585,6 +1585,15 @@ static void dw_mci_work_routine_card(struct work_struct *work)
> }
> }
>
> +static irqreturn_t dw_mci_detect_interrupt(int irq, void *dev_id)
> +{
> + struct dw_mci_slot *slot = dev_id;
> +
> + queue_work(dw_mci_card_workqueue, &slot->host->card_work);
> +
> + return IRQ_HANDLED;
> +}
> +
> static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id)
> {
> struct mmc_host *mmc;
> @@ -1657,6 +1666,8 @@ static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id)
> } else
> regulator_enable(host->vmmc);
>
> + host->pdata->init(id, dw_mci_detect_interrupt, host);
> +
> if (dw_mci_get_cd(mmc))
> set_bit(DW_MMC_CARD_PRESENT, &slot->flags);
> else
> --
> 1.7.0.4
Sorry for the delay in replying.
I believe this patch does the correct thing (although for the boards I
have the init function is not defined). The comment I have in some
code here for the init function is:
/*
* Used to setup gpio based card detect interrupt handler
* on a per slot basis, we are using the modules built in
* card detect functionality, so do nothing (must be implemented).
*/
Although with the current GPIO layer irq handling I would have thought
we could setup a GPIO irq in the board setup code and pass the irq
number in directly. So form that point of view it may be better to
remove this init function entirely?
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-07-08 10:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-04 7:07 mmc: dw_mmc: Add the function call for board-specific initialization Seungwon Jeon
2011-07-04 7:49 ` Kyungmin Park
2011-07-04 8:37 ` 전승원
2011-07-08 7:25 ` Seungwon Jeon
2011-07-08 8:15 ` Kyungmin Park
2011-07-08 10:19 ` Will Newton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox