public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Preparations for ASIC3 support in the TMIO MMC driver
@ 2009-05-25 19:27 Philipp Zabel
  2009-05-25 19:27 ` [PATCH 1/5] MFD,mmc: tmio_mmc: make HCLK configurable Philipp Zabel
                   ` (4 more replies)
  0 siblings, 5 replies; 24+ messages in thread
From: Philipp Zabel @ 2009-05-25 19:27 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ian Molton

Hi,

this series is really only two parts preparation for ASIC3:
 [PATCH 1/5] MFD,mmc: tmio_mmc: make HCLK configurable
 [PATCH 2/5] mmc: tmio_mmc: add bus_shift support
and three parts cleanup:
 [PATCH 3/5] mmc: tmio_mmc: don't use set_irq_type
 [PATCH 4/5] mmc: tmio_mmc: correct probe return value for num_resources != 3
 [PATCH 5/5] mmc: tmio_mmc: move probe function into __init section

I have still a few remaining differences until tmio_mmc can support ASIC3,
but as patch 2/5 causes changes all over the place, I'd like to get feedback
on that before piling patches on top of it.

I also have a question about the clock divider settings. Currently,
tmio_mmc_set_clock returns the wrong divider setting for new_clock=f_min
(0x40 instead of 0x80). I tried to fix it like below:

+#define TMIO_CARD_CLOCK_ENABLE 0x0100
+#define TMIO_CARD_CLOCK_FOR_SD 0x8000
+
-static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
+static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 {
        u32 clk = 0, clock;
 
        if (new_clock) {
                for (clock = host->mmc->f_min, clk = 0x100; new_clock >= (clock<<1); ) {
                        clock <<= 1;
                        clk >>= 1;
                }
-               if (clk & 0x1)
-                       clk = 0x20000;
+               /* For fastest speed we disable the divider. */
+               sd_config_write8(host, CNF_SD_CLK_MODE, (clk == 0) ? 0 : 1);
+               clk >>= 1;
 
-               clk >>= 2;
-               sd_config_write8(host, CNF_SD_CLK_MODE, (clk & 0x8000) ? 0 : 1);
-               clk |= 0x100;
+               clk |= host->clock_for_sd | TMIO_CARD_CLOCK_ENABLE;
        }
 
        sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, clk);

But the ASIC3 code was handling the 0x8000 bit (called FOR_SD in the ASIC3 headers)
of CTL_SD_CARD_CLK_CTL differently - there it was enabled/disabled based on 1-bit
or 4-bit MMC mode. I have no idea what it is good for - is there any TMIO documentation
available that includes this information?

regards
Philipp

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2009-06-03 20:29 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-25 19:27 [PATCH 0/6] Preparations for ASIC3 support in the TMIO MMC driver Philipp Zabel
2009-05-25 19:27 ` [PATCH 1/5] MFD,mmc: tmio_mmc: make HCLK configurable Philipp Zabel
2009-05-29 11:20   ` Samuel Ortiz
2009-05-29 12:36     ` Pierre Ossman
2009-05-30  9:59   ` Ian molton
2009-05-30 11:40     ` pHilipp Zabel
2009-05-30 11:56       ` Ian Molton
2009-05-25 19:27 ` [PATCH 2/5] mmc: tmio_mmc: add bus_shift support Philipp Zabel
2009-05-26 20:16   ` pHilipp Zabel
2009-05-26 21:13     ` Ian molton
2009-05-30 10:36     ` Ian molton
2009-05-30 11:45       ` pHilipp Zabel
2009-05-30 10:26   ` Ian molton
2009-05-30 11:46     ` pHilipp Zabel
2009-06-03 20:28       ` Pierre Ossman
2009-05-25 19:27 ` [PATCH 3/5] mmc: tmio_mmc: don't use set_irq_type Philipp Zabel
2009-05-30 10:34   ` Ian molton
2009-06-03 20:29     ` Pierre Ossman
2009-05-25 19:28 ` [PATCH 4/5] mmc: tmio_mmc: correct probe return value for num_resources != 3 Philipp Zabel
2009-05-30 11:28   ` Ian molton
2009-05-25 19:28 ` [PATCH 5/5] mmc: tmio_mmc: move probe function into __init section Philipp Zabel
2009-05-27 20:21   ` Pierre Ossman
2009-05-30 11:36   ` Ian molton
2009-05-30 11:47     ` pHilipp Zabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox