Ejemplo n.º 1
0
static void __init mx28_init_mmc(void)
{
	struct platform_device *pdev;

	if (mxs_get_type(PINID_SSP0_CMD) == PIN_FUN1) {
		pdev = mxs_get_device("mxs-mmc", 0);
		if (pdev == NULL || IS_ERR(pdev))
			return;
		pdev->resource = mmc0_resource;
		pdev->num_resources = ARRAY_SIZE(mmc0_resource);
		pdev->dev.platform_data = &mmc0_data;
		mxs_add_device(pdev, 2);
	}

#if 0
	if (mxs_get_type(PINID_GPMI_RDY1) == PIN_FUN2) {
		pdev = mxs_get_device("mxs-mmc", 1);
		if (pdev == NULL || IS_ERR(pdev))
			return;
		pdev->resource = mmc1_resource;
		pdev->num_resources = ARRAY_SIZE(mmc1_resource);
		pdev->dev.platform_data = &mmc1_data;
		mxs_add_device(pdev, 2);
	}
#endif
}
int mx28evk_enet_gpio_init(void)
{
   int i;

   printk("Configure external PHY pins...\n");

   for (i = 0; i < ARRAY_SIZE(mx28evk_eth_mode_pins); i++) {
		mxs_release_pin(mx28evk_eth_mode_pins[i].id,
			mx28evk_eth_mode_pins[i].name);
   }

	mx28evk_init_pin_group(mx28evk_eth_mode_pins,
						ARRAY_SIZE(mx28evk_eth_mode_pins));

	/* pwr */
	if (mxs_get_type(PINID_GPMI_RDY1) == PIN_GPIO) {
		gpio_request(MXS_PIN_TO_GPIO(PINID_GPMI_RDY1), "ENET_PWR");
		gpio_direction_output(MXS_PIN_TO_GPIO(PINID_GPMI_RDY1), 0);
	} else if (mxs_get_type(PINID_LCD_D10) == PIN_GPIO) {
		gpio_request(MXS_PIN_TO_GPIO(PINID_LCD_D10), "ENET_PWR");
		gpio_direction_output(MXS_PIN_TO_GPIO(PINID_LCD_D10), 0);
	} else {
		printk(KERN_ERR "Unable to determine correct EN_ENET_3.3V pin\n");
	}

	/* reset phy */
//	gpio_request(MXS_PIN_TO_GPIO(PINID_SSP0_DETECT), "PHY_RESET");
//	gpio_direction_output(MXS_PIN_TO_GPIO(PINID_SSP0_DETECT), 0);

//	mdelay(1);

   printk("Release external PHY reset...\n");
	gpio_direction_output(MXS_PIN_TO_GPIO(PINID_SSP0_DETECT), 1);
	mdelay(20);

	for (i = 0; i < ARRAY_SIZE(mx28evk_eth_mode_pins); i++) {
		mxs_release_pin(mx28evk_eth_mode_pins[i].id,
			mx28evk_eth_mode_pins[i].name);
   }

	mx28evk_init_pin_group(mx28evk_eth_pins,
						ARRAY_SIZE(mx28evk_eth_pins));

	return 0;
}
void mx28evk_enet_io_lowerpower_exit(void)
{
	int i;
	if (mxs_get_type(PINID_GPMI_RDY1) == PIN_GPIO) {
		gpio_direction_output(MXS_PIN_TO_GPIO(PINID_GPMI_RDY1), 0);
	} else if (mxs_get_type(PINID_LCD_D10) == PIN_GPIO) {
		gpio_direction_output(MXS_PIN_TO_GPIO(PINID_LCD_D10), 0);
	} else {
		printk(KERN_ERR "Unable to determine correct EN_ENET_3.3V pin\n");
	}
	//gpio_direction_output(MXS_PIN_TO_GPIO(PINID_ENET0_RX_CLK), 1);
	//gpio_free(MXS_PIN_TO_GPIO(PINID_ENET0_TX_CLK));
	for (i = 0; i < ARRAY_SIZE(mx28evk_eth_pins); i++) {
		gpio_free(MXS_PIN_TO_GPIO(mx28evk_eth_pins[i].id));
		mxs_request_pin(mx28evk_eth_pins[i].id,
			mx28evk_eth_pins[i].fun,
			mx28evk_eth_pins[i].name);
	}
}
Ejemplo n.º 4
0
static void __init mx28_init_mmc(void)
{
	struct platform_device *pdev;

	if (mxs_get_type(PINID_SSP0_CMD) == PIN_FUN1) {
		pdev = mxs_get_device("mxs-mmc", 0);
		if (pdev == NULL || IS_ERR(pdev))
			return;
		pdev->resource = mmc0_resource;
		pdev->num_resources = ARRAY_SIZE(mmc0_resource);
		pdev->dev.platform_data = &mmc0_data;
		mxs_add_device(pdev, 2);
	}

	if (mxs_get_type(PINID_GPMI_RDY1) == PIN_FUN2) {
		pdev = mxs_get_device("mxs-mmc", 1);
		if (pdev == NULL || IS_ERR(pdev))
			return;
		pdev->resource = mmc1_resource;
		pdev->num_resources = ARRAY_SIZE(mmc1_resource);
		pdev->dev.platform_data = &mmc1_data;
		mxs_add_device(pdev, 2);
	}

#if  defined(CONFIG_BCMDHD_WEXT) && defined(CONFIG_iMX_287) && !defined(CONFIG_SPI_MXS)
	/*---------------modified by luozhizhuo for imx287 wifi------------*/
        if (mxs_get_type(PINID_SSP0_DATA6) == PIN_FUN2) {
                pdev = mxs_get_device("mxs-mmc",2);
                if (pdev == NULL || IS_ERR(pdev))
                        return;
                pdev->resource = mmc2_resource;
                pdev->num_resources = ARRAY_SIZE(mmc2_resource);
                pdev->dev.platform_data = &mmc2_data;
                mxs_add_device(pdev, 2);
        }
#endif


}