From: Jaehoon Chung <jh80.chung@samsung.com>
To: Seungwon Jeon <tgih.jun@samsung.com>,
'Jaehoon Chung' <jh80.chung@samsung.com>,
linux-mmc@vger.kernel.org
Cc: chris@printf.net, ulf.hansson@linaro.org,
ludovic.desroches@atmel.com, devicetree@vger.kernel.org,
linux-samsung-soc@vger.kernel.org, cpgs@samsung.com
Subject: Re: [PATCHv2 2/3] mmc: dw_mmc: use the __mmc_of_parse to parse the slot node
Date: Tue, 27 May 2014 19:07:37 +0900 [thread overview]
Message-ID: <538463E9.30804@samsung.com> (raw)
In-Reply-To: <002e01cf7990$ea98aec0$bfca0c40$%jun@samsung.com>
Hi, Seungwon
On 05/27/2014 06:49 PM, Seungwon Jeon wrote:
> Hi Jaehoon,
>
> On Mon, May 26, 2014, Jaehoon Chung wrote:
>> dw-mmc controller have the multiple slot.
> Have -> has?
Fix it.
>
>> Then it needs to parse the property for each slot.
>>
>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>> ---
>> Changelog V2:
>> - None
>>
>> drivers/mmc/host/dw_mmc.c | 25 ++++++-------------------
>> 1 file changed, 6 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>> index 1ac227c..d4800f8 100644
>> --- a/drivers/mmc/host/dw_mmc.c
>> +++ b/drivers/mmc/host/dw_mmc.c
>> @@ -1015,12 +1015,11 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
>> {
>> int present;
>> struct dw_mci_slot *slot = mmc_priv(mmc);
>> - struct dw_mci_board *brd = slot->host->pdata;
>> struct dw_mci *host = slot->host;
>> int gpio_cd = mmc_gpio_get_cd(mmc);
>>
>> /* Use platform get_cd function, else try onboard card detect */
>> - if (brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
>> + if (slot->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
>> present = 1;
>> else if (!IS_ERR_VALUE(gpio_cd))
>> present = gpio_cd;
>> @@ -2010,6 +2009,9 @@ static struct dw_mci_of_slot_quirks {
>> {
>> .quirk = "disable-wp",
>> .id = DW_MCI_SLOT_QUIRK_NO_WRITE_PROTECT,
>> + }, {
>> + .quirk = "broken-cd",
>> + .id = DW_MCI_QUIRK_BROKEN_CARD_DETECTION,
>> },
>> };
>>
>> @@ -2088,7 +2090,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
>> if (host->pdata->caps2)
>> mmc->caps2 = host->pdata->caps2;
>>
>> - mmc_of_parse(mmc);
>> + __mmc_of_parse(mmc, dw_mci_of_find_slot_node(host->dev, slot->id));
>>
>> if (host->pdata->blk_settings) {
>> mmc->max_segs = host->pdata->blk_settings->max_segs;
>> @@ -2231,23 +2233,13 @@ static inline bool dw_mci_ctrl_all_reset(struct dw_mci *host)
>> }
>>
>> #ifdef CONFIG_OF
>> -static struct dw_mci_of_quirks {
>> - char *quirk;
>> - int id;
>> -} of_quirks[] = {
>> - {
>> - .quirk = "broken-cd",
>> - .id = DW_MCI_QUIRK_BROKEN_CARD_DETECTION,
>> - },
>> -};
>> -
> Moving broken-cd to slot_quirks is reasonable.
> But I think of_quirks should be kept and we can add right quirks.
> In cae of DW_MCI_QUIRK_IDMAC_DTO and DW_MCI_QUIRK_RETRY_DELAY,
> we can handle those with dw_mci_of_quirks although we didn't add.
Ok.
Best Regards,
Jaehoon Chung
>
>> static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
>> {
>> struct dw_mci_board *pdata;
>> struct device *dev = host->dev;
>> struct device_node *np = dev->of_node;
>> const struct dw_mci_drv_data *drv_data = host->drv_data;
>> - int idx, ret;
>> + int ret;
>> u32 clock_frequency;
>>
>> pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
>> @@ -2264,11 +2256,6 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
>> pdata->num_slots = 1;
>> }
>>
>> - /* get quirks */
>> - for (idx = 0; idx < ARRAY_SIZE(of_quirks); idx++)
>> - if (of_get_property(np, of_quirks[idx].quirk, NULL))
>> - pdata->quirks |= of_quirks[idx].id;
>> -
> Same as above.
>
> Thanks,
> Seungwon Jeon
>
>> if (of_property_read_u32(np, "fifo-depth", &pdata->fifo_depth))
>> dev_info(dev, "fifo-depth property not found, using "
>> "value of FIFOTH register as default\n");
>> --
>> 1.7.9.5
>>
>> --
>> 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
>
next prev parent reply other threads:[~2014-05-27 10:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-26 11:35 [PATCHv2 0/3] mmc: fixed the mmc_of_parse for dwmmc Jaehoon Chung
2014-05-26 11:35 ` [PATCHv2 1/3] mmc: host: add slot argument to mmc_of_parse Jaehoon Chung
2014-05-26 14:37 ` Ulf Hansson
2014-05-27 9:48 ` Seungwon Jeon
2014-05-26 11:35 ` [PATCHv2 2/3] mmc: dw_mmc: use the __mmc_of_parse to parse the slot node Jaehoon Chung
2014-05-27 9:49 ` Seungwon Jeon
2014-05-27 10:07 ` Jaehoon Chung [this message]
2014-05-26 11:35 ` [PATCHv2 3/3] ARM: dts: replace the broken-cd property into slot node for dwmmc Jaehoon Chung
2014-05-27 9:49 ` Seungwon Jeon
2014-05-27 10:08 ` Jaehoon Chung
2014-05-27 10:38 ` Ulf Hansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=538463E9.30804@samsung.com \
--to=jh80.chung@samsung.com \
--cc=chris@printf.net \
--cc=cpgs@samsung.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=ludovic.desroches@atmel.com \
--cc=tgih.jun@samsung.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).