Skip to content

Commit f23478f

Browse files
pcercueipaulburton
authored andcommitted
MIPS: qi_lb60: Move MMC configuration to devicetree
Move the MMC configuration from the board C file to devicetree. The 'power' GPIO was removed and instead the vmmc regulator is used, to follow the changes introduced in the jz4740-mmc driver. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Paul Burton <paul.burton@mips.com>
1 parent 61cbfff commit f23478f

File tree

2 files changed

+33
-32
lines changed

2 files changed

+33
-32
lines changed

arch/mips/boot/dts/ingenic/qi_lb60.dts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,23 @@
22
/dts-v1/;
33

44
#include "jz4740.dtsi"
5+
#include <dt-bindings/gpio/gpio.h>
56

67
/ {
78
compatible = "qi,lb60", "ingenic,jz4740";
89

910
chosen {
1011
stdout-path = &uart0;
1112
};
13+
14+
mmc_power: fixedregulator {
15+
compatible = "regulator-fixed";
16+
regulator-name = "mmc_vcc";
17+
gpio = <&gpd 2 0>;
18+
19+
regulator-min-microvolt = <3300000>;
20+
regulator-max-microvolt = <3300000>;
21+
};
1222
};
1323

1424
&ext {
@@ -30,4 +40,27 @@
3040
groups = "uart0-data";
3141
bias-disable;
3242
};
43+
44+
pins_mmc: mmc {
45+
mmc {
46+
function = "mmc";
47+
groups = "mmc-1bit", "mmc-4bit";
48+
bias-disable;
49+
};
50+
51+
mmc-gpios {
52+
pins = "PD0", "PD2";
53+
bias-disable;
54+
};
55+
};
56+
};
57+
58+
&mmc {
59+
bus-width = <4>;
60+
max-frequency = <24000000>;
61+
cd-gpios = <&gpd 0 GPIO_ACTIVE_HIGH>;
62+
vmmc-supply = <&mmc_power>;
63+
64+
pinctrl-names = "default";
65+
pinctrl-0 = <&pins_mmc>;
3366
};

arch/mips/jz4740/board-qi_lb60.c

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
#include <asm/mach-jz4740/gpio.h>
3232
#include <asm/mach-jz4740/jz4740_fb.h>
33-
#include <asm/mach-jz4740/jz4740_mmc.h>
3433

3534
#include <linux/regulator/fixed.h>
3635
#include <linux/regulator/machine.h>
@@ -377,19 +376,6 @@ static struct platform_device qi_lb60_gpio_keys = {
377376
}
378377
};
379378

380-
static struct jz4740_mmc_platform_data qi_lb60_mmc_pdata = {
381-
/* Intentionally left blank */
382-
};
383-
384-
static struct gpiod_lookup_table qi_lb60_mmc_gpio_table = {
385-
.dev_id = "jz4740-mmc.0",
386-
.table = {
387-
GPIO_LOOKUP("GPIOD", 0, "cd", GPIO_ACTIVE_HIGH),
388-
GPIO_LOOKUP("GPIOD", 2, "power", GPIO_ACTIVE_LOW),
389-
{ },
390-
},
391-
};
392-
393379
/* beeper */
394380
static struct pwm_lookup qi_lb60_pwm_lookup[] = {
395381
PWM_LOOKUP("jz4740-pwm", 4, "pwm-beeper", NULL, 0,
@@ -440,7 +426,6 @@ static struct gpiod_lookup_table qi_lb60_audio_gpio_table = {
440426
static struct platform_device *jz_platform_devices[] __initdata = {
441427
&jz4740_udc_device,
442428
&jz4740_udc_xceiv_device,
443-
&jz4740_mmc_device,
444429
&jz4740_nand_device,
445430
&qi_lb60_keypad,
446431
&qi_lb60_spigpio_device,
@@ -450,17 +435,12 @@ static struct platform_device *jz_platform_devices[] __initdata = {
450435
&jz4740_codec_device,
451436
&jz4740_adc_device,
452437
&jz4740_pwm_device,
453-
&jz4740_dma_device,
454438
&qi_lb60_gpio_keys,
455439
&qi_lb60_pwm_beeper,
456440
&qi_lb60_charger_device,
457441
&qi_lb60_audio_device,
458442
};
459443

460-
static unsigned long pin_cfg_bias_disable[] = {
461-
PIN_CONFIG_BIAS_DISABLE,
462-
};
463-
464444
static struct pinctrl_map pin_map[] __initdata = {
465445
/* NAND pin configuration */
466446
PIN_MAP_MUX_GROUP_DEFAULT("jz4740-nand",
@@ -472,16 +452,6 @@ static struct pinctrl_map pin_map[] __initdata = {
472452
PIN_MAP_MUX_GROUP("jz4740-fb", PINCTRL_STATE_SLEEP,
473453
"10010000.pin-controller", "lcd-no-pins", "lcd"),
474454

475-
/* MMC pin configuration */
476-
PIN_MAP_MUX_GROUP_DEFAULT("jz4740-mmc.0",
477-
"10010000.pin-controller", "mmc-1bit", "mmc"),
478-
PIN_MAP_MUX_GROUP_DEFAULT("jz4740-mmc.0",
479-
"10010000.pin-controller", "mmc-4bit", "mmc"),
480-
PIN_MAP_CONFIGS_PIN_DEFAULT("jz4740-mmc.0",
481-
"10010000.pin-controller", "PD0", pin_cfg_bias_disable),
482-
PIN_MAP_CONFIGS_PIN_DEFAULT("jz4740-mmc.0",
483-
"10010000.pin-controller", "PD2", pin_cfg_bias_disable),
484-
485455
/* PWM pin configuration */
486456
PIN_MAP_MUX_GROUP_DEFAULT("jz4740-pwm",
487457
"10010000.pin-controller", "pwm4", "pwm4"),
@@ -493,12 +463,10 @@ static int __init qi_lb60_init_platform_devices(void)
493463
jz4740_framebuffer_device.dev.platform_data = &qi_lb60_fb_pdata;
494464
jz4740_nand_device.dev.platform_data = &qi_lb60_nand_pdata;
495465
jz4740_adc_device.dev.platform_data = &qi_lb60_battery_pdata;
496-
jz4740_mmc_device.dev.platform_data = &qi_lb60_mmc_pdata;
497466

498467
gpiod_add_lookup_table(&qi_lb60_audio_gpio_table);
499468
gpiod_add_lookup_table(&qi_lb60_nand_gpio_table);
500469
gpiod_add_lookup_table(&qi_lb60_spigpio_gpio_table);
501-
gpiod_add_lookup_table(&qi_lb60_mmc_gpio_table);
502470

503471
spi_register_board_info(qi_lb60_spi_board_info,
504472
ARRAY_SIZE(qi_lb60_spi_board_info));

0 commit comments

Comments
 (0)