Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2301806ybl; Thu, 19 Dec 2019 11:14:34 -0800 (PST) X-Google-Smtp-Source: APXvYqy1wg+tNHNG4mEfp34iHw7MlHfGIlivGjM+73OSQqJNHIx5Vk0CgCnwzQdbTOIPPL8AKerZ X-Received: by 2002:a9d:69ce:: with SMTP id v14mr10763954oto.248.1576782874142; Thu, 19 Dec 2019 11:14:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576782874; cv=none; d=google.com; s=arc-20160816; b=KvUlhTD88C1wSUGe6CZaFmt/v/lvkSUr8zjIsbg1RrRKCzaWXuO2zZVtLdWHV2EQSR iDXuBX3xu3nMf8DxSnRG3vEG8ivCC1d/MSCkJLV9j3dV9nVRK4FLne5IRaYqWSywcfq+ dN1LsIhqROwmN3fY7njqEO024B5UQjNFMpVCZJVuEkMCO3aSHnrw/doszmeZ2gGnkPjP J8Vj3Znp1uTgAnz7bsOY48GYJ7EQ99LUCYOByH9DrskSexTB19g4HUxVetbKcy+fa29a DhIsPpoQRu7I8X16NYwMf5GKLYMyirvCCCv54v0e2NPiuY7SIjg8EeEKh3MgoLaapV6/ dKZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DV9bvWfRPmR9/PyHBvj9WHIhay8wbHB4XtLeqjH95LQ=; b=k3HKMDnDMQ3NP8GIPD2pCOBSXGs5XZJsnsaIeW5IfSfEySRpbpoPlDuydHdwK+faVj xvKE/SWIl6BHzpr+HM9FPTB/oaqXfSovueAyLtA+Tw1g0p+1YcuDND06RTysu21V9XUk sxvArx0xTxzo85d25ZBcULG2c9y1pMSOPhuPkE3wNp08JDKHdg0t+op86TcEXao18442 fb2ZLnwDQvG/4JT0mQ6h16RwrfmlIE8xHkh63vS9pzGNSmrXxGad8Q4Pf3y0D9ciDmKQ 2X4mtubXJgAqppr2uFFwOQfn1SUhA942d6KtAdlCbWwiEZN924igF4hwUCfg7/Gyzd64 BMzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JxMJ1eED; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w19si3235117otj.209.2019.12.19.11.14.20; Thu, 19 Dec 2019 11:14:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JxMJ1eED; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727422AbfLSTNN (ORCPT + 99 others); Thu, 19 Dec 2019 14:13:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:52348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727215AbfLSSfk (ORCPT ); Thu, 19 Dec 2019 13:35:40 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 57F7D24672; Thu, 19 Dec 2019 18:35:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576780539; bh=2N4Y9xksKY4hiMNzYExeA6o7SGmT7mrkpbxqZrLxnAU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JxMJ1eEDhI2oCOgiDy9KMHDqoed53ZlJMeSr19lquInq4Pcw9K3VDVBj8fXB9qBD5 tYnk3e3WWWicvjjFKzy4+jjJRApGEo/ig8GviQG+aDfHxO+W5uCFK6rXUCTYkXpuYI EFIPBT9Jnle8BH1WtPExs08XefryC/DBjcaR4Zxs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Szyprowski , Chanwoo Choi , Sasha Levin Subject: [PATCH 4.4 016/162] extcon: max8997: Fix lack of path setting in USB device mode Date: Thu, 19 Dec 2019 19:32:04 +0100 Message-Id: <20191219183206.742077693@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183150.477687052@linuxfoundation.org> References: <20191219183150.477687052@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Szyprowski [ Upstream commit a2dc50914744eea9f83a70a5db0486be625e5dc0 ] MAX8997 driver disables automatic path selection from MicroUSB connector and manually sets path to either UART or USB lines. However the code for setting USB path worked only for USB host mode (when ID pin is set to ground). When standard USB cable (USB device mode) is connected, path registers are not touched. This means that once the non-USB accessory is connected to MAX8997-operated micro USB port, the path is no longer set to USB and USB device mode doesn't work. This patch fixes it by setting USB path both for USB and USB host modes. Signed-off-by: Marek Szyprowski Signed-off-by: Chanwoo Choi Signed-off-by: Sasha Levin --- drivers/extcon/extcon-max8997.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c index b2b13b3dce147..3d6b42f61f56e 100644 --- a/drivers/extcon/extcon-max8997.c +++ b/drivers/extcon/extcon-max8997.c @@ -320,12 +320,10 @@ static int max8997_muic_handle_usb(struct max8997_muic_info *info, { int ret = 0; - if (usb_type == MAX8997_USB_HOST) { - ret = max8997_muic_set_path(info, info->path_usb, attached); - if (ret < 0) { - dev_err(info->dev, "failed to update muic register\n"); - return ret; - } + ret = max8997_muic_set_path(info, info->path_usb, attached); + if (ret < 0) { + dev_err(info->dev, "failed to update muic register\n"); + return ret; } switch (usb_type) { -- 2.20.1