Beispiel #1
0
static void pxa27x_start_hc(struct platform_device *dev)
{
	pxa_set_cken(CKEN10_USBHOST, 1);

	UHCHR |= UHCHR_FHR;
	udelay(11);
	UHCHR &= ~UHCHR_FHR;

	UHCHR |= UHCHR_FSBIR;
	while (UHCHR & UHCHR_FSBIR)
		cpu_relax();

	/* This could be properly abstracted away through the
	   device data the day more machines are supported and
	   their differences can be figured out correctly. */
	if (machine_is_mainstone()) {
		/* setup Port1 GPIO pin. */
		pxa_gpio_mode( 88 | GPIO_ALT_FN_1_IN);	/* USBHPWR1 */
		pxa_gpio_mode( 89 | GPIO_ALT_FN_2_OUT);	/* USBHPEN1 */

		/* Set the Power Control Polarity Low and Power Sense
		   Polarity Low to active low. Supply power to USB ports. */
		UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) &
			~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE);
	}

	UHCHR &= ~UHCHR_SSE;

	UHCHIE = (UHCHIE_UPRIE | UHCHIE_RWIE);
}
Beispiel #2
0
static void __init pxa_timer_init(void)
{
	unsigned long clock_tick_rate;

	OIER = 0;
	OSSR = OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3;

	if (cpu_is_pxa21x() || cpu_is_pxa25x())
		clock_tick_rate = 3686400;
	else if (machine_is_mainstone())
		clock_tick_rate = 3249600;
	else
		clock_tick_rate = 3250000;

	set_oscr2ns_scale(clock_tick_rate);

	ckevt_pxa_osmr0.mult =
		div_sc(clock_tick_rate, NSEC_PER_SEC, ckevt_pxa_osmr0.shift);
	ckevt_pxa_osmr0.max_delta_ns =
		clockevent_delta2ns(0x7fffffff, &ckevt_pxa_osmr0);
	ckevt_pxa_osmr0.min_delta_ns =
		clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_pxa_osmr0) + 1;

	cksrc_pxa_oscr0.mult =
		clocksource_hz2mult(clock_tick_rate, cksrc_pxa_oscr0.shift);

	setup_irq(IRQ_OST0, &pxa_ost0_irq);

	clocksource_register(&cksrc_pxa_oscr0);
	clockevents_register_device(&ckevt_pxa_osmr0);
}
Beispiel #3
0
static int __init mainstone_irq_device_init(void)
{
	if (machine_is_mainstone())
		register_syscore_ops(&mainstone_irq_syscore_ops);

	return 0;
}
static int __init mainstone_irq_device_init(void)
{
	int ret = -ENODEV;

	if (machine_is_mainstone()) {
		ret = sysdev_class_register(&mainstone_irq_sysclass);
		if (ret == 0)
			ret = sysdev_register(&mainstone_irq_device);
	}
	return ret;
}
Beispiel #5
0
unsigned long get_clock_tick_rate(void)
{
	unsigned long clock_tick_rate;

	if (cpu_is_pxa25x())
		clock_tick_rate = 3686400;
	else if (machine_is_mainstone())
		clock_tick_rate = 3249600;
	else
		clock_tick_rate = 3250000;

	return clock_tick_rate;
}
Beispiel #6
0
static int __init
pxa_leds_init(void)
{
	if (machine_is_lubbock())
		leds_event = lubbock_leds_event;
	if (machine_is_mainstone())
		leds_event = mainstone_leds_event;
	if (machine_is_pxa_idp())
		leds_event = idp_leds_event;

	leds_event(led_start);
	return 0;
}
Beispiel #7
0
static int __init mst_pcmcia_init(void)
{
    int ret;

    if (!machine_is_mainstone())
        return -ENODEV;

    mst_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1);
    if (!mst_pcmcia_device)
        return -ENOMEM;

    ret = platform_device_add_data(mst_pcmcia_device, &mst_pcmcia_ops,
                                   sizeof(mst_pcmcia_ops));
    if (ret == 0)
        ret = platform_device_add(mst_pcmcia_device);

    if (ret)
        platform_device_put(mst_pcmcia_device);

    return ret;
}