Add debug prints to log cable names to debug scenarios where
cable is inserted but extcon xlate driver fail to detect cable
type, set last cable in state to 0 when all the connected cables
detached from device.
Bug
1571110
Change-Id: I436c1e52f351e53788bc67b6feedf439bc3d2ee7
Signed-off-by: Venkat Reddy Talla <vreddytalla@nvidia.com>
Reviewed-on: http://git-master/r/716730
(cherry picked from commit
78d8733fb37a559ae4414e6b23f7103b0dd43a3e)
Signed-off-by: Venkat Reddy Talla <vreddytalla@nvidia.com>
Reviewed-on: http://git-master/r/839248
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
static int ecx_attach_cable(struct extcon_cable_xlate *ecx)
{
struct ecx_in_cables *in_cables;
- int mask_state;
+ int mask_state = 0;
int all_states = 0;
int new_state = -1;
int i;
if (new_state < 0) {
dev_err(ecx->dev, "Cable state 0x%04x is not defined\n",
all_states);
+ dev_err(ecx->dev,
+ "Last cable in state: 0x%04x, mask state: 0x%04x\n",
+ ecx->last_cable_in_state, mask_state);
mutex_unlock(&ecx->cable_lock);
return -EINVAL;
}
dev_info(ecx->dev, "Cable%d %s is attach\n",
i, ecx->pdata->out_cable_names[i]);
} else {
+ ecx->last_cable_in_state = 0;
dev_info(ecx->dev, "No cable attach\n");
}
}