On Sat, May 15, 2010 at 3:02 AM, Dmitry Shmidt <[email protected]> wrote:
> Hi Andrew,
>
> wl1251 has some HW problem for ELP register that demands to do
> something like "write during read" in order
> not to loose bits from this register during simple read.
> Fortunately it was enough just to add low 8 bits previous register
> value to the cmd.args during read operation
> and SD Controller will behave as needed. And it was tested on real
> wl1251 device that is used in G1 and MyTouch.
>
> However, patch author for some reason is using WRITE operation instead of 
> READ.
>>>> ret = mmc_io_rw_direct(func->card, 1, func->num, addr, b, &val);
>>>> 1 means WRITE
>
> Maybe in case of wl1251 HW it is not important - to write during read,
> or to read during write, but the problem in wl1251 was during ELP
> register READ operation, so I do not understand why author used WRITE
> flag.

Well like you said, 'wl1251 [...] demands to do something like "write
during read"', and SDIO spec provides exactly this functionality with
the RAW flag (quoting SDIO spec):

"If this bit [RAW] is set to 1 and the R/W flag is set to 1, then the
command shall read the value of the register after the write. This is
useful to allow writing to a control register and reading the status
at the same address."

If you pass WRITE flag and a pointer for read value to
mmc_io_rw_direct(), it sets the R/W and RAW bits in the CMD52 request.
According to my tests wl1251 actually ignores both R/W and RAW flags,
but by the looks of it it is expecting the RAW request. With my patch
we can add a function that both conforms the SDIO spec and suits
wl1251 hardware.

Does that make sense to you?
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to