Example #1
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;
}
Example #2
0
static int __init bus_init(void)
{
	struct bit_data *bit = &bit_data;
	unsigned long flags;
	int ret;

	if (machine_is_assabet() || machine_is_pangolin()) {
		bit->sda     = GPIO_GPIO15;
		bit->scl     = GPIO_GPIO18;
		bit->l3_mode = GPIO_GPIO17;
	}

	if (machine_is_h3600() || machine_is_h3100()) {
		bit->sda     = GPIO_GPIO14;
		bit->scl     = GPIO_GPIO16;
		bit->l3_mode = GPIO_GPIO15;
	}

	if (machine_is_stork()) {
		bit->sda     = GPIO_GPIO15;
		bit->scl     = GPIO_GPIO18;
		bit->l3_mode = GPIO_GPIO17;
	}

	if (!bit->sda)
		return -ENODEV;

	/*
	 * Default level for L3 mode is low.
	 * We set SCL and SDA high (i2c idle state).
	 */
	local_irq_save(flags);
	GPDR &= ~(bit->scl | bit->sda);
	GPCR = bit->l3_mode | bit->scl | bit->sda;
	GPDR |= bit->l3_mode;
	local_irq_restore(flags);

	if (machine_is_assabet()) {
		/*
		 * Release reset on UCB1300, ADI7171 and UDA1341.  We
		 * need to do this here so that we can communicate on
		 * the I2C/L3 buses.
		 */
		ASSABET_BCR_set(ASSABET_BCR_CODEC_RST);
		mdelay(1);
		ASSABET_BCR_clear(ASSABET_BCR_CODEC_RST);
		mdelay(1);
		ASSABET_BCR_set(ASSABET_BCR_CODEC_RST);
	}

	ret = i2c_init(bit);
	if (ret == 0 && bit->l3_mode) {
		ret = l3_init(bit);
		if (ret)
			i2c_exit();
	}

	return ret;
}
Example #3
0
static int __init h3600_uda1341_init(void)
{
	int ret = -ENODEV;

	if (!machine_is_h3600() || machine_is_h3100() || machine_is_h3800())
		ret = driver_register(&h3x00_audio_driver);

	return ret;
}
int __devinit pcmcia_h3600_init(struct device *dev)
{
	int ret = -ENODEV;

	if (machine_is_h3600() || machine_is_h3100())
		ret = sa11xx_drv_pcmcia_probe(dev, &h3600_pcmcia_ops, 0, 2);

	return ret;
}
Example #5
0
int __init h3600_micro_init( void )
{
	int result = 0;

	if (machine_is_h3600() || machine_is_h3100()) {
		result = h3600_micro_setup();
		if ( !result )
			result = h3600_hal_register_interface( g_micro_ops );
		return result;
	} else {
		return -ENODEV;
	}
}
Example #6
0
static int __init h3600_init_model_ops(void)
{
    if (machine_is_h3xxx()) {
        if (machine_is_h3100()) {
            ipaq_model_ops = h3100_model_ops;
        } else if (machine_is_h3600()) {
            ipaq_model_ops = h3600_model_ops;
        } else if (machine_is_h3800()) {
            ipaq_model_ops = h3800_model_ops;
        }
        init_h3600_egpio();
    }
    return 0;
}
Example #7
0
void __exit h3600_micro_cleanup( void )
{
	if (machine_is_h3600() || machine_is_h3100()) {
		h3600_hal_unregister_interface( g_micro_ops );

		free_irq(IRQ_Ser1UART, h3600_micro_serial_isr);
		free_irq(IRQ_GPIO_H3600_ACTION_BUTTON, h3600_micro_action_isr);
		free_irq(IRQ_GPIO_H3600_NPOWER_BUTTON, h3600_micro_power_isr);
		free_irq(IRQ_GPIO_H3600_OPT_DET,       h3600_micro_sleeve_isr);

		h3600_unregister_pm_callback( h3600_micro_pm_callback );

		if ( micro_proc_dir ) {
			remove_proc_entry(H3600_MICRO_PROC_STATS, micro_proc_dir);
			remove_proc_entry(H3600_MICRO_PROC_DIR, NULL );
			micro_proc_dir = NULL;
		}
	}
}
Example #8
0
static int h3600_micro_setup( void )
{
	int result, i;

        printk("%s: setting up microcontroller interface\n", __FUNCTION__);

	if ( machine_is_h3100() ) {
		g_micro_ops = &h3100_micro_ops;
	} 
	else if ( machine_is_h3600() ) {
		g_micro_ops = &h3600_micro_ops;
	}
	else {
		printk("%s: illegal iPAQ model %s\n", __FUNCTION__, h3600_generic_name() );
		return -ENODEV;
	}

	/* Set up our structures */
	for(i = 0; i < NUM_HANDLERS; i++)
	{
		init_waitqueue_head((wait_queue_head_t *) &g_handlers[i].waitq );
	}
	init_MUTEX((struct semaphore *) &g_txdev.lock );

	/* Start working */
	h3600_micro_reset_comm();

	/* Set up interrupts */
	result = request_irq(IRQ_Ser1UART, h3600_micro_serial_isr, SA_SHIRQ | SA_INTERRUPT | SA_SAMPLE_RANDOM,
                             "h3600_ts", h3600_micro_serial_isr);
	if ( result ) {
		printk(KERN_CRIT "%s: unable to grab serial port IRQ\n", __FUNCTION__);
		return result;
	}

	result = request_irq(IRQ_GPIO_H3600_ACTION_BUTTON, 
			     h3600_micro_action_isr, 
			     SA_SHIRQ | SA_INTERRUPT | SA_SAMPLE_RANDOM,
			     "h3600_action", h3600_micro_action_isr);
        set_irq_type( IRQ_GPIO_H3600_ACTION_BUTTON, IRQT_BOTHEDGE );

	if ( result ) {
		printk(KERN_CRIT "%s: unable to grab action button IRQ\n", __FUNCTION__);
		goto failed0;
	}

	result = request_irq(IRQ_GPIO_H3600_NPOWER_BUTTON, 
			     h3600_micro_power_isr, 
			     SA_SHIRQ | SA_INTERRUPT | SA_SAMPLE_RANDOM,
			     "h3600_suspend", h3600_micro_power_isr);
        set_irq_type( IRQ_GPIO_H3600_NPOWER_BUTTON, IRQT_BOTHEDGE );

	if ( result ) {
		printk(KERN_CRIT "%s: unable to grab power button IRQ\n", __FUNCTION__);
		goto failed1;
	}

	result = request_irq(IRQ_GPIO_H3600_OPT_DET, h3600_micro_sleeve_isr, 
			     SA_SHIRQ | SA_INTERRUPT | SA_SAMPLE_RANDOM,
                             "h3600_sleeve", h3600_micro_sleeve_isr);
        set_irq_type( IRQ_GPIO_H3600_OPT_DET, IRQT_BOTHEDGE );
	
	if ( result ){
		printk(KERN_CRIT "%s: unable to grab option pack detect IRQ\n", __FUNCTION__);
		goto failed2;
	}

	/* Register in /proc filesystem */
	micro_proc_dir = proc_mkdir(H3600_MICRO_PROC_DIR, NULL);
	if ( micro_proc_dir )
		create_proc_read_entry(H3600_MICRO_PROC_STATS, 0, micro_proc_dir, 
				       h3600_micro_proc_stats_read, NULL );
	else
		printk(KERN_ALERT "%s: unable to create proc entry %s\n", __FUNCTION__, H3600_MICRO_PROC_DIR);

	/* Register with power management */
	h3600_register_pm_callback( h3600_micro_pm_callback );

	/* Set some GPIO direction registers */
	GPDR |= (GPIO_H3600_CLK_SET0 | GPIO_H3600_CLK_SET1);

	return 0;
 failed2:
		free_irq( IRQ_GPIO_H3600_NPOWER_BUTTON, h3600_micro_power_isr);
 failed1:
		free_irq( IRQ_GPIO_H3600_ACTION_BUTTON, h3600_micro_action_isr );
 failed0:
		free_irq( IRQ_Ser1UART, h3600_micro_serial_isr );
		return result;
}