From patchwork Thu Dec 19 18:31:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182160 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp857463iln; Thu, 19 Dec 2019 10:42:39 -0800 (PST) X-Google-Smtp-Source: APXvYqzW27iGq2r/N5WR4Ctf/4ZJYOQzgG8LdZNTm3Fh7IFNZ7hUaXf8InvBIgA2XUsJ9yioaM2/ X-Received: by 2002:a9d:2264:: with SMTP id o91mr10455437ota.328.1576780959893; Thu, 19 Dec 2019 10:42:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576780959; cv=none; d=google.com; s=arc-20160816; b=LCDQiaaHNYnlpzzhE/OLnEGytD5U+cKmSXgICvZGvTcAklBUEQc75s4VZjmnB8fhg5 8Aam9S32Tt8ajXNjoQzq7UYqBvZ68c0+K/heGkCHzUz93/IeaXuu86Rrzk/cog6Q7Rk6 MG7eywNsqAM6mI406czipjG1ylBonzfdkCb+fbSMjG2Z0DAtZB4AllSDPUgjlQgIERLr Bz7VT09mb4I5QZo/dB2T8O9k/xmnn8ejnG/A7R1UMCtqWbpo4QzQtqfk2BC0/5yYIhy6 OpXcYoXVdxBu8bUnMovZK7yWiTmVKuKnWE01FVN+lIHzv1VwYcHGh8xaVJ13KLqE3aL8 RRFQ== 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=Qy6QRyU1JGkr334FLURqR7rAN627NCy/8ijP/2bCMgCivaaKpRpRSZOYKF9S/SGnCU 5TUrO7y03q2ZgfzMZn6RsJD+7ZVnifn4hpkGH3r32PvMFZbYYQjFQuGRVnagS0n2KjW0 tJZvhuiws7Jvd+Pcm1n7EuwxauOyU2gpk+6oGB8fS/XpRgaOzjjC+S6hCnPMUF/gO9mG rZ8zxoY03AfhxKy6Xp9gCK1Kse+W+RLy0LDW+GVX2KCQgVMOzMjN1RBplr52QxSNz72m stAiC7wg3OTptNVgpWEaLMEOMOvkxfz36HRdyaDCd2zH3nzn9I5PG3hDSFQsgXdwl+a6 YA4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kyvfdWcS; 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 w68si3314398oia.223.2019.12.19.10.42.39; Thu, 19 Dec 2019 10:42:39 -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=kyvfdWcS; 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 S1728723AbfLSSmi (ORCPT + 27 others); Thu, 19 Dec 2019 13:42:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:33814 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728695AbfLSSmd (ORCPT ); Thu, 19 Dec 2019 13:42:33 -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 AFB0024672; Thu, 19 Dec 2019 18:42:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576780953; bh=SQ+63E8dRGVFKoxnKVDyx3YwGbAdRpIHTG3O4filuZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kyvfdWcSrs9jmHX9/aB7OatsyAwCZ9beiJjWMRmkZcV6gr+NUes6zyEfM9asQOFtR yGjmuc2/fIyFXwa2+ZU3r6o5vm0d0YFGdHOElGe8VgvHVQc3PdWi+OJeUiJJJCNZq1 FQIRP2a7DCOIrfgVkX9GADSK4OFnuZHLLxjSu60Q= 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.9 022/199] extcon: max8997: Fix lack of path setting in USB device mode Date: Thu, 19 Dec 2019 19:31:44 +0100 Message-Id: <20191219183216.039083350@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183214.629503389@linuxfoundation.org> References: <20191219183214.629503389@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) {