mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
Revert "(CR): PD: apply sc2150A vendor patch"
revert this change and will make a new one for vendor suggest Mot-CRs-fixed: (CR) This reverts commit 27e0bccf42e60c4dff61323fd0c03d45e2c24e39. Change-Id: I5837b3f9ebb5f9177c14848c662f5b5f5cc99d96 Reviewed-on: https://gerrit.mot.com/2213962 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Huosheng Liao <liaohs@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
3b1a54a3f4
commit
a8a1ee44bf
7 changed files with 1 additions and 85 deletions
|
|
@ -854,9 +854,6 @@ struct pd_port {
|
|||
struct tcpc_device *tcpc;
|
||||
struct mutex pd_lock;
|
||||
|
||||
/* miss msg */
|
||||
bool miss_msg;
|
||||
uint8_t rx_cap;
|
||||
/* PD */
|
||||
bool msg_output_lock;
|
||||
|
||||
|
|
@ -1616,9 +1613,6 @@ enum { /* pd_traffic_control */
|
|||
#define PD30_SINK_TX_OK TYPEC_CC_RP_3_0
|
||||
#define PD30_SINK_TX_NG TYPEC_CC_RP_1_5
|
||||
|
||||
void pd_add_miss_msg(struct pd_port *pd_port,struct pd_event *pd_event,
|
||||
uint8_t msg);
|
||||
|
||||
void pd_set_sink_tx(struct pd_port *pd_port, uint8_t cc);
|
||||
void pd_sync_sop_spec_revision(struct pd_port *pd_port);
|
||||
void pd_sync_sop_prime_spec_revision(struct pd_port *pd_port, uint8_t rev);
|
||||
|
|
|
|||
|
|
@ -785,7 +785,6 @@ int pd_reset_protocol_layer(struct pd_port *pd_port, bool sop_only)
|
|||
|
||||
int pd_set_rx_enable(struct pd_port *pd_port, uint8_t enable)
|
||||
{
|
||||
pd_port->rx_cap = enable;
|
||||
return tcpci_set_rx_enable(pd_port->tcpc, enable);
|
||||
}
|
||||
|
||||
|
|
@ -1362,33 +1361,6 @@ void pd_lock_msg_output(struct pd_port *pd_port)
|
|||
pd_dbg_info_lock();
|
||||
}
|
||||
|
||||
void pd_add_miss_msg(struct pd_port *pd_port,struct pd_event *pd_event,
|
||||
uint8_t msg)
|
||||
{
|
||||
struct pd_msg *pd_msg = pd_event->pd_msg;
|
||||
struct pd_msg * miss_msg = NULL;
|
||||
uint8_t sop_type = 0;
|
||||
struct pd_event evt = {
|
||||
.event_type = PD_EVT_CTRL_MSG,
|
||||
.msg = msg,
|
||||
.pd_msg = NULL,
|
||||
};
|
||||
if (pd_msg != NULL) {
|
||||
sop_type = pd_msg->frame_type;
|
||||
}
|
||||
pd_put_event(pd_port->tcpc,&evt,true);
|
||||
miss_msg = pd_alloc_msg(pd_port->tcpc);
|
||||
if (miss_msg == NULL) {
|
||||
return;
|
||||
}
|
||||
if (pd_msg != NULL)
|
||||
memcpy(miss_msg,pd_msg,sizeof(struct pd_msg));
|
||||
|
||||
pd_put_pd_msg_event(pd_port->tcpc,miss_msg);
|
||||
pd_port->pe_data.msg_id_rx[sop_type]--;
|
||||
return;
|
||||
}
|
||||
|
||||
void pd_unlock_msg_output(struct pd_port *pd_port)
|
||||
{
|
||||
if (!pd_port->msg_output_lock)
|
||||
|
|
|
|||
|
|
@ -1065,17 +1065,9 @@ static inline bool pd_try_get_vdm_event(
|
|||
{
|
||||
bool ret = false;
|
||||
struct pd_port *pd_port = &tcpc->pd_port;
|
||||
int rv = 0;
|
||||
uint32_t chip_id;
|
||||
rv = tcpci_get_chip_id(tcpc, &chip_id);
|
||||
|
||||
switch (pd_port->pe_pd_state) {
|
||||
#ifdef CONFIG_USB_PD_PE_SINK
|
||||
case PE_SNK_TRANSITION_SINK:
|
||||
if (!rv && SC2150A_DID == chip_id) {
|
||||
ret = pd_get_vdm_event(tcpc, pd_event);
|
||||
}
|
||||
break;
|
||||
case PE_SNK_READY:
|
||||
ret = pd_get_vdm_event(tcpc, pd_event);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -569,12 +569,6 @@ static inline bool pe_is_valid_pd_msg_id(struct pd_port *pd_port,
|
|||
return false;
|
||||
}
|
||||
|
||||
if (((pd_port->pe_data.msg_id_rx[sop_type] + 2) % PD_MSG_ID_MAX)
|
||||
== msg_id) {
|
||||
PE_INFO("Miss Msg!!!\n");
|
||||
pd_port->miss_msg = true;
|
||||
}
|
||||
|
||||
pd_port->pe_data.msg_id_rx[sop_type] = msg_id;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -773,8 +767,6 @@ bool pd_process_event(
|
|||
bool ret = false;
|
||||
struct pd_msg *pd_msg = pd_event->pd_msg;
|
||||
uint8_t tii = pe_check_trap_in_idle_state(pd_port, pd_event);
|
||||
int rv = 0;
|
||||
uint32_t chip_id = 0;
|
||||
|
||||
if (tii < TII_PE_RUNNING)
|
||||
return tii;
|
||||
|
|
@ -798,23 +790,6 @@ bool pd_process_event(
|
|||
PE_TRANSIT_STATE(pd_port, PE_ERROR_RECOVERY);
|
||||
return true;
|
||||
}
|
||||
rv = tcpci_get_chip_id(pd_port->tcpc, &chip_id);
|
||||
if (!rv && (SC2150A_DID == chip_id) &&pd_port->miss_msg) {
|
||||
if (pd_port->pe_pd_state == PE_SNK_TRANSITION_SINK) {
|
||||
pd_add_miss_msg(pd_port,pd_event,PD_CTRL_PS_RDY);
|
||||
} else if (pd_port->pe_pd_state == PE_SNK_SELECT_CAPABILITY){
|
||||
switch (pd_event->msg) {
|
||||
case PD_CTRL_PS_RDY:
|
||||
pd_add_miss_msg(pd_port,pd_event,PD_CTRL_ACCEPT);
|
||||
break;
|
||||
case PD_DATA_SOURCE_CAP:
|
||||
pd_add_miss_msg(pd_port,pd_event,PD_CTRL_REJECT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
pd_port->miss_msg = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
pd_copy_msg_data_from_evt(pd_port, pd_event);
|
||||
|
|
|
|||
|
|
@ -958,14 +958,7 @@ static int rt1711_get_cc(struct tcpc_device *tcpc, int *cc1, int *cc2)
|
|||
static int rt1711_enable_vsafe0v_detect(
|
||||
struct tcpc_device *tcpc, bool enable)
|
||||
{
|
||||
int ret = 0;
|
||||
struct rt1711_chip *chip = tcpc_get_dev_data(tcpc);
|
||||
|
||||
if (chip->chip_id == SC2150A_DID) {
|
||||
enable = true;
|
||||
}
|
||||
|
||||
ret = rt1711_i2c_read8(tcpc, RT1711H_REG_RT_MASK);
|
||||
int ret = rt1711_i2c_read8(tcpc, RT1711H_REG_RT_MASK);
|
||||
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -209,12 +209,6 @@ static int tcpci_alert_recv_msg(struct tcpc_device *tcpc)
|
|||
int rv = 0;
|
||||
struct pd_msg *pd_msg = NULL;
|
||||
enum tcpm_transmit_type type = TCPC_TX_SOP;
|
||||
uint32_t chip_id = 0;
|
||||
|
||||
rv = tcpci_get_chip_id(tcpc, &chip_id);
|
||||
if (!rv && (SC2150A_DID == chip_id)) {
|
||||
tcpci_set_rx_enable(tcpc, PD_RX_CAP_PE_STARTUP);
|
||||
}
|
||||
|
||||
pd_msg = pd_alloc_msg(tcpc);
|
||||
if (pd_msg == NULL) {
|
||||
|
|
@ -229,9 +223,6 @@ static int tcpci_alert_recv_msg(struct tcpc_device *tcpc)
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (!rv && (SC2150A_DID == chip_id)) {
|
||||
tcpci_set_rx_enable(tcpc, tcpc->pd_port.rx_cap);
|
||||
}
|
||||
pd_msg->frame_type = type;
|
||||
pd_put_pd_msg_event(tcpc, pd_msg);
|
||||
out:
|
||||
|
|
|
|||
|
|
@ -1922,7 +1922,6 @@ static inline bool typec_check_false_ra_detach(struct tcpc_device *tcpc)
|
|||
|
||||
if (drp) {
|
||||
tcpci_set_cc(tcpc, TYPEC_CC_DRP);
|
||||
typec_enable_low_power_mode(tcpc, TYPEC_CC_DRP);
|
||||
tcpci_alert_status_clear(tcpc,
|
||||
TCPC_REG_ALERT_EXT_RA_DETACH);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue