Esempio n. 1
0
static void __init graphicsmaster_init_irq(void)
{
	int irq;

	/* First the standard SA1100 IRQs */
	sa1100_init_irq();

	/* disable all IRQs */
	ADS_INT_EN1 = 0;
	ADS_INT_EN2 = 0;
	/* clear all IRQs */
	ADS_INT_ST1 = 0xff;
	ADS_INT_ST2 = 0xff;

	for (irq = ADS_EXT_IRQ(0); irq <= ADS_EXT_IRQ(7); irq++) {
		irq_desc[irq].valid	= 1;
		irq_desc[irq].probe_ok	= 1;
		irq_desc[irq].mask_ack	= ADS_mask_and_ack_irq0;
		irq_desc[irq].mask	= ADS_mask_irq0;
		irq_desc[irq].unmask	= ADS_unmask_irq0;
	}
	for (irq = ADS_EXT_IRQ(8); irq <= ADS_EXT_IRQ(15); irq++) {
		irq_desc[irq].valid	= 1;
		irq_desc[irq].probe_ok	= 1;
		irq_desc[irq].mask_ack	= ADS_mask_and_ack_irq1;
		irq_desc[irq].mask	= ADS_mask_irq1;
		irq_desc[irq].unmask	= ADS_unmask_irq1;
	}
	set_GPIO_IRQ_edge(GPIO_GPIO0, GPIO_FALLING_EDGE);
	setup_arm_irq( IRQ_GPIO0, &ADS_ext_irq );
}
Esempio n. 2
0
static int __init graphicsmaster_init(void)
{
	int ret;

	if (!machine_is_graphicsmaster())
		return -ENODEV;

	/*
	 * Ensure that the memory bus request/grant signals are setup,
	 * and the grant is held in its inactive state
	 */
	sa1110_mb_disable();

	/*
	 * Probe for SA1111.
	 */
	ret = sa1111_probe(ADS_SA1111_BASE);
	if (ret < 0)
		return ret;

	/*
	 * We found it.  Wake the chip up.
	 */
	sa1111_wake();

	/*
	 * The SDRAM configuration of the SA1110 and the SA1111 must
	 * match.  This is very important to ensure that SA1111 accesses
	 * don't corrupt the SDRAM.  Note that this ungates the SA1111's
	 * MBGNT signal, so we must have called sa1110_mb_disable()
	 * beforehand.
	 */
	sa1111_configure_smc(1,
			     FExtr(MDCNFG, MDCNFG_SA1110_DRAC0),
			     FExtr(MDCNFG, MDCNFG_SA1110_TDL0));

	/*
	 * Enable PWM control for LCD
	 */
	SKPCR |= SKPCR_PWMCLKEN;
	SKPWM0 = 0x7F;				// VEE
	SKPEN0 = 1;
	SKPWM1 = 0x01;				// Backlight
	SKPEN1 = 1;

	/*
	 * We only need to turn on DCLK whenever we want to use the
	 * DMA.  It can otherwise be held firmly in the off position.
	 */
	SKPCR |= SKPCR_DCLKEN;

	/*
	 * Enable the SA1110 memory bus request and grant signals.
	 */
	sa1110_mb_enable();

	sa1111_init_irq(ADS_EXT_IRQ(0));

	return 0;
}
Esempio n. 3
0
static void ADS_IRQ_demux( int irq, void *dev_id, struct pt_regs *regs )
{
	int i;

	while( (irq = ADS_INT_ST1 | (ADS_INT_ST2 << 8)) ){
		for( i = 0; i < 16; i++ )
			if( irq & (1<<i) ) {
				do_IRQ( ADS_EXT_IRQ(i), regs );
			}
	}
}
Esempio n. 4
0
static void ADS_mask_irq1(unsigned int irq)
{
	ADS_INT_ST2 = (1 << (irq - ADS_EXT_IRQ(8)));
}
Esempio n. 5
0
static void ADS_unmask_irq1(unsigned int irq)
{
	ADS_INT_EN2 |= (1 << (irq - ADS_EXT_IRQ(8)));
}
Esempio n. 6
0
static void ADS_mask_and_ack_irq1(unsigned int irq)
{
	int mask = (1 << (irq - ADS_EXT_IRQ(8)));
	ADS_INT_EN2 &= ~mask;
	ADS_INT_ST2 = mask;
}
Esempio n. 7
0
static void ADS_unmask_irq0(unsigned int irq)
{
	ADS_INT_EN1 |= (1 << (irq - ADS_EXT_IRQ(0)));
}
Esempio n. 8
0
static void ADS_mask_irq0(unsigned int irq)
{
	ADS_INT_ST1 = (1 << (irq - ADS_EXT_IRQ(0)));
}
Esempio n. 9
0
static void ADS_mask_and_ack_irq0(unsigned int irq)
{
	int mask = (1 << (irq - ADS_EXT_IRQ(0)));
	ADS_INT_EN1 &= ~mask;
	ADS_INT_ST1 = mask;
}
/*
 * This configures the UCB1x00 layer depending on the machine type
 * we're running on.  The UCB1x00 drivers should not contain any
 * machine dependencies.
 *
 * We can get rid of some of these dependencies by using existing
 * facilities provided by the kernel - namely IRQ probing.  The
 * machine specific files are expected to setup the IRQ levels on
 * initialisation.  With any luck, we'll get rid of all the
 * machine dependencies here.
 */
