static void drive_vibr(void) { // VIBRATOR_CFG l4_uint8_t v = (1<<3)|(1<<2)|1; unsigned long s = 1; l4vbus_i2c_write(vbus, i2c_handle, 0x4b, 0x60, &v, 1); // configure mux //v = 0x10; //l4vbus_i2c_write(vbus, i2c_handle, 0x49, 0x92, &v, 1); l4_uint16_t w = (0x4 << 13)|(0x1 << 12)|(0x1 << 4)|(0xe); l4_uint8_t *p = (l4_uint8_t *)(&w); l4vbus_i2c_write(vbus, i2c_handle, 0x4b, 0x4b, &(p[1]), 1); l4vbus_i2c_write(vbus, i2c_handle, 0x4b, 0x4c, &(p[0]), 1); printf("WRITE:%x %x\n", p[1], p[0]); l4vbus_i2c_read(vbus, i2c_handle, 0x4b, 0x73, &v, &s); printf("VAUX1_TYPE:%x\n", v); l4vbus_i2c_read(vbus, i2c_handle, 0x4b, 0x74, &v, &s); printf("VAUX1_REMAP:%x\n", v); l4vbus_i2c_read(vbus, i2c_handle, 0x4b, 0x75, &v, &s); printf("VAUX1_DEDICATED:%x\n", v); l4vbus_i2c_read(vbus, i2c_handle, 0x4b, 0x76, &v, &s); printf("VAUX1_DEV_GRP:%x\n", v); }
static int enable_lcd_backlight(void) { l4_uint8_t val; #if 1 #else val = 0x32; int tmp=0; if (tmp=l4vbus_i2c_write(vbus, i2c_handle, T2_I2C_LED_ADDR_GROUP, TRITON2_LED_LEDEN_REG, &val, 1)) { printf("tmp=%d\n",tmp); return -1; } val = 0x7f; if (l4vbus_i2c_write(vbus, i2c_handle, T2_I2C_LED_ADDR_GROUP, TRITON2_LED_PWMAON_REG, &val, 1)) return -1; val = 0x7f; if (l4vbus_i2c_write(vbus, i2c_handle, T2_I2C_LED_ADDR_GROUP, TRITON2_LED_PWMBON_REG, &val, 1)) return -1; val = 0x7f; if (l4vbus_i2c_write(vbus, i2c_handle, T2_I2C_LED_ADDR_GROUP, TRITON2_LED_PWMAOFF_REG, &val, 1)) return -1; val = 0x7f; if (l4vbus_i2c_write(vbus, i2c_handle, T2_I2C_LED_ADDR_GROUP, TRITON2_LED_PWMBOFF_REG, &val, 1)) return -1; val = 0x0b; if (l4vbus_i2c_write(vbus, i2c_handle, 0x4b, TRITON2_VDAC_DEDICATED, &val, 1)) return -1; val = 0xe0; if (l4vbus_i2c_write(vbus, i2c_handle, 0x4b, TRITON2_VDAC_DEV_GRP, &val, 1)) return -1; #endif return 0; }
static int twl4030_i2c_write_u8(unsigned mod_no, l4_uint8_t value, l4_uint8_t reg) { return l4vbus_i2c_write(vbus, i2c_handle, twl4030_map[mod_no].sid, twl4030_map[mod_no].base + reg, &value, 1); }
static int kp_write(int reg, l4_uint8_t val) { return l4vbus_i2c_write(vbus, i2c_handle, twl4030_map[TWL4030_MODULE_KEYPAD].sid, twl4030_map[TWL4030_MODULE_KEYPAD].base + reg, &val, 1); }