Beispiel #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
}
void __init mx23_init_spdif(void)
{	struct platform_device *pdev;
	pdev = mxs_get_device("mxs-spdif", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;
	mxs_add_device(pdev, 3);
}
Beispiel #3
0
static void __init mx28_init_l2switch(void)
{
	struct platform_device *pdev;
	struct switch_platform_data *pswitch;
	struct fec_platform_data *pfec;
	u32 val;

	__raw_writel(BM_OCOTP_CTRL_RD_BANK_OPEN,
			IO_ADDRESS(OCOTP_PHYS_ADDR) + HW_OCOTP_CTRL_SET);

	while (BM_OCOTP_CTRL_BUSY &
		__raw_readl(IO_ADDRESS(OCOTP_PHYS_ADDR) + HW_OCOTP_CTRL))
		udelay(10);

	pdev = mxs_get_device("mxs-l2switch", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;

	val =  __raw_readl(IO_ADDRESS(OCOTP_PHYS_ADDR) +
					HW_OCOTP_CUSTn(pdev->id));
	pdev->resource = l2switch_resources;
	pdev->num_resources = ARRAY_SIZE(l2switch_resources);
	pdev->dev.platform_data = &l2switch_data;

	pswitch = (struct switch_platform_data *)pdev->dev.platform_data;
	pfec = pswitch->fec_enet;
	pfec->mac[0] = 0x00;
	pfec->mac[1] = 0x04;
	pfec->mac[2] = (val >> 24) & 0xFF;
	pfec->mac[3] = (val >> 16) & 0xFF;
	pfec->mac[4] = (val >> 8) & 0xFF;
	pfec->mac[5] = (val >> 0) & 0xFF;

	mxs_add_device(pdev, 2);
}
Beispiel #4
0
static void __init mx23_canopus_init_adc(void)
{
	struct platform_device *pdev;
	pdev = mxs_get_device("mxs-adc", 0);
	if (pdev == NULL)
		return;
	mxs_add_device(pdev, 3);
}
static void __init imx233_olinuxino_init_adc(void)
{
	struct platform_device *pdev;
	pdev = mxs_get_device("mxs-adc", 0);
	if (pdev == NULL)
		return;
	mxs_add_device(pdev, 3);
}
static void __init mx23_init_duart(void)
{
	struct platform_device *pdev;
	pdev = mxs_get_device("mxs-duart", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;
	pdev->resource = duart_resource;
	pdev->num_resources = ARRAY_SIZE(duart_resource);
	mxs_add_device(pdev, 3);
}
Beispiel #7
0
static void __init mx28_init_pxp(void)
{
	struct platform_device *pdev;
	pdev = mxs_get_device("mxs-pxp", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;
	pdev->resource = pxp_resource;
	pdev->num_resources = ARRAY_SIZE(pxp_resource);
	mxs_add_device(pdev, 3);
}
Beispiel #8
0
void __init mx28_init_audio(void)
{	struct platform_device *pdev;
	pdev = mxs_get_device("mxs-sgtl5000", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;
	mxs_add_device(pdev, 3);
	audio_plat_data.saif_mclock = clk_get(NULL, "saif.0");
	audio_clk_init(audio_plat_data.saif_mclock);
	pdev->dev.platform_data = &audio_plat_data;
}
Beispiel #9
0
static inline void mx28_init_flexcan(void)
{
	struct platform_device *pdev;
	pdev = mxs_get_device("FlexCAN", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;
	pdev->resource = flexcan0_resources;
	pdev->num_resources = ARRAY_SIZE(flexcan0_resources);
	pdev->dev.platform_data = &flexcan_data[0];
	mxs_add_device(pdev, 2);

	pdev = mxs_get_device("FlexCAN", 1);
	if (pdev == NULL || IS_ERR(pdev))
		return;
	pdev->resource = flexcan1_resources;
	pdev->num_resources = ARRAY_SIZE(flexcan1_resources);
	pdev->dev.platform_data = &flexcan_data[1];
	mxs_add_device(pdev, 2);
}
Beispiel #10
0
static void __init mx23_init_wdt(void)
{
	struct platform_device *pdev;
	pdev = mxs_get_device("mxs-wdt", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;
	pdev->resource = &mx23_wdt_res;
	pdev->num_resources = 1;
	mxs_add_device(pdev, 3);
}
Beispiel #11
0
static void __init mx28_init_rtc(void)
{
	struct platform_device *pdev;

	pdev = mxs_get_device("mxs-rtc", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;
	pdev->resource = mx28_rtc_res;
	pdev->num_resources = ARRAY_SIZE(mx28_rtc_res);
	mxs_add_device(pdev, 3);
}
Beispiel #12
0
static void mx28_init_battery(void)
{
	struct platform_device *pdev;
	pdev = mxs_get_device("mxs-battery", 0);
	if (pdev) {
		pdev->resource = battery_resource,
		pdev->num_resources = ARRAY_SIZE(battery_resource),
		pdev->dev.platform_data = &battery_data;
		mxs_add_device(pdev, 3);
	}
}
Beispiel #13
0
static void __init mx23_init_lcdif(void)
{
	struct platform_device *pdev;
	pdev = mxs_get_device("mxs-fb", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;
	pdev->resource = framebuffer_resource;
	pdev->num_resources = ARRAY_SIZE(framebuffer_resource);
	pdev->dev.platform_data = &mxs_framebuffer_pdata;
	mxs_add_device(pdev, 3);
}
Beispiel #14
0
static int __init register_devices(void)
{
	struct platform_device *pdev;
	pdev = mxs_get_device("mxs-fb", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return -ENODEV;

	mxs_lcd_register_entry(&fb_entry, pdev->dev.platform_data);

	return 0;
}
Beispiel #15
0
static void mx23_init_otp(void)
{
	struct platform_device *pdev;
	pdev = mxs_get_device("ocotp", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;
	pdev->dev.platform_data = &otp_data;
	pdev->resource = NULL;
	pdev->num_resources = 0;
	mxs_add_device(pdev, 3);
}
Beispiel #16
0
static void __init mx23_init_dcp(void)
{
	struct platform_device *pdev;

	pdev = mxs_get_device("dcp", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;
	pdev->resource = dcp_resources;
	pdev->num_resources = ARRAY_SIZE(dcp_resources);
	mxs_add_device(pdev, 3);
}
Beispiel #17
0
static void mx23_init_persistent(void)
{
	struct platform_device *pdev;
	pdev = mxs_get_device("mxs-persistent", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;
	pdev->dev.platform_data = &mx23_persistent_data;
	pdev->resource = mx23_persistent_res,
	pdev->num_resources = ARRAY_SIZE(mx23_persistent_res),
	mxs_add_device(pdev, 3);
}
Beispiel #18
0
static void __init mx23_init_kbd(void)
{
	struct platform_device *pdev;
	pdev = mxs_get_device("mxs-kbd", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;
	pdev->resource = mx23_kbd_res;
	pdev->num_resources = ARRAY_SIZE(mx23_kbd_res);
	pdev->dev.platform_data = &mxs_kbd_data;
	mxs_add_device(pdev, 3);
}
Beispiel #19
0
static void __init mx28_init_l2switch(void)
{
	struct platform_device *pdev;
	pdev = mxs_get_device("mxs-l2switch", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;

	pdev->resource = l2switch_resources;
	pdev->num_resources = ARRAY_SIZE(l2switch_resources);
	pdev->dev.platform_data = &l2switch_data;
	mxs_add_device(pdev, 2);
}
Beispiel #20
0
static void __init mx23_init_gpmi_nfc(void)
{
	struct platform_device  *pdev;

	pdev = mxs_get_device(GPMI_NFC_DRIVER_NAME, 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;
	pdev->dev.platform_data = &gpmi_nfc_platform_data;
	pdev->resource          =  gpmi_nfc_resources;
	pdev->num_resources     = ARRAY_SIZE(gpmi_nfc_resources);
	mxs_add_device(pdev, 1);
}
Beispiel #21
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


}
Beispiel #22
0
static void __init mx23_init_mmc(void)
{
	struct platform_device *pdev;

	pdev = mxs_get_device("mxs-mmc", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;
	pdev->resource = mx23_mmc0_resource;
	pdev->num_resources = ARRAY_SIZE(mx23_mmc0_resource);
	pdev->dev.platform_data = &mx23_mmc0_data;

	mxs_add_device(pdev, 2);
}
Beispiel #23
0
static void __init mx28_init_spi(void)
{
	struct platform_device *pdev;

	pdev = mxs_get_device("mxs-spi", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;
	pdev->resource = ssp2_resources;
	pdev->num_resources = ARRAY_SIZE(ssp2_resources);
	pdev->dev.platform_data = &spi_data;

	mxs_add_device(pdev, 3);
}
Beispiel #24
0
static void __init mx23_init_viim(void)
{
	struct platform_device *pdev;

	pdev = mxs_get_device("mxs_viim", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;

	pdev->resource = viim_resources;
	pdev->num_resources = ARRAY_SIZE(viim_resources);

	mxs_add_device(pdev, 2);
}
Beispiel #25
0
static void __init mx23_canopus_init_leds(void)
{
	struct platform_device *pdev;

	pdev = mxs_get_device("mxs-leds", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return;

	pdev->resource = &mx23_canopus_led_res;
	pdev->num_resources = 1;
	pdev->dev.platform_data = &mx23_canopus_led_data;
	mxs_add_device(pdev, 3);
}
Beispiel #26
0
static int __init register_devices(void)
{
	/*Foxconn/EricBHLin,20130909, MKD, SCR#{*/
	if(machine_is_mx28evk()){
	/*Foxconn/EricBHLin,20130909, MKD, SCR#}*/
		printk("Init TM020\n");
	struct platform_device *pdev;
	pdev = mxs_get_device("mxs-fb", 0);
	if (pdev == NULL || IS_ERR(pdev))
		return -ENODEV;
    queue =  create_singlethread_workqueue("refresh_display");
    INIT_DELAYED_WORK(&refresh_work, mxs_lcdif_refresh);
	mxs_lcd_register_entry(&fb_entry, pdev->dev.platform_data);
	}
	return 0;
}
Beispiel #27
0
static void __init mx28_init_spi(void)
{
	struct platform_device *pdev;
	pdev = mxs_get_device("mxs-spi",0);
	if (pdev == NULL || IS_ERR(pdev))
		return;

/* modefy by zhuguojun 287 280 283是用spi3*/
#if  defined(CONFIG_iMX_283) || defined(CONFIG_iMX_280) || defined(CONFIG_iMX_287)		
	pdev->resource = ssp3_resources;
	pdev->num_resources = ARRAY_SIZE(ssp3_resources);
	pdev->dev.platform_data = &spi3_data;
#else									/* modefy by zhuguojun 		*/	
	pdev->resource = ssp2_resources;
	pdev->num_resources = ARRAY_SIZE(ssp2_resources);
	pdev->dev.platform_data = &spi2_data;

#endif

	mxs_add_device(pdev, 3);
}