Esempio n. 1
0
File: leds.c Progetto: 08opt/linux
static int __init
sa1100_leds_init(void)
{
	if (machine_is_assabet())
		leds_event = assabet_leds_event;
	if (machine_is_consus())
		leds_event = consus_leds_event;
	if (machine_is_badge4())
		leds_event = badge4_leds_event;
	if (machine_is_brutus())
		leds_event = brutus_leds_event;
	if (machine_is_cerf())
		leds_event = cerf_leds_event;
	if (machine_is_flexanet())
		leds_event = flexanet_leds_event;
	if (machine_is_graphicsclient())
		leds_event = graphicsclient_leds_event;
	if (machine_is_hackkit())
		leds_event = hackkit_leds_event;
	if (machine_is_lart())
		leds_event = lart_leds_event;
	if (machine_is_pfs168())
		leds_event = pfs168_leds_event;
	if (machine_is_graphicsmaster())
		leds_event = graphicsmaster_leds_event;
	if (machine_is_adsbitsy())
		leds_event = adsbitsy_leds_event;
	if (machine_is_pt_system3())
		leds_event = system3_leds_event;

	leds_event(led_start);
	return 0;
}
Esempio n. 2
0
File: leds.c Progetto: 274914765/C
static int __init
sa1100_leds_init(void)
{
    if (machine_is_assabet())
        leds_event = assabet_leds_event;
     if (machine_is_consus())
             leds_event = consus_leds_event;
    if (machine_is_badge4())
          leds_event = badge4_leds_event;
    if (machine_is_brutus())
        leds_event = brutus_leds_event;
    if (machine_is_cerf())
        leds_event = cerf_leds_event;
    if (machine_is_flexanet())
        leds_event = flexanet_leds_event;
    if (machine_is_graphicsclient())
        leds_event = graphicsclient_leds_event;
    if (machine_is_hackkit())
        leds_event = hackkit_leds_event;
    if (machine_is_lart())
        leds_event = lart_leds_event;
    if (machine_is_pfs168())
        leds_event = pfs168_leds_event;
    if (machine_is_graphicsmaster())
        leds_event = graphicsmaster_leds_event;
    if (machine_is_adsbitsy())
        leds_event = adsbitsy_leds_event;
    if (machine_is_pt_system3())
        leds_event = system3_leds_event;
    if (machine_is_simpad())
        leds_event = simpad_leds_event; /* what about machine registry? including led, apm... -zecke */

    leds_event(led_start);
    return 0;
}
Esempio n. 3
0
static void ssp_audio_init(void *data)
{
	if (machine_is_lart()) {
		unsigned long flags;
		local_irq_save(flags);

		/* LART has the SSP port rewired to GPIO 10-13, 19 */
		/* alternate functions for the GPIOs */
		GAFR |= ( GPIO_SSP_TXD | GPIO_SSP_RXD | GPIO_SSP_SCLK |
			  GPIO_SSP_SFRM | GPIO_SSP_CLK );

		/* Set the direction: 10, 12, 13 output; 11, 19 input */
		GPDR |= ( GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM );
		GPDR &= ~( GPIO_SSP_RXD | GPIO_SSP_CLK );

		/* enable SSP pin swap */
		PPAR |= PPAR_SPR;

		local_irq_restore(flags);
	}

	/* turn on the SSP */
	Ser4SSCR0 = 0;
	Ser4SSCR0 = (SSCR0_DataSize(16) | SSCR0_TI | SSCR0_SerClkDiv(2) |
		     SSCR0_SSE);
	Ser4SSCR1 = (SSCR1_SClkIactL | SSCR1_SClk1P | SSCR1_ExtClk);
}
Esempio n. 4
0
static struct sa1100fb_mach_info * __init
sa1100fb_get_machine_info(struct sa1100fb_info *fbi)
{
	struct sa1100fb_mach_info *inf = NULL;

	/*
	 *            R        G       B       T
	 * default  {11,5}, { 5,6}, { 0,5}, { 0,0}
	 * h3600    {12,4}, { 7,4}, { 1,4}, { 0,0}
	 * freebird { 8,4}, { 4,4}, { 0,4}, {12,4}
	 */
#ifdef CONFIG_SA1100_ASSABET
	if (machine_is_assabet()) {
#ifndef ASSABET_PAL_VIDEO
		inf = &lq039q2ds54_info;
#else
		inf = &pal_info;
#endif
	}
#endif
#ifdef CONFIG_SA1100_H3100
	if (machine_is_h3100()) {
		inf = &h3100_info;
	}
#endif
#ifdef CONFIG_SA1100_H3600
	if (machine_is_h3600()) {
		inf = &h3600_info;
		fbi->rgb[RGB_16] = &h3600_rgb_16;
	}
#endif
#ifdef CONFIG_SA1100_COLLIE
	if (machine_is_collie()) {
		inf = &collie_info;
	}
#endif
#ifdef CONFIG_SA1100_LART
	if (machine_is_lart()) {
#ifdef LART_GREY_LCD
		inf = &lart_grey_info;
#endif
#ifdef LART_COLOR_LCD
		inf = &lart_color_info;
#endif
#ifdef LART_VIDEO_OUT
		inf = &lart_video_info;
#endif
#ifdef LART_KIT01_LCD
		inf = &lart_kit01_info;
#endif
	}
#endif
#ifdef CONFIG_SA1100_SHANNON
	if (machine_is_shannon()) {
		inf = &shannon_info;
	}
#endif
	return inf;
}
Esempio n. 5
0
static int __init sa1100ssp_audio_init(void)
{
	int ret = -ENODEV;

	if (machine_is_lart())
		ret = driver_register(&sa1100ssp_audio_driver);

	return ret;
}
Esempio n. 6
0
/*
 * This needs re-working
 */
static int mcp_sa1100_init(void)
{
	struct mcp *mcp = &mcp_sa1100;
	int ret = -ENODEV;

	if (machine_is_adsbitsy()       || machine_is_assabet()        ||
	    machine_is_cerf()           || machine_is_flexanet()       ||
	    machine_is_freebird()       || machine_is_graphicsclient() ||
	    machine_is_graphicsmaster() || machine_is_lart()           ||
	    machine_is_omnimeter()      || machine_is_pfs168()         ||
	    machine_is_shannon()        || machine_is_simpad()         ||
	    machine_is_yopy()) {
		/*
		 * Setup the PPC unit correctly.
		 */
		PPDR &= ~PPC_RXD4;
		PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
		PSDR |= PPC_RXD4;
		PSDR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
		PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);

		Ser4MCSR = -1;
		Ser4MCCR1 = 0;
		Ser4MCCR0 = 0x00007f7f | MCCR0_ADM;

		/*
		 * Calculate the read/write timeout (us) from the bit clock
		 * rate.  This is the period for 3 64-bit frames.  Always
		 * round this time up.
		 */
		mcp->rw_timeout = (64 * 3 * 1000000 + mcp->sclk_rate - 1) /
				  mcp->sclk_rate;

		ret = mcp_register(mcp);
	}

	return ret;
}
/*
 * 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;
}