public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: chaotian.jing@mediatek.com (chaotian.jing)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/5] mmc: mediatek: Add Mediatek MMC driver
Date: Wed, 8 Apr 2015 14:39:19 +0800	[thread overview]
Message-ID: <1428475159.15142.3.camel@mhfsdcap03> (raw)
In-Reply-To: <CABuKBe+MFHJO8GXRg5KYs2t+j6U4Ynv_hCeW0YQCrS_eZ-fuLA@mail.gmail.com>

Dear Matthias,

Thanks for your review!
Please help to check my comment.
On Tue, 2015-04-07 at 16:01 +0200, Matthias Brugger wrote:
> 2015-03-17 4:13 GMT+01:00 Chaotian Jing <chaotian.jing@mediatek.com>:
> > Add Mediatek MMC driver code
> >
> > Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
> > ---
> >  drivers/mmc/host/Kconfig  |    8 +
> >  drivers/mmc/host/Makefile |    1 +
> >  drivers/mmc/host/mtk-sd.c | 1412 +++++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 1421 insertions(+)
> >  create mode 100644 drivers/mmc/host/mtk-sd.c
> >
> > diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
> > index 61ac63a..8b64377 100644
> > --- a/drivers/mmc/host/Kconfig
> > +++ b/drivers/mmc/host/Kconfig
> > @@ -768,3 +768,11 @@ config MMC_TOSHIBA_PCI
> >         tristate "Toshiba Type A SD/MMC Card Interface Driver"
> >         depends on PCI
> >         help
> > +
> > +config MMC_MTK
> > +       tristate "MediaTek SD/MMC Card Interface support"
> > +       help
> > +         This selects the MediaTek(R) Secure digital and Multimedia card Interface.
> > +         If you have a machine with a integrated SD/MMC card reader, say Y or M here.
> > +         This is needed if support for any SD/SDIO/MMC devices is required.
> > +         If unsure, say N.
> > diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile
> > index 6a7cfe0..161b3e4 100644
> > --- a/drivers/mmc/host/Makefile
> > +++ b/drivers/mmc/host/Makefile
> > @@ -20,6 +20,7 @@ obj-$(CONFIG_MMC_SDHCI_F_SDH30)       += sdhci_f_sdh30.o
> >  obj-$(CONFIG_MMC_SDHCI_SPEAR)  += sdhci-spear.o
> >  obj-$(CONFIG_MMC_WBSD)         += wbsd.o
> >  obj-$(CONFIG_MMC_AU1X)         += au1xmmc.o
> > +obj-$(CONFIG_MMC_MTK)           += mtk-sd.o
> >  obj-$(CONFIG_MMC_OMAP)         += omap.o
> >  obj-$(CONFIG_MMC_OMAP_HS)      += omap_hsmmc.o
> >  obj-$(CONFIG_MMC_ATMELMCI)     += atmel-mci.o
> > diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> > new file mode 100644
> > index 0000000..86c999b
> > --- /dev/null
> > +++ b/drivers/mmc/host/mtk-sd.c
> > @@ -0,0 +1,1412 @@
> > +/*
> > + * Copyright (c) 2014-2015 MediaTek Inc.
> > + * Author: Chaotian.Jing <chaotian.jing@mediatek.com>
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + */
> > +
> > +#include <linux/clk.h>
> > +#include <linux/delay.h>
> > +#include <linux/dma-mapping.h>
> > +#include <linux/ioport.h>
> > +#include <linux/irq.h>
> > +#include <linux/of_address.h>
> > +#include <linux/of_irq.h>
> > +#include <linux/of_gpio.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/regulator/consumer.h>
> > +#include <linux/spinlock.h>
> > +
> > +#include <linux/mmc/card.h>
> > +#include <linux/mmc/core.h>
> > +#include <linux/mmc/host.h>
> > +#include <linux/mmc/mmc.h>
> > +#include <linux/mmc/sd.h>
> > +#include <linux/mmc/sdio.h>
> > +
> > +#define MAX_GPD_NUM         (1 + 1)    /* one null gpd */
> > +#define MAX_BD_NUM          1024
> > +#define MAX_BD_PER_GPD      MAX_BD_NUM
> 
> This looks strange.
> Why don't you define MAX_GPD_NUM as two?
> Why do you define MAX_BD_PER_GPD when it is the same as MAX_BD_NUM?
> 
In fact, the second GPD is useless now, I will remove the define of
MAX_GPD_NUM and MAX_BD_PER_GPD.

> Cheers,
> Matthias
> 

  reply	other threads:[~2015-04-08  6:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17  3:13 [PATCH v2 0/5] Add Mediatek MMC driver Chaotian Jing
2015-03-17  3:13 ` [PATCH v2 1/5] mmc: dt-bindings: add Mediatek MMC bindings Chaotian Jing
2015-04-20  8:31   ` Sascha Hauer
2015-03-17  3:13 ` [PATCH v2 2/5] mmc: mediatek: Add Mediatek MMC driver Chaotian Jing
2015-03-31 12:23   ` Ulf Hansson
2015-04-03  7:22     ` 答复: " Chaotian Jing (井朝天)
     [not found]       ` <CAPDyKFrM94E8xXN_q0OqciOHC8WBC+fTOroSnnm+HDTOmWg6Gw@mail.gmail.com>
2015-04-10  3:17         ` chaotian.jing
2015-04-17  9:12     ` Sascha Hauer
2015-04-17  9:37       ` Ulf Hansson
2015-04-07 14:01   ` Matthias Brugger
2015-04-08  6:39     ` chaotian.jing [this message]
2015-04-17 13:45   ` Sascha Hauer
2015-04-19  3:22     ` chaotian.jing
2015-03-17  3:13 ` [PATCH v2 3/5] mmc: mediatek: Add PM support for " Chaotian Jing
2015-03-31 14:46   ` Ulf Hansson
2015-04-03  8:27     ` 答复: " Chaotian Jing (井朝天)
2015-04-20  6:49   ` Sascha Hauer
2015-04-20  6:52   ` Sascha Hauer
2015-03-17  3:13 ` [PATCH v2 4/5] arm64: mediatek: Add Mediatek MMC support in defconfig Chaotian Jing
2015-03-17  3:13 ` [PATCH v2 5/5] arm64: dts: mediatek: Add MT8173 MMC dts Chaotian Jing

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=1428475159.15142.3.camel@mhfsdcap03 \
    --to=chaotian.jing@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.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