Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de6ff414 authored by Harry Yang's avatar Harry Yang
Browse files

power: smb5: Fix Type-C mode with non-compliant shorted cable



When a QC adapter is inserted with non-compliant shorted cable,
SMB5 charger shows shorted cable without Rp value (rp-std,
med or high), as a result, SW reports non typec connection.

Fix it by reporting 'Type-C non-compliant' instead.

CRs-Fixed: 2249471
Change-Id: I7899f92b3f0923661346c3305b9295ad85804586
Signed-off-by: default avatarHarry Yang <harryy@codeaurora.org>
parent b8900bc7
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -1991,6 +1991,8 @@ static int smblib_get_prop_ufp_mode(struct smb_charger *chg)
		return POWER_SUPPLY_TYPEC_SOURCE_MEDIUM;
		return POWER_SUPPLY_TYPEC_SOURCE_MEDIUM;
	case SNK_RP_3P0_BIT:
	case SNK_RP_3P0_BIT:
		return POWER_SUPPLY_TYPEC_SOURCE_HIGH;
		return POWER_SUPPLY_TYPEC_SOURCE_HIGH;
	case SNK_RP_SHORT_BIT:
		return POWER_SUPPLY_TYPEC_NON_COMPLIANT;
	default:
	default:
		break;
		break;
	}
	}
+2 −1
Original line number Original line Diff line number Diff line
@@ -252,10 +252,11 @@ enum {
 *  TYPEC Peripheral Registers  *
 *  TYPEC Peripheral Registers  *
 ********************************/
 ********************************/
#define TYPE_C_SNK_STATUS_REG			(TYPEC_BASE + 0x06)
#define TYPE_C_SNK_STATUS_REG			(TYPEC_BASE + 0x06)
#define DETECTED_SRC_TYPE_MASK			GENMASK(3, 1)
#define DETECTED_SRC_TYPE_MASK			GENMASK(3, 0)
#define SNK_RP_STD_BIT				BIT(3)
#define SNK_RP_STD_BIT				BIT(3)
#define SNK_RP_1P5_BIT				BIT(2)
#define SNK_RP_1P5_BIT				BIT(2)
#define SNK_RP_3P0_BIT				BIT(1)
#define SNK_RP_3P0_BIT				BIT(1)
#define SNK_RP_SHORT_BIT			BIT(0)


#define TYPE_C_SRC_STATUS_REG			(TYPEC_BASE + 0x08)
#define TYPE_C_SRC_STATUS_REG			(TYPEC_BASE + 0x08)
#define DETECTED_SNK_TYPE_MASK			GENMASK(4, 0)
#define DETECTED_SNK_TYPE_MASK			GENMASK(4, 0)