Compare commits

...

7 Commits

Author SHA1 Message Date
91b2fd7a0b Old flo_defconfig 2021-04-05 22:42:00 -04:00
e78b0f87d8 Merge branch 'flo' of https://tonoxisisle.services/git/Tononix/ubports_kernel_google_msm into flo 2021-04-05 22:38:16 -04:00
75d02e6a47 Hello world config 2021-04-05 22:37:59 -04:00
11acd1e2cb More slimport changes. 2021-04-05 22:30:30 -04:00
1c11e00dec slimport: Add slimport detection function (completed orig patch) 2021-04-05 22:22:42 -04:00
9ec4f16645 slimport: anx7808: Improve the cable detection.
The device might fall in abnormal state in slimport with power on.
The slimport couldn't detect the cable correctly at that time.
We make a sure that the slimport is in power off before turning it on
to avoid that issue.
2021-04-05 22:17:06 -04:00
51c894d695 Turned off HDCP by default since it stops the display from enabling. 2021-04-05 22:05:31 -04:00
2 changed files with 4109 additions and 18 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -46,12 +46,16 @@ struct anx7808_data {
int cab_irq;
};
// We're disabling HDCP by default as it fucks with the display.
/**
#ifdef HDCP_EN
static bool hdcp_enable = 1;
#else
static bool hdcp_enable = 0;
#endif
*/
static bool hdcp_enable = 0;
extern void msm_otg_id_pin_irq_enabled(bool enabled);
//extern void msm_otg_id_pin_irq_enabled(bool enabled);
@@ -126,11 +130,11 @@ void sp_tx_hardware_poweron(void)
mdelay(5);
gpio_set_value(pdata->gpio_reset, 0);
msleep(1);
gpio_set_value(pdata->gpio_p_dwn, 0);
msleep(2);
pdata->switch_power(1);
msleep(20);
gpio_set_value(pdata->gpio_p_dwn, 0);
msleep(10);
pdata->switch_power(1);
msleep(100);
gpio_set_value(pdata->gpio_reset, 1);
SP_DEV_DBG("%s: anx7808 power on\n", __func__);
@@ -172,10 +176,30 @@ int slimport_read_edid_block(int block, uint8_t *edid_buf)
}
EXPORT_SYMBOL(slimport_read_edid_block);
static void sp_tx_power_down_and_init(void)
{
sp_tx_vbus_powerdown();
sp_tx_pull_down_id(FALSE);
sp_tx_power_down(SP_TX_PWR_REG);
sp_tx_power_down(SP_TX_PWR_TOTAL);
sp_tx_hardware_powerdown();
sp_tx_pd_mode = 1;
sp_tx_link_config_done = 0;
sp_tx_hw_lt_enable = 0;
sp_tx_hw_lt_done = 0;
sp_tx_rx_type = RX_NULL;
sp_tx_rx_type_backup = RX_NULL;
sp_tx_set_sys_state(STATE_CABLE_PLUG);
}
static void slimport_cable_plug_proc(struct anx7808_data *anx7808)
{
if (gpio_get_value_cansleep(anx7808->pdata->gpio_cbl_det)) {
/* Previously, if sp tx is turned on, turn it off to avoid the cable detection error. */
if(!sp_tx_pd_mode)
sp_tx_power_down_and_init();
/* debounce time for avoiding glitch */
msleep(50);
if (gpio_get_value_cansleep(anx7808->pdata->gpio_cbl_det)) {
if (sp_tx_pd_mode) {
@@ -231,18 +255,7 @@ static void slimport_cable_plug_proc(struct anx7808_data *anx7808)
}
}
} else if (sp_tx_pd_mode == 0) {
sp_tx_vbus_powerdown();
sp_tx_pull_down_id(FALSE);
sp_tx_power_down(SP_TX_PWR_REG);
sp_tx_power_down(SP_TX_PWR_TOTAL);
sp_tx_hardware_powerdown();
sp_tx_pd_mode = 1;
sp_tx_link_config_done = 0;
sp_tx_hw_lt_enable = 0;
sp_tx_hw_lt_done = 0;
sp_tx_rx_type = RX_NULL;
sp_tx_rx_type_backup = RX_NULL;
sp_tx_set_sys_state(STATE_CABLE_PLUG);
sp_tx_power_down_and_init();
}
}
@@ -496,7 +509,8 @@ static int anx7808_i2c_probe(struct i2c_client *client,
anx7808->pdata = client->dev.platform_data;
i2c_set_clientdata(client, anx7808);
memcpy(&anx7808_client, &client, sizeof(client));
/* memcpy(&anx7808_client, &client, sizeof(client)); */
anx7808_client = client;
mutex_init(&anx7808->lock);
spin_lock_init(&anx7808->pdata->lock);
@@ -603,6 +617,7 @@ err2:
err1:
anx7808_free_gpio(anx7808);
err0:
anx7808_client = NULL;
kfree(anx7808);
exit:
return ret;