summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Chick <tim.chick@csr.com>2009-09-09 09:50:30 +0100
committerTim Chick <tim.chick@csr.com>2009-09-09 09:50:30 +0100
commit565aef987e8111994eff5215128e90bac74277e2 (patch)
treeab44a1fb22c6cab5e22964857e41e39a7916bb31
parent924a39a657016c46607ed35c3fbf83fac6b94a0f (diff)
downloadunifi-105x-565aef987e8111994eff5215128e90bac74277e2.tar.gz
Patch for the kernel to enable the driver, and also patch for G1HEADmaster
kernel to allow the chip to work.
-rw-r--r--kernel_g1_unifi105x_2.6.29.patch86
-rw-r--r--kernel_g1_unifi105x_2.6.29.patch.README18
2 files changed, 104 insertions, 0 deletions
diff --git a/kernel_g1_unifi105x_2.6.29.patch b/kernel_g1_unifi105x_2.6.29.patch
new file mode 100644
index 0000000..445fbd4
--- /dev/null
+++ b/kernel_g1_unifi105x_2.6.29.patch
@@ -0,0 +1,86 @@
+diff --git a/arch/arm/mach-msm/board-trout-mmc.c b/arch/arm/mach-msm/board-trout-mmc.c
+index 13755f5..0cb7f59 100644
+--- a/arch/arm/mach-msm/board-trout-mmc.c
++++ b/arch/arm/mach-msm/board-trout-mmc.c
+@@ -92,6 +92,7 @@ static struct mmc_vdd_xlat mmc_vdd_table[] = {
+ { MMC_VDD_27_28, 2750 },
+ { MMC_VDD_28_29, 2850 },
+ { MMC_VDD_29_30, 2950 },
++ { MMC_VDD_30_31, 2950 },
+ };
+
+ static unsigned int sdslot_vdd = 0xffffffff;
+@@ -162,7 +163,7 @@ static unsigned int trout_sdslot_status(struct device *dev)
+ #define TROUT_MMC_VDD MMC_VDD_165_195 | MMC_VDD_20_21 | MMC_VDD_21_22 \
+ | MMC_VDD_22_23 | MMC_VDD_23_24 | MMC_VDD_24_25 \
+ | MMC_VDD_25_26 | MMC_VDD_26_27 | MMC_VDD_27_28 \
+- | MMC_VDD_28_29 | MMC_VDD_29_30
++ | MMC_VDD_28_29 | MMC_VDD_29_30 | MMC_VDD_30_31
+
+ static struct mmc_platform_data trout_sdslot_data = {
+ .ocr_mask = TROUT_MMC_VDD,
+diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c
+index 630f0e1..b13b378 100755
+--- a/drivers/mmc/core/sdio_io.c
++++ b/drivers/mmc/core/sdio_io.c
+@@ -15,6 +15,7 @@
+ #include <linux/mmc/sdio_func.h>
+
+ #include "sdio_ops.h"
++#include "core.h"
+
+ /**
+ * sdio_claim_host - exclusively claim a bus for a certain SDIO function
+@@ -48,6 +49,15 @@ void sdio_release_host(struct sdio_func *func)
+ }
+ EXPORT_SYMBOL_GPL(sdio_release_host);
+
++void sdio_set_clock(struct sdio_func *func, unsigned int hz)
++{
++ BUG_ON(!func);
++ BUG_ON(!func->card);
++
++ mmc_set_clock(func->card->host, hz);
++}
++EXPORT_SYMBOL_GPL(sdio_set_clock);
++
+ /**
+ * sdio_enable_func - enables a SDIO function for usage
+ * @func: SDIO function to enable
+@@ -170,7 +180,7 @@ int sdio_set_block_size(struct sdio_func *func, unsigned blksz)
+ ret = mmc_io_rw_direct(func->card, 1, 0,
+ SDIO_FBR_BASE(func->num) + SDIO_FBR_BLKSIZE,
+ blksz & 0xff, NULL);
+- if (ret)
++ if (ret && (ret != -ERANGE))
+ return ret;
+ ret = mmc_io_rw_direct(func->card, 1, 0,
+ SDIO_FBR_BASE(func->num) + SDIO_FBR_BLKSIZE + 1,
+@@ -657,12 +667,13 @@ void sdio_f0_writeb(struct sdio_func *func, unsigned char b, unsigned int addr,
+
+ BUG_ON(!func);
+
++#if 0
+ if (addr < 0xF0 || addr > 0xFF) {
+ if (err_ret)
+ *err_ret = -EINVAL;
+ return;
+ }
+-
++#endif
+ ret = mmc_io_rw_direct(func->card, 1, 0, addr, b, NULL);
+ if (err_ret)
+ *err_ret = ret;
+diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h
+index d8c80b1..95b84e7 100755
+--- a/include/linux/mmc/sdio_func.h
++++ b/include/linux/mmc/sdio_func.h
+@@ -122,6 +122,8 @@ extern void sdio_unregister_driver(struct sdio_driver *);
+ extern void sdio_claim_host(struct sdio_func *func);
+ extern void sdio_release_host(struct sdio_func *func);
+
++extern void sdio_set_clock(struct sdio_func *func, unsigned int hz);
++
+ extern int sdio_enable_func(struct sdio_func *func);
+ extern int sdio_disable_func(struct sdio_func *func);
+
diff --git a/kernel_g1_unifi105x_2.6.29.patch.README b/kernel_g1_unifi105x_2.6.29.patch.README
new file mode 100644
index 0000000..ec54fbc
--- /dev/null
+++ b/kernel_g1_unifi105x_2.6.29.patch.README
@@ -0,0 +1,18 @@
+There are two sets of patches. One only needs to be applied to work with the
+HTC G1/Dream
+
+This is the patch: arch/arm/mach-msm/board-trout-mmc.c
+
+It means the mmc driver will claim to support 3.0-3.1V, even though the
+hardware does not support this. This is required as UF105x claims to require
+3.0-3.4V in it's CCR, even though it does not actually need this. It should
+only be applied to get a UF105x to work, as it essenitally breaks the SDIO spec
+on the slot, and may cause a device which really needs 3.0-3.1V to malfunction.
+
+The other patches allow the driver to change the clock speed of a slot, fix a
+bug with setting the block size, and also allow a driver to write to the
+"protected" registers in FN0 of a card.
+
+All of these changes can be applied without impacting the normal functionality
+of the mmc stack.
+