Skip to content

Commit 5f87aaf

Browse files
shawn1221Ulf Hansson
authored andcommitted
mmc: core: Allow more host caps to be modified through debugfs
This makes various signal and function tests more convenient without the need to modify the DTB. /sys/kernel/debug/mmc0# echo $(($(cat caps) | (1 << 7))) > caps /sys/kernel/debug/mmc0# echo on > /sys/bus/mmc/devices/mmc0\:0001/power/control /sys/kernel/debug/mmc0# echo auto > /sys/bus/mmc/devices/mmc0\:0001/power/control // Disable 8-bit support echo $(($(cat caps) & ~(1 << 6))) > caps // Enable 8-bit support echo $(($(cat caps) | (1 << 6))) > caps // Disable 4-bit support echo $(($(cat caps) & ~(1 << 0))) > caps // Enable 4-bit support echo $(($(cat caps) | (1 << 0))) > caps // Disable CMD23 support echo $(($(cat caps) & ~(1 << 30))) > caps // Enable CMD23 support echo $(($(cat caps) | (1 << 30))) > caps // Disable CMD23 support echo $(($(cat caps) & ~(1 << 30))) > caps // Enable CMD23 support echo $(($(cat caps) | (1 << 30))) > caps // Disable CQE support echo $(($(cat caps2) & ~(1 << 23))) > caps2 // Enable CQE support echo $(($(cat caps2) | (1 << 23))) > caps2 // Disable CQE DCMD support echo $(($(cat caps2) & ~(1 << 24))) > caps2 // Enable CQE DCMD support echo $(($(cat caps2) | (1 << 24))) > caps2 /sys/kernel/debug/mmc0# echo on > /sys/bus/mmc/devices/mmc0\:0001/power/control /sys/kernel/debug/mmc0# cat ios Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent fda1e0a commit 5f87aaf

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

drivers/mmc/core/debugfs.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,10 @@ static int mmc_caps_set(void *data, u64 val)
315315
MMC_CAP_SD_HIGHSPEED |
316316
MMC_CAP_MMC_HIGHSPEED |
317317
MMC_CAP_UHS |
318-
MMC_CAP_DDR;
318+
MMC_CAP_DDR |
319+
MMC_CAP_4_BIT_DATA |
320+
MMC_CAP_8_BIT_DATA |
321+
MMC_CAP_CMD23;
319322

320323
if (diff & ~allowed)
321324
return -EINVAL;
@@ -327,7 +330,10 @@ static int mmc_caps_set(void *data, u64 val)
327330

328331
static int mmc_caps2_set(void *data, u64 val)
329332
{
330-
u32 allowed = MMC_CAP2_HSX00_1_8V | MMC_CAP2_HSX00_1_2V;
333+
u32 allowed = MMC_CAP2_HSX00_1_8V |
334+
MMC_CAP2_HSX00_1_2V |
335+
MMC_CAP2_CQE |
336+
MMC_CAP2_CQE_DCMD;
331337
u32 *caps = data;
332338
u32 diff = *caps ^ val;
333339

0 commit comments

Comments
 (0)