byte MHD_Bridge_detect(void) { byte temp = 0; byte BridgeOn = 0; DisableInterrupts(); msleep(180); if(!gpio_get_value(GPIO_ACCESSORY_INT)&& MHD_HW_IsOn()) { temp = ReadIndexedRegister(INDEXED_PAGE_0, 0x09); if ((temp & RSEN) == 0x00) { BridgeOn = FALSE; //ReadModifyWriteTPI(0x79, SI_BIT_5 | SI_BIT_4, SI_BIT_4); //force HPD to 0 ReadModifyWriteIndexedRegister(INDEXED_PAGE_0, 0x79, SI_BIT_5 | SI_BIT_4, SI_BIT_4); } else { BridgeOn = TRUE; //ReadModifyWriteTPI(0x79, BIT_5 | BIT_4, 0); //back to current state } printk("[MHD] Bridge detect %x :: HPD %d\n",BridgeOn,gpio_get_value(GPIO_HDMI_HPD)); //ReadModifyWriteTPI(0x79, SI_BIT_5 | SI_BIT_4, 0); //back to current state ReadModifyWriteIndexedRegister(INDEXED_PAGE_0, 0x79, SI_BIT_5 | SI_BIT_4, 0); } MHD_INT_clear(); EnableInterrupts(); printk("[MHD]MHD_Bridge_detect -- \n"); return BridgeOn; }
byte MHD_Bridge_detect(void) { byte temp = 0; byte BridgeOn = 0; /* disable interrupts */ ReadModifyWriteTPI(TPI_INTERRUPT_ENABLE_REG, RECEIVER_SENSE_EVENT_MASK, 0x00); msleep(180); if(!gpio_get_value(TEGRA_GPIO_PI5)&& MHD_HW_IsOn()) //TEGRA_GPIO_PI5: GPIO_ACCESSORY_INT { temp = ReadIndexedRegister(INDEXED_PAGE_0, 0x09); if ((temp & RSEN) == 0x00) { BridgeOn = FALSE; //ReadModifyWriteTPI(0x79, SI_BIT_5 | SI_BIT_4, SI_BIT_4); //force HPD to 0 ReadModifyWriteIndexedRegister(INDEXED_PAGE_0, 0x79, SI_BIT_5 | SI_BIT_4, SI_BIT_4); } else { BridgeOn = TRUE; //ReadModifyWriteTPI(0x79, BIT_5 | BIT_4, 0); //back to current state } printk("[HDMI] Bridge detect %x :: HPD %d\n",BridgeOn,gpio_get_value(TEGRA_GPIO_PN7)); //TEGRA_GPIO_PN7: GPIO_HDMI_HPD //ReadModifyWriteTPI(0x79, SI_BIT_5 | SI_BIT_4, 0); //back to current state ReadModifyWriteIndexedRegister(INDEXED_PAGE_0, 0x79, SI_BIT_5 | SI_BIT_4, 0); } MHD_INT_clear(); /* enable interrupts */ WriteIndexedRegister(INDEXED_PAGE_0, 0x78, 0x01); printk("[HDMI]MHD_Bridge_detect -- \n"); return BridgeOn; }
void MHD_OUT_EN(void) { byte state , int_stat; int_stat = ReadIndexedRegister(INDEXED_PAGE_0,0x74); printk("[MHD]MHD_OUT_EN INT register value is: 0x%02x \n", int_stat); state = ReadIndexedRegister(INDEXED_PAGE_0, 0x81); printk("[MHD]MHD_OUT_EN register 0x81 value is: 0x%02x\n", state); if((state & 0x02) && (int_stat &0x01)) { printk("[MHD]MHD_OUT_EN :: enable output\n"); ReadModifyWriteIndexedRegister(INDEXED_PAGE_0,0x80,SI_BIT_4,0x0); msleep(20); ReadModifyWriteIndexedRegister(INDEXED_PAGE_0,0x80,SI_BIT_4,SI_BIT_4); msleep(60); set_mhd_power_active_mode(); mhd_tx_fifo_stable(); //fifo clear } MHD_INT_clear(); }
void MHD_OUT_EN(void) { byte state , int_stat; int_stat = ReadIndexedRegister(INDEXED_PAGE_0, 0x74); pr_info("[HDMI]MHD_OUT_EN INT register value is: 0x%02x\n", int_stat); state = ReadIndexedRegister(INDEXED_PAGE_0, 0x81); pr_info("[HDMI]MHD_OUT_EN register 0x81 value is: 0x%02x\n", state); if ((state & 0x02) && (int_stat & 0x01)) { pr_info("[HDMI]MHD_OUT_EN :: enable output\n"); ReadModifyWriteIndexedRegister(INDEXED_PAGE_0, 0x80, SI_BIT_4, 0x0); msleep(20); ReadModifyWriteIndexedRegister(INDEXED_PAGE_0, 0x80, SI_BIT_4, SI_BIT_4); msleep(60); /* set mhd power active mode */ ReadModifyWriteTPI(TPI_DEVICE_POWER_STATE_CTRL_REG, TX_POWER_STATE_MASK, 0x00); mhd_tx_fifo_stable(); /*fifo clear*/ } MHD_INT_clear(); }