Re: [PATCH] cw1200: fix some obvious mistakes

From: Solomon Peachy
Date: Wed Jun 05 2013 - 00:08:35 EST

On Mon, Jun 03, 2013 at 10:40:42AM +0200, Arnd Bergmann wrote:
> It's much better than what you have today, but not ideal because it
> means the driver cannot be a loadable module any more.

At least not when being built with platform data, anyway.

I suppose the next step here is to define some devicetree mappings for
this device.

> At least it's not in a released kernel yet.

Given the boneheaded buffer overflow bug that was just pointed out (and
fixed), I'm glad it's getting a lot more scrutiny.

> Regarding a long-term solution, I think what we should do here is to
> move the reset logic into the SDIO framework itself: We have similar
> requirements even for eMMC and SD cards, where you need to provide
> the correct voltage to a device on the MMC port in order for it to
> work. Today this is supported to a varying degree on the MMC controller
> level, where we hook into various frameworks (clk, reset-controller,
> regulator, gpio, pinctrl, power domain) based on platformm data or
> device tree information on the controller node.

If I understand you correctly, the "traditional" platform data -- power
supply, clock source, and gpio (ie POWERUP, RESET) lines would be
brought up using this mechanism, in order to get the device to attach to
the SDIO bus. One wrinkle here is that the cw1200 has some minimum
timing requirements between when each of those signals are brought up; I
don't know if there's a way to encode that into the devicetree.

But that's only half the equation.

Once the device has identified it to the SDIO bus and the driver's
probe() function is called, the other half of the platform data is
needed to successfully probe the hardware. Namely, the 'ref_clk' field.
This would need to be made available to the probe() call (eg via
func->dev.platform_data) but from what I can tell there's currently no
mechanism to make that connection.

Anyway, it's time for bed.

- Solomon
Solomon Peachy pizza at shaftnet dot org
Delray Beach, FL ^^ (email/xmpp) ^^
Quidquid latine dictum sit, altum viditur.

Attachment: pgp00000.pgp
Description: PGP signature