mmc-twl4030 patches for RX51
Subsystems (3)
cover mmc-twl4030 patches for RX51
Here are 6 patches for mmc-twl4030 for RX51.
PATCH 1/6 OMAP: mmc-twl4030 fix name buffer length
Quoted 1 line
From
60238a3a80b5be3e1843a049b39eabf729c315aaMon Sep 17 00:00:00 2001
From: Adrian Hunter <[email protected]>
Date: Thu, 22 Jan 2009 17:58:04 +0200
Subject: [PATCH] OMAP: mmc-twl4030 fix name buffer length
Add 1 to buffer length for null terminator.
--- arch/arm/mach-omap2/mmc-twl4030.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/mmc-twl4030.c +1 -1
@@ -61,7 +61,7 @@ static struct twl_mmc_controller {struct omap_mmc_platform_data *mmc;u8 twl_vmmc_dev_grp;u8 twl_mmc_dedicated; -char name[HSMMC_NAME_LEN ]; +char name[HSMMC_NAME_LEN +1 ]; } hsmmc[OMAP34XX_NR_MMC] = { { .twl_vmmc_dev_grp = VMMC1_DEV_GRP,
Signature · 1 line
1.5.6.3
Re: [PATCH 1/6] OMAP: mmc-twl4030 fix name buffer length
Quoted 8 lines · Adrian Hunter
Quoted 1 line
From
60238a3a80b5be3e1843a049b39eabf729c315aaMon Sep 17 00:00:00 2001From: Adrian Hunter <[email protected]>
Date: Thu, 22 Jan 2009 17:58:04 +0200
Subject: [PATCH] OMAP: mmc-twl4030 fix name buffer lengthAdd 1 to buffer length for null terminator.
Signed-off-by Adrian Hunter <[email protected]>
An endless off-by-one bug ...
Quoted 21 lines
--- arch/arm/mach-omap2/mmc-twl4030.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/arm/mach-omap2/mmc-twl4030.c +1
-1@@ -61,7 +61,7 @@ static struct twl_mmc_controller {struct omap_mmc_platform_data *mmc;u8 twl_vmmc_dev_grp;u8 twl_mmc_dedicated; -char name[HSMMC_NAME_LEN ]; +char name[HSMMC_NAME_LEN +1 ]; } hsmmc[OMAP34XX_NR_MMC] = { { .twl_vmmc_dev_grp = VMMC1_DEV_GRP,Signature · 1 line
1.5.6.3
Tony Lindgren
maintainer[APPLIED] <span class="quote">> [PATCH] OMAP: mmc-twl4030 fix name buffer length</span>
In reply to Adrian HunterThis patch has been applied to the linux-omap
by youw fwiendly patch wobot.
Commit: 9ed678812ff0a8c42884ce5179b0ac34e3d0c995
PatchWorks
http://patchwork.kernel.org/patch/10840/
PATCH 2/6 OMAP: mmc-twl4030 support VSIM is VMMC2_IO
In reply to Adrian HunterQuoted 1 line
From
2f6a22e9091a09fb3cbb720356116035611636b2Mon Sep 17 00:00:00 2001
From: Adrian Hunter <[email protected]>
Date: Fri, 23 Jan 2009 11:45:49 +0200
Subject: [PATCH] OMAP: mmc-twl4030 support VSIM is VMMC2_IO
eMMC has two voltage lines, one for I/O and one for the NAND core. This patch allows VSIM and VMMC2 respectively, to be used for those two.
--- arch/arm/mach-omap2/mmc-twl4030.c | 25 ++++++++++++++++++++++++- arch/arm/mach-omap2/mmc-twl4030.h | 1 + 2 files changed, 25 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/mmc-twl4030.c +24 -1
@@ -52,6 +52,10 @@#define VMMC_DEV_GRP_P1 0x20 +#define VSIM_DEV_GRP 0x37 +#define VSIM_18V 0x03 +#define VSIM_DEDICATED 0x3A +static u16 control_pbias_offset;static u16 control_devconf1_offset;
@@ -61,6 +65,7 @@ static struct twl_mmc_controller {struct omap_mmc_platform_data *mmc;u8 twl_vmmc_dev_grp;u8 twl_mmc_dedicated; +bool vsim_18v;char name[HSMMC_NAME_LEN +1 ]; } hsmmc[OMAP34XX_NR_MMC] = { {
@@ -251,6 +256,19 @@ doit: ret =twl4030_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER , vmmc, c->twl_mmc_dedicated); +if (ret) +return ret; + +if (c->vsim_18v) { +u8 vsim = vmmc ?VSIM_18V :0 ; + + ret =twl4030_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER , + dev_grp_val,VSIM_DEV_GRP ); +if (ret) +return ret; + ret =twl4030_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER , + vsim,VSIM_DEDICATED ); + }return ret; }
@@ -437,7 +455,12 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) mmc->slots[0 ].set_power = twl_mmc2_set_power;if (c->transceiver) mmc->slots[0 ].ocr_mask =MMC2_OCR ; -else +else if (c->vsim_18v) { + mmc->slots[0 ].ocr_mask =MMC_VDD_27_28 | +MMC_VDD_28_29 |MMC_VDD_29_30 | +MMC_VDD_30_31 |MMC_VDD_31_32 ; + twl->vsim_18v = true; + }else mmc->slots[0 ].ocr_mask =MMC_VDD_165_195 ;break ;case 3 :
arch/arm/mach-omap2/mmc-twl4030.h +1 -0
@@ -11,6 +11,7 @@ struct twl4030_hsmmc_info {u8 wires;/* 1/4/8 wires */ bool transceiver;/* MMC-2 option */ bool ext_clock;/* use external pin for input clock */ +bool vsim_18v;/* MMC-2 option */ int gpio_cd;/* or -EINVAL */ int gpio_wp;/* or -EINVAL */ struct device *dev;/* returned: pointer to mmc adapter */
Signature · 1 line
1.5.6.3
Re: [PATCH 2/6] OMAP: mmc-twl4030 support VSIM is VMMC2_IO
arch/arm/mach-omap2/mmc-twl4030.c static struct twl_mmc_controller { · line 71
Quoted 8 lines · Adrian Hunter
arch/arm/mach-omap2/mmc-twl4030.c +1
-0@@ -61,6 +65,7 @@ static struct twl_mmc_controller { struct omap_mmc_platform_data *mmc; u8 twl_vmmc_dev_grp; u8 twl_mmc_dedicated; + bool vsim_18v; char name[HSMMC_NAME_LEN + 1]; } hsmmc[OMAP34XX_NR_MMC] = { {
I have an alternate approach to your patches #2, and #6 ... basically, as part of switching the mmc-twl4030 glue over to the regulator framework, each MMC device can have two named supplies. (And the glue should work with PMICs other than just the twl4030 family chips.)
So an eMMC chip with both power rails switchable would set up one for Vcc, and a second for VccQ ... which need not be VSIM, and need not even use a twl4030. MMC2 and MMC3 would be able to switch VccQ on after Vcc, for eMMC ... or similarly for an SDIO chip with a switchable regulator.
So your #2 patch won't be needed, since the second supply would be handled in a more general way; ditto #6. Some of the other patches will also be affected.
I'll send patches implementing this as soon as I get them working on one more board.
- Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/6 OMAP: mmc-twl4030 add cover switch
In reply to Adrian HunterQuoted 1 line
From
1667cd29afa90d041c0782223253835e6bc25b18Mon Sep 17 00:00:00 2001
From: Adrian Hunter <[email protected]>
Date: Mon, 26 Jan 2009 13:14:28 +0200
Subject: [PATCH] OMAP: mmc-twl4030 add cover switch
Allow a cover switch to be used to cause a rescan of the MMC slot.
--- arch/arm/mach-omap2/mmc-twl4030.c | 13 ++++++++++++- arch/arm/mach-omap2/mmc-twl4030.h | 1 + 2 files changed, 13 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/mmc-twl4030.c +12 -1
@@ -105,6 +105,14 @@ static int twl_mmc_get_ro(struct device *dev, int slot)return gpio_get_value_cansleep (mmc->slots[0 ].gpio_wp); } +static int twl_mmc_get_cover_state (struct device *dev,int slot) +{ +struct omap_mmc_platform_data *mmc = dev->platform_data; + +/* NOTE: assumes card detect signal is active-low */ +return !gpio_get_value_cansleep (mmc->slots[0 ].switch_pin); +} +/* * MMC Slot Initialization. */
@@ -427,7 +435,10 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) mmc->slots[0 ].switch_pin = c->gpio_cd; mmc->slots[0 ].card_detect_irq =gpio_to_irq (c->gpio_cd); - mmc->slots[0 ].card_detect = twl_mmc_card_detect; +if (c->cover_only) + mmc->slots[0 ].get_cover_state = twl_mmc_get_cover_state; +else + mmc->slots[0 ].card_detect = twl_mmc_card_detect; }else mmc->slots[0 ].switch_pin = -EINVAL ;
arch/arm/mach-omap2/mmc-twl4030.h +1 -0
@@ -12,6 +12,7 @@ struct twl4030_hsmmc_info {bool transceiver;/* MMC-2 option */ bool ext_clock;/* use external pin for input clock */ bool vsim_18v;/* MMC-2 option */ +bool cover_only;/* No card detect - just cover switch */ int gpio_cd;/* or -EINVAL */ int gpio_wp;/* or -EINVAL */ struct device *dev;/* returned: pointer to mmc adapter */
Signature · 1 line
1.5.6.3
Re: [PATCH 3/6] OMAP: mmc-twl4030 add cover switch
Quoted 9 lines · Adrian Hunter
Quoted 1 line
From
1667cd29afa90d041c0782223253835e6bc25b18Mon Sep 17 00:00:00 2001From: Adrian Hunter <[email protected]>
Date: Mon, 26 Jan 2009 13:14:28 +0200
Subject: [PATCH] OMAP: mmc-twl4030 add cover switchAllow a cover switch to be used to cause a rescan of the MMC slot.
Signed-off-by Adrian Hunter <[email protected]>
Because a cover switch is not the same as a card detect switch...
Quoted 52 lines
--- arch/arm/mach-omap2/mmc-twl4030.c | 13 ++++++++++++- arch/arm/mach-omap2/mmc-twl4030.h | 1 + 2 files changed, 13 insertions(+), 1 deletions(-)arch/arm/mach-omap2/mmc-twl4030.c +12
-1@@ -105,6 +105,14 @@ static int twl_mmc_get_ro(struct device *dev, int slot)return gpio_get_value_cansleep (mmc->slots[0 ].gpio_wp); } +static int twl_mmc_get_cover_state (struct device *dev,int slot) +{ +struct omap_mmc_platform_data *mmc = dev->platform_data; + +/* NOTE: assumes card detect signal is active-low */ +return !gpio_get_value_cansleep (mmc->slots[0 ].switch_pin); +} +/* * MMC Slot Initialization. */ @@ -427,7 +435,10 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) mmc->slots[0 ].switch_pin = c->gpio_cd; mmc->slots[0 ].card_detect_irq =gpio_to_irq (c->gpio_cd); - mmc->slots[0 ].card_detect = twl_mmc_card_detect; +if (c->cover_only) + mmc->slots[0 ].get_cover_state = twl_mmc_get_cover_state; +else + mmc->slots[0 ].card_detect = twl_mmc_card_detect; }else mmc->slots[0 ].switch_pin = -EINVAL ;arch/arm/mach-omap2/mmc-twl4030.h +1
-0@@ -12,6 +12,7 @@ struct twl4030_hsmmc_info {bool transceiver;/* MMC-2 option */ bool ext_clock;/* use external pin for input clock */ bool vsim_18v;/* MMC-2 option */ +bool cover_only;/* No card detect - just cover switch */ int gpio_cd;/* or -EINVAL */ int gpio_wp;/* or -EINVAL */ struct device *dev;/* returned: pointer to mmc adapter */ Signature · 1 line
1.5.6.3
Tony Lindgren
maintainerRe: [PATCH 3/6] OMAP: mmc-twl4030 add cover switch
Quoted 6 lines · David Brownell
Quoted 5 lines · Adrian Hunter
Quoted 1 line
From
1667cd29afa90d041c0782223253835e6bc25b18Mon Sep 17 00:00:00 2001From: Adrian Hunter <[email protected]>
Date: Mon, 26 Jan 2009 13:14:28 +0200
Subject: [PATCH] OMAP: mmc-twl4030 add cover switch
Quoted 8 lines
Quoted 4 lines
Allow a cover switch to be used to cause a rescan of the MMC slot.
Signed-off-by Adrian Hunter <[email protected]>Acked-by David Brownell <[email protected]>Because a cover switch is not the same as a card detect switch...
Pushed this too after after editing the header change to apply.
Tony
Quoted 55 lines
Quoted 52 lines
--- arch/arm/mach-omap2/mmc-twl4030.c | 13 ++++++++++++- arch/arm/mach-omap2/mmc-twl4030.h | 1 + 2 files changed, 13 insertions(+), 1 deletions(-)arch/arm/mach-omap2/mmc-twl4030.c +12
-1@@ -105,6 +105,14 @@ static int twl_mmc_get_ro(struct device *dev, int slot)return gpio_get_value_cansleep (mmc->slots[0 ].gpio_wp); } +static int twl_mmc_get_cover_state (struct device *dev,int slot) +{ +struct omap_mmc_platform_data *mmc = dev->platform_data; + +/* NOTE: assumes card detect signal is active-low */ +return !gpio_get_value_cansleep (mmc->slots[0 ].switch_pin); +} +/* * MMC Slot Initialization. */ @@ -427,7 +435,10 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) mmc->slots[0 ].switch_pin = c->gpio_cd; mmc->slots[0 ].card_detect_irq =gpio_to_irq (c->gpio_cd); - mmc->slots[0 ].card_detect = twl_mmc_card_detect; +if (c->cover_only) + mmc->slots[0 ].get_cover_state = twl_mmc_get_cover_state; +else + mmc->slots[0 ].card_detect = twl_mmc_card_detect; }else mmc->slots[0 ].switch_pin = -EINVAL ;arch/arm/mach-omap2/mmc-twl4030.h +1
-0@@ -12,6 +12,7 @@ struct twl4030_hsmmc_info {bool transceiver;/* MMC-2 option */ bool ext_clock;/* use external pin for input clock */ bool vsim_18v;/* MMC-2 option */ +bool cover_only;/* No card detect - just cover switch */ int gpio_cd;/* or -EINVAL */ int gpio_wp;/* or -EINVAL */ struct device *dev;/* returned: pointer to mmc adapter */ Signature · 1 line
1.5.6.3
PATCH 4/6 OMAP: mmc-twl4030 allow arbitrary slot names
In reply to Adrian HunterQuoted 1 line
From
4c4a97595cab39443a85517c66bc26f5c2a9cae3Mon Sep 17 00:00:00 2001
From: Adrian Hunter <[email protected]>
Date: Fri, 30 Jan 2009 11:10:19 +0200
Subject: [PATCH] OMAP: mmc-twl4030 allow arbitrary slot names
--- arch/arm/mach-omap2/mmc-twl4030.c | 5 ++++- arch/arm/mach-omap2/mmc-twl4030.h | 1 + 2 files changed, 5 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/mmc-twl4030.c +4 -1
@@ -419,7 +419,10 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)return ; } -sprintf (twl->name,"mmc%islot%i" , c->mmc,1 ); +if (c->name) +strncpy (twl->name, c->name,HSMMC_NAME_LEN ); +else +sprintf (twl->name,"mmc%islot%i" , c->mmc,1 ); mmc->slots[0 ].name = twl->name; mmc->nr_slots =1 ; mmc->slots[0 ].wires = c->wires;
arch/arm/mach-omap2/mmc-twl4030.h +1 -0
@@ -15,6 +15,7 @@ struct twl4030_hsmmc_info {bool cover_only;/* No card detect - just cover switch */ int gpio_cd;/* or -EINVAL */ int gpio_wp;/* or -EINVAL */ +char *name;/* or NULL for default */ struct device *dev;/* returned: pointer to mmc adapter */ };
Signature · 1 line
1.5.6.3
Re: [PATCH 4/6] OMAP: mmc-twl4030 allow arbitrary slot names
Quoted 6 lines · Adrian Hunter
Quoted 1 line
From
4c4a97595cab39443a85517c66bc26f5c2a9cae3Mon Sep 17 00:00:00 2001From: Adrian Hunter <[email protected]>
Date: Fri, 30 Jan 2009 11:10:19 +0200
Subject: [PATCH] OMAP: mmc-twl4030 allow arbitrary slot namesSigned-off-by Adrian Hunter <[email protected]>
Those current slot names are sort of useless, eh?
Actually the MMC framework itself is no help here. If for example "mmcblk0" always came from host "mmc0" names would work a lot more smoothly. Instead, "mmcblk0" comes from the first card to be detected ... it might be from "mmc1" on one boot, "mmc0" on the next, "mmc2" on a third boot.
Quoted 37 lines
--- arch/arm/mach-omap2/mmc-twl4030.c | 5 ++++- arch/arm/mach-omap2/mmc-twl4030.h | 1 + 2 files changed, 5 insertions(+), 1 deletions(-)arch/arm/mach-omap2/mmc-twl4030.c +4
-1@@ -419,7 +419,10 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)return ; } -sprintf (twl->name,"mmc%islot%i" , c->mmc,1 ); +if (c->name) +strncpy (twl->name, c->name,HSMMC_NAME_LEN ); +else +sprintf (twl->name,"mmc%islot%i" , c->mmc,1 ); mmc->slots[0 ].name = twl->name; mmc->nr_slots =1 ; mmc->slots[0 ].wires = c->wires;arch/arm/mach-omap2/mmc-twl4030.h +1
-0@@ -15,6 +15,7 @@ struct twl4030_hsmmc_info {bool cover_only;/* No card detect - just cover switch */ int gpio_cd;/* or -EINVAL */ int gpio_wp;/* or -EINVAL */ +char *name;/* or NULL for default */ struct device *dev;/* returned: pointer to mmc adapter */ };Signature · 1 line
1.5.6.3
Tony Lindgren
maintainer[APPLIED] <span class="quote">> [PATCH] OMAP: mmc-twl4030 allow arbitrary slot names</span>
In reply to Adrian HunterThis patch has been applied to the linux-omap
by youw fwiendly patch wobot.
Commit: 84a26c2ee36fc899901c08ec0458be1d4999e8b5
PatchWorks
http://patchwork.kernel.org/patch/10842/
PATCH 6/6 OMAP: mmc-twl4030: Add VAUX3 support
In reply to Adrian HunterQuoted 1 line
From
a9cdb13f11c6f38680a4bec27300ed4c4709418fMon Sep 17 00:00:00 2001
From: Jarkko Lavinen <[email protected]>
Date: Wed, 25 Feb 2009 15:04:20 +0200
Subject: [PATCH] OMAP: mmc-twl4030: Add VAUX3 support
Allow overriding of VMMC2 regulator for MMC2 and use VAUX3 instead.
--- arch/arm/mach-omap2/board-rx51-flash.c | 2 + arch/arm/mach-omap2/mmc-twl4030.c | 106 ++++++++++++++++++++++---------- arch/arm/mach-omap2/mmc-twl4030.h | 1 + 3 files changed, 76 insertions(+), 33 deletions(-)
arch/arm/mach-omap2/board-rx51-flash.c +2 -0
@@ -20,6 +20,7 @@#include "mmc-twl4030.h" #define RX51_FLASH_CS 0 +#define VAUX3_DEV_GRP 0x1Fextern struct mtd_partition n800_partitions[ONENAND_MAX_PARTITIONS ];extern int n800_onenand_setup (void __iomem *onenand_base,int freq);
@@ -66,6 +67,7 @@ static struct twl4030_hsmmc_info mmc[] __initdata = { .gpio_cd = -EINVAL, .gpio_wp = -EINVAL, .vsim_18v = true, + .vmmc_dev_grp = VAUX3_DEV_GRP, }, {}/* Terminator */ };
arch/arm/mach-omap2/mmc-twl4030.c +73 -33
172 lines not on this page · raw message
arch/arm/mach-omap2/mmc-twl4030.h +1 -0
@@ -11,6 +11,7 @@ struct twl4030_hsmmc_info {u8 wires;/* 1/4/8 wires */ bool transceiver;/* MMC-2 option */ bool ext_clock;/* use external pin for input clock */ +u8 vmmc_dev_grp;/* override default regulator */ bool vsim_18v;/* MMC-2 option */ bool cover_only;/* No card detect - just cover switch */ int gpio_cd;/* or -EINVAL */
Signature · 1 line
1.5.6.3
A message that is not in the archive (sent off-list or not yet received): 20090310093329.16889.76098.sendpatchset@ahunter-laptop
Re: [PATCH 5/6] RX51: adjust hsmmc info
Quoted 8 lines · Adrian Hunter
(quoted diff) +0
-0@@ -52,16 +52,20 @@ static struct platform_device *rx51_flash_devices[] = {
static structtwl4030_hsmmc_infommc[]__initdata= { {
+ .name = "external", .mmc = 1,
- .wires = 8,
+ .wires = 4,
Quoted 8 lines
+ .cover_only = true,
.gpio_cd = 160,
.gpio_wp =-EINVAL,
},
{
+ .name = "internal",
.mmc = 2,
.wires = 8,
Ack on all the changes above ...
Quoted 3 lines
.gpio_cd =
-EINVAL,
.gpio_wp =-EINVAL,
+ .vsim_18v = true,
... but not that one.
Quoted 3 lines
},
{} /* Terminator */
};
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Tony Lindgren
maintainerRe: [PATCH 5/6] RX51: adjust hsmmc info
Quoted 21 lines · David Brownell
Quoted 8 lines · Adrian Hunter
(quoted diff) +0
-0@@ -52,16 +52,20 @@ static struct platform_device *rx51_flash_devices[] = {
static structtwl4030_hsmmc_infommc[]__initdata= { {
+ .name = "external", .mmc = 1,
- .wires = 8,
+ .wires = 4,Quoted 8 lines
+ .cover_only = true,
.gpio_cd = 160,
.gpio_wp =-EINVAL,
},
{
+ .name = "internal",
.mmc = 2,
.wires = 8,Ack on all the changes above ...
Quoted 11 lines
Quoted 3 lines
.gpio_cd =
-EINVAL,
.gpio_wp =-EINVAL,
+ .vsim_18v = true,... but not that one.
Quoted 3 lines
},
{} /* Terminator */
};
Applied this too except for the vsim_18v.
Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html