Example #1
0
int davinci_i2c_fix_ths7353_lockup( void )
{
    printk( "Toggle I2C clock to clear THS7353 false ACK\n" );

    PINMUX1 &= ~(1 << 7);

    request_gio( GIO_I2C_SCL );
    request_gio( GIO_I2C_SDA );

    gio_set_bitset( GIO_I2C_SCL );
    gio_set_bitset( GIO_I2C_SDA );

    gio_set_dir( GIO_I2C_SCL, 0 );
    gio_set_dir( GIO_I2C_SDA, 0 );

    gio_set_bitclr( GIO_I2C_SCL );
    udelay( 100 );
    gio_set_bitset( GIO_I2C_SCL );
    udelay( 100 );
    gio_set_bitclr( GIO_I2C_SCL );
    udelay( 100 );
    gio_set_bitset( GIO_I2C_SCL );
    udelay( 100 );

    unrequest_gio( GIO_I2C_SCL );
    unrequest_gio( GIO_I2C_SDA );

    udelay( 100 );
        
    return 0;
}
Example #2
0
static void ide_itdm320_hotplug(void)
{
// for now, we just toggle the LED...
	static int usb_enabled = 0;
	long unsigned int flags;
	static volatile long unsigned int count = 0;
	static volatile long unsigned i_jiffies;
	volatile long unsigned c_jiffies;
	c_jiffies = jiffies;
	spin_lock_irqsave(&it_hdd_lock,flags);
	if (count){//ignore comparison during very first interrupt
		if ((c_jiffies - i_jiffies) < 25){
			spin_unlock_irqrestore(&it_hdd_lock,flags);
			return;
			}
		}
	count = 1;
	if (usb_enabled){
		it_led_off(IT_LED_1);
		gio_set_bitclr(GIO_USB_ENABLE);
		gio_set_inv(GIO_USB_ENABLE,bit_hi);
		usb_enabled = 0;
		}
	else	{
		it_led_on(IT_LED_1);
		gio_set_bitset(GIO_USB_ENABLE);
		gio_set_inv(GIO_USB_ENABLE,bit_low);
		usb_enabled = 1;
		}
	i_jiffies = jiffies;
	spin_unlock_irqrestore(&it_hdd_lock,flags);
}