summaryrefslogtreecommitdiff
path: root/kernel_g1_unifi105x_2.6.29.patch
blob: 445fbd4165b9d9800c2ec1067e9c368bece649ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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);