static int __init ucb1x00_configure(struct ucb1x00 *ucb)
{
	unsigned int irq_gpio_pin = 0;
	int irq, default_irq = NO_IRQ;

	if (machine_is_adsbitsy())
		default_irq = IRQ_GPCIN4;

//	if (machine_is_assabet())
//		default_irq = IRQ_GPIO23;

#ifdef CONFIG_SA1100_CERF
	if (machine_is_cerf())
		default_irq = IRQ_GPIO_UCB1200_IRQ;
#endif
#ifdef CONFIG_SA1100_FREEBIRD
	if (machine_is_freebird())
		default_irq = IRQ_GPIO_FREEBIRD_UCB1300_IRQ;
#endif
#if defined(CONFIG_SA1100_GRAPHICSCLIENT) || defined(CONFIG_SA1100_GRAPICSMASTER)
	if (machine_is_graphicsclient() || machine_is_graphicsmaster())
		default_irq = ADS_EXT_IRQ(8);
#endif
#ifdef CONFIG_SA1100_LART
	if (machine_is_lart()) {
		default_irq = LART_IRQ_UCB1200;
		irq_gpio_pin = LART_GPIO_UCB1200;
	}
#endif
	if (machine_is_omnimeter())
		default_irq = IRQ_GPIO23;

#ifdef CONFIG_SA1100_PFS168
	if (machine_is_pfs168())
		default_irq = IRQ_GPIO_UCB1300_IRQ;
#endif
#ifdef CONFIG_SA1100_SIMPAD
	if (machine_is_simpad())
		default_irq = IRQ_GPIO_UCB1300_IRQ;
#endif
#ifdef CONFIG_SA1100_SIMPUTER
	if (machine_is_simputer()) {
		default_irq = IRQ_GPIO_UCB1300_IRQ;
		irq_gpio_pin = GPIO_UCB1300_IRQ;
    }
#endif
	if (machine_is_shannon())
		default_irq = SHANNON_IRQ_GPIO_IRQ_CODEC;
#ifdef CONFIG_SA1100_YOPY
	if (machine_is_yopy())
		default_irq = IRQ_GPIO_UCB1200_IRQ;
#endif
#ifdef CONFIG_SA1100_ACCELENT
	if (machine_is_accelent_sa()) {
		ucb->irq = IRQ_GPIO_UCB1200_IRQ;
		irq_gpio_pin = GPIO_UCB1200_IRQ;
	}
#endif

	/*
	 * Eventually, this will disappear.
	 */
	if (irq_gpio_pin)
		set_GPIO_IRQ_edge(irq_gpio_pin, GPIO_RISING_EDGE);

	irq = ucb1x00_detect_irq(ucb);
	if (irq != NO_IRQ) {
		if (default_irq != NO_IRQ && irq != default_irq)
			printk(KERN_ERR "UCB1x00: probed IRQ%d != default IRQ%d\n",
				irq, default_irq);
		if (irq == default_irq)
			printk(KERN_ERR "UCB1x00: probed IRQ%d correctly. "
				"Please remove machine dependencies from "
				"ucb1x00-core.c\n", irq);
		ucb->irq = irq;
	} else {
		printk(KERN_ERR "UCB1x00: IRQ probe failed, using IRQ%d\n",
			default_irq);
		ucb->irq = default_irq;
	}

	return ucb->irq == NO_IRQ ? -ENODEV : 0;
}