Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295881
b: refs/heads/master
c: c5f9879
h: refs/heads/master
i:
  295879: b8b5c42
v: v3
  • Loading branch information
Fabio Estevam authored and Shawn Guo committed Jan 31, 2012
1 parent 07c3c29 commit acc2e20
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 57 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9250bc8b76bd7e89a9891c9a862aa3eea7bcfb8e
refs/heads/master: c5f98794f9d807c1d203468f8deb1b3524a95e67
72 changes: 16 additions & 56 deletions trunk/arch/arm/mach-mxs/mach-mx28evk.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,40 +223,14 @@ static const struct gpio_led_platform_data mx28evk_led_data __initconst = {
/* fec */
static void __init mx28evk_fec_reset(void)
{
int ret;
struct clk *clk;

/* Enable fec phy clock */
clk = clk_get_sys("pll2", NULL);
if (!IS_ERR(clk))
clk_prepare_enable(clk);

/* Power up fec phy */
ret = gpio_request(MX28EVK_FEC_PHY_POWER, "fec-phy-power");
if (ret) {
pr_err("Failed to request gpio fec-phy-%s: %d\n", "power", ret);
return;
}

ret = gpio_direction_output(MX28EVK_FEC_PHY_POWER, 0);
if (ret) {
pr_err("Failed to drive gpio fec-phy-%s: %d\n", "power", ret);
return;
}

/* Reset fec phy */
ret = gpio_request(MX28EVK_FEC_PHY_RESET, "fec-phy-reset");
if (ret) {
pr_err("Failed to request gpio fec-phy-%s: %d\n", "reset", ret);
return;
}

gpio_direction_output(MX28EVK_FEC_PHY_RESET, 0);
if (ret) {
pr_err("Failed to drive gpio fec-phy-%s: %d\n", "reset", ret);
return;
}

gpio_set_value(MX28EVK_FEC_PHY_RESET, 0);
mdelay(1);
gpio_set_value(MX28EVK_FEC_PHY_RESET, 1);
}
Expand Down Expand Up @@ -413,9 +387,14 @@ static void __init mx28evk_add_regulators(void)
static void __init mx28evk_add_regulators(void) {}
#endif

static struct gpio mx28evk_lcd_gpios[] = {
static const struct gpio mx28evk_gpios[] __initconst = {
{ MX28EVK_LCD_ENABLE, GPIOF_OUT_INIT_HIGH, "lcd-enable" },
{ MX28EVK_BL_ENABLE, GPIOF_OUT_INIT_HIGH, "bl-enable" },
{ MX28EVK_FLEXCAN_SWITCH, GPIOF_DIR_OUT, "flexcan-switch" },
{ MX28EVK_MMC0_SLOT_POWER, GPIOF_OUT_INIT_LOW, "mmc0-slot-power" },
{ MX28EVK_MMC1_SLOT_POWER, GPIOF_OUT_INIT_LOW, "mmc1-slot-power" },
{ MX28EVK_FEC_PHY_POWER, GPIOF_OUT_INIT_LOW, "fec-phy-power" },
{ MX28EVK_FEC_PHY_RESET, GPIOF_DIR_OUT, "fec-phy-reset" },
};

static const struct mxs_saif_platform_data
Expand Down Expand Up @@ -443,25 +422,18 @@ static void __init mx28evk_init(void)
if (mx28evk_fec_get_mac())
pr_warn("%s: failed on fec mac setup\n", __func__);

ret = gpio_request_array(mx28evk_gpios, ARRAY_SIZE(mx28evk_gpios));
if (ret)
pr_err("One or more GPIOs failed to be requested: %d\n", ret);

mx28evk_fec_reset();
mx28_add_fec(0, &mx28_fec_pdata[0]);
mx28_add_fec(1, &mx28_fec_pdata[1]);

ret = gpio_request_one(MX28EVK_FLEXCAN_SWITCH, GPIOF_DIR_OUT,
"flexcan-switch");
if (ret) {
pr_err("failed to request gpio flexcan-switch: %d\n", ret);
} else {
mx28_add_flexcan(0, &mx28evk_flexcan_pdata[0]);
mx28_add_flexcan(1, &mx28evk_flexcan_pdata[1]);
}
mx28_add_flexcan(0, &mx28evk_flexcan_pdata[0]);
mx28_add_flexcan(1, &mx28evk_flexcan_pdata[1]);

ret = gpio_request_array(mx28evk_lcd_gpios,
ARRAY_SIZE(mx28evk_lcd_gpios));
if (ret)
pr_warn("failed to request gpio pins for lcd: %d\n", ret);
else
mx28_add_mxsfb(&mx28evk_mxsfb_pdata);
mx28_add_mxsfb(&mx28evk_mxsfb_pdata);

mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
mx28_add_saif(0, &mx28evk_mxs_saif_pdata[0]);
Expand All @@ -476,20 +448,8 @@ static void __init mx28evk_init(void)
mxs_add_platform_device("mxs-sgtl5000", 0, NULL, 0,
NULL, 0);

/* power on mmc slot by writing 0 to the gpio */
ret = gpio_request_one(MX28EVK_MMC0_SLOT_POWER, GPIOF_OUT_INIT_LOW,
"mmc0-slot-power");
if (ret)
pr_warn("failed to request gpio mmc0-slot-power: %d\n", ret);
else
mx28_add_mxs_mmc(0, &mx28evk_mmc_pdata[0]);

ret = gpio_request_one(MX28EVK_MMC1_SLOT_POWER, GPIOF_OUT_INIT_LOW,
"mmc1-slot-power");
if (ret)
pr_warn("failed to request gpio mmc1-slot-power: %d\n", ret);
else
mx28_add_mxs_mmc(1, &mx28evk_mmc_pdata[1]);
mx28_add_mxs_mmc(0, &mx28evk_mmc_pdata[0]);
mx28_add_mxs_mmc(1, &mx28evk_mmc_pdata[1]);

mx28_add_rtc_stmp3xxx();

Expand Down

0 comments on commit acc2e20

Please sign in to comment.