From patchwork Thu Dec 19 18:32:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 182188 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp897935iln; Thu, 19 Dec 2019 11:15:37 -0800 (PST) X-Google-Smtp-Source: APXvYqy8tug7sO5pXsrLPP0OhnOXWfaDOP7e8Kpi7CGHhWxjAvrRjoN0otUoyXTNhYvPTdSOMspu X-Received: by 2002:a9d:7f11:: with SMTP id j17mr10834108otq.281.1576782937311; Thu, 19 Dec 2019 11:15:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576782937; cv=none; d=google.com; s=arc-20160816; b=rFkiH4nsAuRjJX83hjtqa1+9L57SlMSmcvNERK0qqRV3IsbzCwdJczSzkKNsx1JPDA 8SHFGmXHqtFGJ5BVWyP+amICH3MbHMZHX8PSi6ADQLgrSJ+lfD8wc7KW8k/TOqIqEVRM NPQVGYfoMXZo9loPlRA6+O7stoP5pBHaCkzLw60BKn6ut0jEPv6ZEQISvS7ew5+GqVbE ke+8BA+AQhjs3fIgN0e5h9Dkemkj/7zsDA7XGoNBCZhSqz6n7YHjeVwWkzs8+tz/X2B7 OaJb9C4aYxLE1+NeInyIkawzx6VWBmBrlkbt3aWmBlIxFjhc3X9SxTtqs2CoNJTQu2Va jqXA== 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=UW4VxR4DylK8xZSI2Yt3f+uUIHYCz6ye9zVJ3Ve82kWu9BEQIDS3UggnhIOJrXEFJo Bz2Kd9RXVXRWkCyWqrqCq9IaV/GF4qNkRkk2Q+dgCd97LqZlX++w2y0PsfDz/jhIKTBw zA4SZD4u8kWaJBb8lLVSDahV8GzMlDPVBhVgSCCd+xOH8Nnoi7+aaFU/9AkLOF5r/SGo XptRNA9Bu9RAldRZmw/GaH1kFPG4t5EUljIH+vIjRPslViNwFZKVTaHR/5C+ezWHqESb 0VoMfhfpgCi24fhoxZGlMqMoojk5Ja4ydtIAct0b2m2TsuPXzKbT1WR3JQfy7uAhqVP3 u6zA== 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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 v26si3819910otj.0.2019.12.19.11.15.36; Thu, 19 Dec 2019 11:15:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726984AbfLSTNM (ORCPT + 14 others); Thu, 19 Dec 2019 14:13:12 -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 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 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) {