[PATCH 1/2] glamo-platform-mmc.patch

Werner Almesberger werner at openmoko.org
Mon Jan 21 02:30:30 CET 2008

warmcat wrote:
>  - add two platform APIs for Glamo MMC, to set power and check if IRQ used

Thanks ! I've simplified and (hopefully :-) corrected the voltage
calculation a little bit. It did the equivalent of

if (vdd < 23)
	mv = 1650+300+100*(vdd-8);
	mv = 3500;

So, it would yield

vdd = 22	mv = 3350
vdd = 23	mv = 3500
vdd = 24	mv = 3500

I think you meant to just cap it at 3.5V, so it would be

vdd = 22	mv = 3350
vdd = 23	mv = 3450
vdd = 24	mv = 3500

Correct ?

I'm not entirely sure about the voltages you've chosen.
include/linux/mmc/host.h says, for example

#define MMC_VDD_20_21           0x00000100      /* VDD voltage 2.0 ~ 2.1 */

yet, with vdd = 8, we only get 1950mV. Is this intentional or should
we add 50-100mV to the above formula ?

Oh, and I just found a major blooper in the voltage calculation in
the GTA01 code ...

I've backed out the glamo_irq_demux_handler IRQ_GLAMO fix, since it's
already in our tree. By the way, "IRQ_GLAMO(0) + i" is equivalent to
"IRQ_GLAMO(i)", right ?


Much nicer :-) I wish we could do this with fewer items scattered
all over various structures, though. I've simplified the irq_works
logic a bit, mainly to make sure we always initialize the field.

Minor coding style nitpicking: function-local variable declarations
should be followed by a blank line.

Also, in the Glamo code, the name "GTA-02" crept in, which should
be GTA02.

Please check if I got everything right. It seems that your patch was
made against an old code base, so there were a number of conflicts I
had to fix. I hope I found all of them, but you never know ...

- Werner

More information about the openmoko-kernel mailing list