int dlpc_init(void) { int timeout = 1000; /* Enable 14.318MHz CLK on CLKIN */ dlpc_write_register(0x29, 0xa0); while(!(dlpc_read_register(0x29) & 0x10) && timeout--) udelay(1000); if (!timeout) return 1; /* Select DLPC module */ dlpc_write_register(0x07, 0x19); /* DLPC Base Address */ dlpc_write_register(0x60, (DLPC_CONTROL >> 8) & 0xff); dlpc_write_register(0x61, DLPC_CONTROL & 0xff); /* Activate DLPC */ dlpc_write_register(0x30, 0x01); /* Reset docking state */ outb(0x00, DLPC_CONTROL); dlpc_gpio_init(); return 0; }
int dlpc_init(void) { int timeout = 1000; /* Enable 14.318MHz CLK on CLKIN */ dlpc_write_register(0x29, 0xa0); while(!(dlpc_read_register(0x29) & 0x10) && timeout--) udelay(1000); if (!timeout) return 1; /* Select DLPC module */ dlpc_write_register(0x07, 0x19); /* DLPC Base Address 0x164c */ dlpc_write_register(0x60, 0x16); dlpc_write_register(0x61, 0x4c); /* Activate DLPC */ dlpc_write_register(0x30, 0x01); outb(0x07, 0x164c); timeout = 1000; while(!(inb(0x164c) & 8) && timeout--) udelay(1000); if (!timeout) { /* docking failed, disable DLPC switch */ outb(0x00, 0x164c); dlpc_write_register(0x30, 0x00); return 1; } dlpc_gpio_init(); return 0; }