Пример #1
0
/*****************************************************************************
 * PCI
 ****************************************************************************/
static int __init dove_db_pci_init(void)
{
	if (machine_is_dove_db())
		dove_pcie_init(1, 1);

	return 0;
}
Пример #2
0
static int __init dove_db_cam_init(void)
{
	if ((machine_is_dove_db() || machine_is_dove_db_b())  &&  front_panel)
		dove_cam_init(&dove_cafe_cam_data);
	
	return 0;
}
Пример #3
0
static int __init dove_db_7seg_init(void)
{
	if (machine_is_dove_db() || machine_is_dove_db_b()) {
		int i;
		
		for(i = 0; i < 3; i++){
			int pin = dove_db_7seg_gpios[i];

			if (gpio_request(pin, "7seg LED") == 0) {
				if (gpio_direction_output(pin, 0) != 0) {
					printk(KERN_ERR "%s failed "
					       "to set output pin %d\n", __func__,
					       pin);
					gpio_free(pin);
					return 0;
				}
			} else {
				printk(KERN_ERR "%s failed "
				       "to request gpio %d\n", __func__, pin);
				return 0;
			}
		}
		setup_timer(&dove_db_timer, dove_db_7seg_event, 0);
		mod_timer(&dove_db_timer, jiffies + 1 * HZ);
	}
	return 0;
}
Пример #4
0
static int __init mv88fx_snd_init(void)
{
#ifdef CONFIG_ARCH_DOVE
	if (!machine_is_dove_db() && !machine_is_dove_db_z0())
		return -ENODEV;
#endif

	mv88fx_snd_debug("");
	return platform_driver_register(&mv88fx_snd_driver);
}
Пример #5
0
static int __init dove_db_pm_init(void)
{
	MV_PMU_INFO pmuInitInfo;
	u32 dev, rev;

	if (!machine_is_dove_db() && !machine_is_dove_db_b())
		return 0;

	global_dvs_enable = dvs_enable;

	dove_pcie_id(&dev, &rev);

	pmuInitInfo.batFltMngDis = MV_FALSE;				/* Keep battery fault enabled */
	pmuInitInfo.exitOnBatFltDis = MV_FALSE;				/* Keep exit from STANDBY on battery fail enabled */
	if (machine_is_dove_db() && rev < DOVE_REV_A0) {

		pmuInitInfo.sigSelctor[0] = PMU_SIGNAL_NC;
		pmuInitInfo.sigSelctor[1] = PMU_SIGNAL_NC;
		pmuInitInfo.sigSelctor[2] = PMU_SIGNAL_SLP_PWRDWN;		/* STANDBY => 0: I/O off, 1: I/O on */
		pmuInitInfo.sigSelctor[3] = PMU_SIGNAL_EXT0_WKUP;		/* power on push button */	
		if (rev >= DOVE_REV_X0) { /* For X0 and higher Power Good indication is not needed */
			if (standby_fix)
				pmuInitInfo.sigSelctor[4] = PMU_SIGNAL_CKE_OVRID;	/* CKE controlled by Dove */
			else
				pmuInitInfo.sigSelctor[4] = PMU_SIGNAL_NC;
		}
		else
			pmuInitInfo.sigSelctor[4] = PMU_SIGNAL_CPU_PWRGOOD;	/* CORE power good used as Standby PG */
		
		pmuInitInfo.sigSelctor[5] = PMU_SIGNAL_CPU_PWRDWN;		/* DEEP-IdLE => 0: CPU off, 1: CPU on */
		
		if ((rev >= DOVE_REV_X0) && (standby_fix)) /* For boards with X0 we use MPP6 as MRESET */
			pmuInitInfo.sigSelctor[6] = PMU_SIGNAL_MRESET_OVRID;		/* M_RESET is pulled up - always HI */
		else
			pmuInitInfo.sigSelctor[6] = PMU_SIGNAL_NC;
	} else {
		
		pmuInitInfo.sigSelctor[0] = PMU_SIGNAL_CPU_PWRDWN; /* DEEP-IdLE => 0: CPU off, 1: CPU on */
		pmuInitInfo.sigSelctor[1] = PMU_SIGNAL_1;
		
		pmuInitInfo.sigSelctor[2] = PMU_SIGNAL_NC;
		
		pmuInitInfo.sigSelctor[3] = PMU_SIGNAL_EXT0_WKUP;		/* power on push button */	
		pmuInitInfo.sigSelctor[4] = PMU_SIGNAL_CKE_OVRID;	/* CKE controlled by Dove */
		pmuInitInfo.sigSelctor[5] = PMU_SIGNAL_SLP_PWRDWN;		/* STANDBY => 0: I/O off, 1: I/O on */
		
		/* For boards with X0 we use MPP6 as MRESET */
		pmuInitInfo.sigSelctor[6] = PMU_SIGNAL_MRESET_OVRID;
	}
	pmuInitInfo.sigSelctor[7] = PMU_SIGNAL_1;			/* Standby Led - inverted */
	pmuInitInfo.sigSelctor[8] = PMU_SIGNAL_NC;
	pmuInitInfo.sigSelctor[9] = PMU_SIGNAL_NC;			/* CPU power good  - not used */
	pmuInitInfo.sigSelctor[10] = PMU_SIGNAL_SDI;			/* Voltage regulator control */
	pmuInitInfo.sigSelctor[11] = PMU_SIGNAL_NC;
	pmuInitInfo.sigSelctor[12] = PMU_SIGNAL_NC;
	pmuInitInfo.sigSelctor[13] = PMU_SIGNAL_NC;
	pmuInitInfo.sigSelctor[14] = PMU_SIGNAL_NC;
	pmuInitInfo.sigSelctor[15] = PMU_SIGNAL_NC;
	pmuInitInfo.dvsDelay = 0x4200;				/* ~100us in 166MHz cc - delay for DVS change */

	if (dvs_values_param != 0)
		pmuInitInfo.dvsValues = dvs_values_param;	/* calibrated values from u-boot */
	else
		pmuInitInfo.dvsValues = (DOVE_PSET_HI << DOVE_PSET_HI_OFFSET) | (DOVE_VSET_HI << DOVE_VSET_HI_OFFSET) | (DOVE_PSET_LO << DOVE_PSET_LO_OFFSET) | (DOVE_VSET_LO << DOVE_VSET_LO_OFFSET);	/* default values */

	if (machine_is_dove_db_b() || rev >= DOVE_REV_A0)
		pmuInitInfo.ddrTermGpioNum = 2;			/* GPIO 2 used to disable terminations */
	else
		pmuInitInfo.ddrTermGpioNum = 16;			/* GPIO 16 used to disable terminations */

	if (rev >= DOVE_REV_X0) /* For X0 and higher wait at least 150ms + spare */
		pmuInitInfo.standbyPwrDelay = 0x2000;		/* 250ms delay to wait for complete powerup */
	else
		pmuInitInfo.standbyPwrDelay = 0x140;		/* 10ms delay after getting the power good indication */
	
	/* Initialize the PMU HAL */
	if (mvPmuInit(&pmuInitInfo) != MV_OK)
	{
		printk(KERN_ERR "ERROR: Failed to initialise the PMU!\n");
		return 0;
	}

	/* Configure wakeup events */
	mvPmuWakeupEventSet(PMU_STBY_WKUP_CTRL_EXT0_FALL | PMU_STBY_WKUP_CTRL_RTC_MASK);

	/* Register the PM operation in the Linux stack */
	dove_pm_register();

	return 0;
}