devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Rajendra Nayak <rnayak@ti.com>
Cc: cjb@laptop.org, balajitk@ti.com,
	devicetree-discuss@lists.ozlabs.org, linux-mmc@vger.kernel.org,
	rob.herring@calxeda.com, grant.likely@secretlab.ca,
	thomas.abraham@linaro.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/4] mmc: omap: adapt the hsmmc driver to device tree
Date: Fri, 18 Nov 2011 16:21:40 -0800	[thread overview]
Message-ID: <20111119002140.GX31337@atomide.com> (raw)
In-Reply-To: <4EC1E757.2000308@ti.com>

* Rajendra Nayak <rnayak@ti.com> [111114 19:40]:
> On Tuesday 15 November 2011 03:00 AM, Tony Lindgren wrote:
> >* Rajendra Nayak<rnayak@ti.com>  [111104 04:16]:
> >>@@ -1869,6 +1957,14 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
> >>  	struct omap_hsmmc_host *host = NULL;
> >>  	struct resource *res;
> >>  	int ret, irq;
> >>+	const struct of_device_id *match;
> >>+
> >>+	match = of_match_device(omap_mmc_of_match,&pdev->dev);
> >>+	if (match) {
> >>+		pdata = of_get_hsmmc_pdata(&pdev->dev);
> >>+		if (match->data)
> >>+			pdata->reg_offset = *(u16 *)match->data;
> >>+	}
> >
> >So this is now using both DT and pdata?
> >
> >We want to use DT only, and get rid of pdata. Other than the
> >deferred probe, is there some other dependency remaining to
> >having to use the pdata also?
> 
> We are using pdata today mainly for the platform function pointers
> that get passed for MMC, which can never be passed from DT.
> 
> The  omap_mmc_platform_data structure today has '17' function pointers.
> Most might be sparingly used, nevertheless, its an awfully large number.

Yeah OK.
 
> Here's the list...
> ---------
> int (*switch_slot)(struct device *dev, int slot);
> int (*init)(struct device *dev);
> void (*cleanup)(struct device *dev);
> void (*shutdown)(struct device *dev);
> int (*suspend)(struct device *dev, int slot);
> int (*resume)(struct device *dev, int slot);
> int (*get_context_loss_count)(struct device *dev);
> 
> per-slot functions
> 
> int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
> int (*set_power)(struct device *dev, int slot,
>                                  int power_on, int vdd);
> int (*get_ro)(struct device *dev, int slot);
> int (*set_sleep)(struct device *dev, int slot, int sleep,
>                                  int vdd, int cardsleep);
> void (*remux)(struct device *dev, int slot, int power_on);
> void (*before_set_reg)(struct device *dev, int slot,
>                                        int power_on, int vdd);
> void (*after_set_reg)(struct device *dev, int slot,
>                                       int power_on, int vdd);
> void (*init_card)(struct mmc_card *card);
> int (*get_cover_state)(struct device *dev, int slot);
> int (*card_detect)(struct device *dev, int slot);
> ---------

To me it seems we should move these into drivers/mmc/host/omap_hsmmc.c
and set them based on DT compatible (or some other) property.

If these functions tinker with some internal registers, then we need
to fix those too to use regulator/gpio API.

This way we don't need the platform_data any longer.

Regards,

Tony

  reply	other threads:[~2011-11-19  0:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-04 11:50 [PATCH 0/4] omap hsmmc device tree support Rajendra Nayak
2011-11-04 11:50 ` [PATCH 1/4] mmc: Add additional binding for mmc host controller Rajendra Nayak
2011-11-04 19:58   ` Olof Johansson
2011-11-04 11:50 ` [PATCH 2/4] mmc: omap: adapt the hsmmc driver to device tree Rajendra Nayak
2011-11-04 20:04   ` Olof Johansson
2011-11-04 21:25     ` Cousson, Benoit
2011-11-04 21:28       ` Olof Johansson
2011-11-07  6:14       ` Rajendra Nayak
2011-11-04 22:15     ` Segher Boessenkool
2011-11-07  6:18     ` Rajendra Nayak
2011-11-14 21:30   ` Tony Lindgren
2011-11-15  4:15     ` Rajendra Nayak
2011-11-19  0:21       ` Tony Lindgren [this message]
2011-11-04 11:50 ` [PATCH 3/4] omap4: mmc: Pass SoC and board data for omap4 mmc from dt Rajendra Nayak
2011-11-04 11:50 ` [PATCH 4/4] omap4: mmc: use auxdata to pass platform function ptrs Rajendra Nayak

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=20111119002140.GX31337@atomide.com \
    --to=tony@atomide.com \
    --cc=balajitk@ti.com \
    --cc=cjb@laptop.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rnayak@ti.com \
    --cc=rob.herring@calxeda.com \
    --cc=thomas.abraham@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).