/* bring MCI specific stuff over from our MFD platform data */
glamo_mci_def_pdata.glamo_set_mci_power =
glamo->pdata->glamo_set_mci_power;
+ glamo_mci_def_pdata.glamo_mci_use_slow =
+ glamo->pdata->glamo_mci_use_slow;
glamo_mci_def_pdata.glamo_irq_is_wired =
glamo->pdata->glamo_irq_is_wired;
glamo_mci_def_pdata.mci_suspending =
unsigned long ocr_avail;
void (*glamo_set_mci_power)(unsigned char power_mode,
unsigned short vdd);
+ /* glamo-mci asking if it should use the slow clock to card */
+ int (*glamo_mci_use_slow)(void);
int (*glamo_irq_is_wired)(void);
void (*mci_suspending)(struct platform_device *dev);
int (*mci_all_dependencies_resumed)(struct platform_device
module_param(sd_max_clk, int, 0644);
/*
+ * Slow SD clock rate
+ *
+ * you can override this on kernel commandline using
+ *
+ * glamo_mci.sd_slow_ratio=8
+ *
+ * for example
+ *
+ * platform callback is used to decide effective clock rate, if not
+ * defined then max is used, if defined and returns nonzero, rate is
+ * divided by this factor
+ */
+
+static int sd_slow_ratio = 8;
+module_param(sd_slow_ratio, int, 0644);
+
+/*
* SD Signal drive strength
*
* you can override this on kernel commandline using
cmd->opcode, cmd->arg, cmd->data, cmd->mrq->stop,
cmd->flags);
- /* resume requested clock rate */
- __glamo_mci_fix_card_div(host, host->clk_div);
+ /* resume requested clock rate
+ * scale it down by sd_slow_ratio if platform requests it
+ */
+ if (host->pdata->glamo_mci_use_slow)
+ if ((host->pdata->glamo_mci_use_slow)())
+ __glamo_mci_fix_card_div(host, host->clk_div *
+ sd_slow_ratio);
+ else
+ __glamo_mci_fix_card_div(host, host->clk_div);
+ else
+ __glamo_mci_fix_card_div(host, host->clk_div);
if (glamo_mci_send_command(host, cmd))
goto bail;
/* glamo mmc platform specific info */
void (*glamo_set_mci_power)(unsigned char power_mode,
unsigned short vdd);
+ /* glamo-mci asking if it should use the slow clock to card */
+ int (*glamo_mci_use_slow)(void);
int (*glamo_irq_is_wired)(void);
void (*mci_suspending)(struct platform_device *dev);
int (*mci_all_dependencies_resumed)(struct platform_device