ths8200_write
ths8200_write(sd, reg, (ths8200_read(sd, reg) & clr_mask) | val_mask);
ths8200_write(sd, reg->reg & 0xff, reg->val & 0xff);
ths8200_write(sd, THS8200_DATA_CNTL, 0x70);
ths8200_write(sd, THS8200_DTG1_MODE, 0x87);
ths8200_write(sd, THS8200_DTG1_Y_SYNC_MSB, 0x00);
ths8200_write(sd, THS8200_DTG1_CBCR_SYNC_MSB, 0x00);
ths8200_write(sd, THS8200_DTG1_SPEC_A, bt->hsync);
ths8200_write(sd, THS8200_DTG1_SPEC_B, bt->hfrontporch);
ths8200_write(sd, THS8200_DTG1_SPEC_C, 0x00);
ths8200_write(sd, THS8200_DTG1_SPEC_D_LSB,
ths8200_write(sd, THS8200_DTG1_SPEC_E_LSB, 0x00);
ths8200_write(sd, THS8200_DTG1_SPEC_DEH_MSB,
ths8200_write(sd, THS8200_DTG1_SPEC_K_LSB, (bt->hfrontporch) & 0xff);
ths8200_write(sd, THS8200_DTG1_SPEC_K_MSB,
ths8200_write(sd, THS8200_DTG1_SPEC_G_LSB, (htotal(bt)/2) & 0xff);
ths8200_write(sd, THS8200_DTG1_SPEC_G_MSB,
ths8200_write(sd, THS8200_DTG1_TOT_PIXELS_MSB, htotal(bt) >> 8);
ths8200_write(sd, THS8200_DTG1_TOT_PIXELS_LSB, htotal(bt) & 0xff);
ths8200_write(sd, THS8200_DTG1_FRAME_FIELD_SZ_MSB,
ths8200_write(sd, THS8200_DTG1_FRAME_SZ_LSB, vtotal(bt) & 0xff);
ths8200_write(sd, THS8200_DTG1_FIELD_SZ_LSB, 0xff);
ths8200_write(sd, THS8200_DTG2_BP3_4_MSB, ((vtotal(bt)) >> 4) & 0x70);
ths8200_write(sd, THS8200_DTG2_BP1_LSB, line_start_active_video & 0xff);
ths8200_write(sd, THS8200_DTG2_BP2_LSB, line_start_front_porch & 0xff);
ths8200_write(sd, THS8200_DTG2_BP3_LSB, (vtotal(bt)) & 0xff);
ths8200_write(sd, THS8200_DTG2_LINETYPE1, 0x90);
ths8200_write(sd, THS8200_DTG2_LINETYPE2, 0x90);
ths8200_write(sd, THS8200_DTG2_HLENGTH_LSB, bt->hsync & 0xff);
ths8200_write(sd, THS8200_DTG2_HLENGTH_HDLY_LSB, htotal(bt));
ths8200_write(sd, THS8200_DTG2_VLENGTH1_LSB, (bt->vsync + 1) & 0xff);
ths8200_write(sd, THS8200_DTG2_VDLY1_LSB, vtotal(bt) + 1);
ths8200_write(sd, THS8200_DTG2_VLENGTH2_LSB, 0x00);
ths8200_write(sd, THS8200_DTG2_VLENGTH2_MSB_VDLY2_MSB, 0x07);
ths8200_write(sd, THS8200_DTG2_VDLY2_LSB, 0xff);
ths8200_write(sd, THS8200_DTG2_HS_IN_DLY_MSB, 0);
ths8200_write(sd, THS8200_DTG2_HS_IN_DLY_LSB, 0);
ths8200_write(sd, THS8200_DTG2_VS_IN_DLY_MSB, 0);
ths8200_write(sd, THS8200_DTG2_VS_IN_DLY_LSB, 0);
ths8200_write(sd, THS8200_DTG2_CNTL, 0x44 | polarity);