From patchwork Mon Dec 16 17:45:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181792 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp4702963ile; Mon, 16 Dec 2019 10:50:29 -0800 (PST) X-Google-Smtp-Source: APXvYqwMDZq1obO+lKA6f7W4PR8PFW+n1H7ARvOibf/6fvIbDTV47zLZakv73PqSwZoWUN2MuilZ X-Received: by 2002:a05:6830:1691:: with SMTP id k17mr34283615otr.282.1576522229769; Mon, 16 Dec 2019 10:50:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576522229; cv=none; d=google.com; s=arc-20160816; b=HUYB4FhPvU+qms2ddW9zUt93yiMLKMDKnzyAnGfZSSqC4+WUlJRU3RuOtY4juKmf99 +xaVHbK3N6xZlMY5CL+PkZsJRrqzKFDSJvQuh605jM5g2grivEasJ2w/O3k5EWx8ZkdW pL42PT0eMPWGYRtHem5IeCzqxDOEDe5ycBFszIESPLmaiWeylINyQtWNB1omHaq3GDxK 1e2CwDffGQR5OmnA1qfLafTcIKNnQoWgkdXdnRuGXiaAUY8FiaY4K26CzHyBstkWRrtJ QDQ5Yu4uUai+6jPkKqCmHTxzUYp3PgrKLdD1em68ic4c55JRzSkEFHeEsWw8bKv1QHF7 X7QQ== 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=VxTgn0IHLIkoEeJ50HZEcqGLjXf7X3mGhsV85MERphk=; b=rX/XPbImJbSeCVkWm1ILKh4FqsJdgtuwTSvfDz7DrlVhNte4j/q7fpJS45mh1daq2A TCc/LZn6Ag6UfLe1ORwjSqCCvHdCyjeZ8jkUXNKWIXOywn1v1zgN3eTTxlp+FzVdd2fp BTpa8yj3o2A1NJFBeX9dNN+aQlwGM0z3vT2KGlkqW/jUMyKmY0YRDMhFbjTEnIPmCliA KfnvC4gfT3rCVRoXLBQkTp9elIcCOWE6EduB/RA0r4s+T9XFIL2DwyyB+WIZuO63GDdm XRUnV2D4cMyDIcbQZTaSPSCLa9sUFpkJIBXXe9IoCfpQHk91jBUWt7gA1xMjIkM6DkJK noSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vyjE06+O; 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 c13si12575333otd.109.2019.12.16.10.50.29; Mon, 16 Dec 2019 10:50:29 -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=vyjE06+O; 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 S1727831AbfLPSu2 (ORCPT + 27 others); Mon, 16 Dec 2019 13:50:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:41904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727024AbfLPRvi (ORCPT ); Mon, 16 Dec 2019 12:51:38 -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 36C42206EC; Mon, 16 Dec 2019 17:51:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576518697; bh=SQ+63E8dRGVFKoxnKVDyx3YwGbAdRpIHTG3O4filuZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vyjE06+Oszy3e0sG4+hjd03zqxSFaxhN5Z9VC3VTcG0hVLPIaQBRMRpGdrMy1SbPa 50yEQLpLYSjm4qsMJcYSA4Q8zZQed3UWI3Vk/RDqzwlEL6ZtEQUyJg65Si13jvy7c/ Bz2CgIhx/2RuLxgxIjlzZH8yZqFMiUBbDRZEv3fo= 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.14 030/267] extcon: max8997: Fix lack of path setting in USB device mode Date: Mon, 16 Dec 2019 18:45:56 +0100 Message-Id: <20191216174852.220072682@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174848.701533383@linuxfoundation.org> References: <20191216174848.701533383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 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(-) -- 2.20.1 diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c index 4a0612fb9c070..b9b48d45a6dc4 100644 --- a/drivers/extcon/extcon-max8997.c +++ b/drivers/extcon/extcon-max8997.c @@ -321,12 +321,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) {