From patchwork Tue Nov 13 15:38:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 150983 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4547020ljp; Tue, 13 Nov 2018 07:39:03 -0800 (PST) X-Google-Smtp-Source: AJdET5d4xnDupWP17/bqr3ZA0HcOsnE7y1L3skH+RW31fQs6MOVd3VCZNGicMY4yei1UayexqyNB X-Received: by 2002:a17:902:1124:: with SMTP id d33-v6mr5745107pla.125.1542123542980; Tue, 13 Nov 2018 07:39:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542123542; cv=none; d=google.com; s=arc-20160816; b=0JrcuNAyUGhQ9pG/FiZ34ZA4LcyZVfuEEAtFwsB0Q2MnaegnwedWX2+FxORG/nNW+b synKdT0y/KnvIMyQJoCmkP7UEpLoupj9f4QN6rR+XbiA1BCwU+rfY17X8L9O11BaLo0m Dvvz8tbU3Vji8dnke2Jq//g/vlHnstOWBK4HCRka+WaMsA1xAPSDy7qW7HDrOSL4/EJ/ Y8x3GxaxmRjjw9kxV7aRqmkZg8XwoYzgik9+XKuq8xySPB8ikAdx0WfsMa1kkzsxhmFX 2BPfWA22Hbbi1M1ksBDFEM7TuFz4MMInW8qm8HnKmwYmy/5+itZXxAcncYXKuQy/V7sW 2sUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=TQ8VtZmvIHLdVstCwUNJPazAP1X+yjIsSYbTQCqoQ7A=; b=QqqdoSG9Al/Y3zGesQAGR/OU5WQv2CW/FGvv1crFfyzjPxLdtC2nb118QRHGPulE3f xVRu1t6jKV8r9akls24iYjgMAHlzSO0/ON86JbEboPelMbYdVUL8HoWejOuluOiUbFNP rZep/ZBkaTEirE/HrK0Fbuc/NiMDCFOl8g6UDr8oEK21RuFZiTjlBv6CoMMsdwmv0uvw 57pFI2jD0fSSBmLsSo4teT3zfoRkP5ce0MlDoZXXcDSGwIleV9ulrAevBBdRN0ZKykgn yBanEpLR+UEZ2zqQKKj6VHIj/kPe71ndSpkEUELou8dAmfYI9zgSgN7c2/jXJlYK2rNC MjCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=GanTvwju; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y40-v6si21759980pla.391.2018.11.13.07.39.02; Tue, 13 Nov 2018 07:39:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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=@samsung.com header.s=mail20170921 header.b=GanTvwju; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732298AbeKNBhj (ORCPT + 3 others); Tue, 13 Nov 2018 20:37:39 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:47744 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726932AbeKNBhj (ORCPT ); Tue, 13 Nov 2018 20:37:39 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181113153900euoutp0182c35984e8cabb4c47aef6ed8c08bb3f~muTCHJzaR1163911639euoutp01D; Tue, 13 Nov 2018 15:39:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181113153900euoutp0182c35984e8cabb4c47aef6ed8c08bb3f~muTCHJzaR1163911639euoutp01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1542123540; bh=TQ8VtZmvIHLdVstCwUNJPazAP1X+yjIsSYbTQCqoQ7A=; h=From:To:Cc:Subject:Date:References:From; b=GanTvwjuZZxUDorMUofvXHUOMUkgUiFlsq2hwmHoo3hBLODBuD0Xf9onh8f36g1Tr Qrx5QdvHUFkyt9ZzT9oR7uvrF1N7Rj08NzUmB7R3XJStYtTk3AS+Z83NCNGDuiOoN5 Ete6oYbyxviTmEzGAfAwouBhDDATT0vdzMvfgH7g= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181113153900eucas1p2e44118562a5b3f8143389fbac1358914~muTBt5jJO1887018870eucas1p2X; Tue, 13 Nov 2018 15:39:00 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id BB.94.04294.310FAEB5; Tue, 13 Nov 2018 15:38:59 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181113153859eucas1p1dfc17519a7e960096d2888e47ab18dd8~muTBAx8EI1617116171eucas1p1G; Tue, 13 Nov 2018 15:38:59 +0000 (GMT) X-AuditID: cbfec7f4-835ff700000010c6-89-5beaf0136c66 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id E7.DA.04128.210FAEB5; Tue, 13 Nov 2018 15:38:58 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PI50040T24VKX20@eusync1.samsung.com>; Tue, 13 Nov 2018 15:38:58 +0000 (GMT) From: Marek Szyprowski To: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , MyungJoo Ham , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH] extcon: max8997: Fix lack of path setting in USB device mode Date: Tue, 13 Nov 2018 16:38:47 +0100 Message-id: <20181113153847.14732-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprEIsWRmVeSWpSXmKPExsWy7djP87rCH15FG1zer2exccZ6VovrX56z Wpw/v4Hd4vKuOWwWM87vY7JYe+Quu8XtxhVsDuwem1Z1snn0bVnF6PF5k1wAcxSXTUpqTmZZ apG+XQJXxrfOBUwFS7krLh/exdbAuIizi5GTQ0LAROLmmcuMXYxcHEICKxgl5jy6wArhfGaU +D55DTNM1ezHD6GqljFK3HnVxA6SEBJoYJK49tcaxGYTMJToetvFBmKLCDhL3P7wjQXEZhZ4 yCix5aoCiC0s4C/x7loL2FAWAVWJDauWsILYvAK2EgvuXWWDWCYvsXrDAajFN1kljhzig7Bd JGb/XsQCYQtLvDq+hR3ClpG4PLmbBeQ4CYFmRon2GbPYIZweRomtc3ZATbWWOHz8IivERXwS k7ZNB9rAARTnlehoE4Io8ZDY2biHCeKxWImNRz8yTWCUWMDIsIpRPLW0ODc9tdgoL7Vcrzgx t7g0L10vOT93EyMwpk7/O/5lB+OuP0mHGAU4GJV4eB/ceBUtxJpYVlyZe4hRgoNZSYRX4RlQ iDclsbIqtSg/vqg0J7X4EKM0B4uSOG81w4NoIYH0xJLU7NTUgtQimCwTB6dUA2OFmseq4JhZ Irujaj56S248uu9DVDzf0wTZDpsHNtvXvWZdzhb2oDxCv+WMZGe4dtJRR9Psf9d7ZxYV/OS8 07HkeZJmvnkZx+tc1/6mWp91jKUCx5X26FUWNLdGnzptc/Pwta0MbdEGwg5BC2pDu4ylA6+d kej/Jvzp55HpvvOT3mbuFo8OVWIpzkg01GIuKk4EAKLMt46lAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrGJMWRmVeSWpSXmKPExsVy+t/xy7pCH15FG6xYZWOxccZ6VovrX56z Wpw/v4Hd4vKuOWwWM87vY7JYe+Quu8XtxhVsDuwem1Z1snn0bVnF6PF5k1wAcxSXTUpqTmZZ apG+XQJXxrfOBUwFS7krLh/exdbAuIizi5GTQ0LARGL244eMXYxcHEICSxgleh/+YoNwmpgk lr46zQZSxSZgKNH1tgvMFhFwlrj94RsLSBGzwENGiVdbjjCCJIQFfCW2rFgLZrMIqEpsWLWE FcTmFbCVWHDvKhvEOnmJ1RsOME9g5FrAyLCKUSS1tDg3PbfYSK84Mbe4NC9dLzk/dxMj0Pfb jv3csoOx613wIUYBDkYlHt4HN15FC7EmlhVX5h5ilOBgVhLhVXgGFOJNSaysSi3Kjy8qzUkt PsQozcGiJM573qAySkggPbEkNTs1tSC1CCbLxMEp1cDIyPs6X3ZeXt3Kf9G7OjPEzbN0jSq1 ynIv1qjknXBNz4ny4+q9k5wiEFnhUeL+IuSA07VFLwuvimkx9D8/b+f2KvPDLefIZVrqqe5f ze4/kxJkmSHG8mf1g3gPrh6WF523iydtFawKW/LgPo+T9fWsdUYvE589kTKfXP5+bv8ZrTOu 80PKK5VYijMSDbWYi4oTAel4BOX5AQAA X-CMS-MailID: 20181113153859eucas1p1dfc17519a7e960096d2888e47ab18dd8 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181113153859eucas1p1dfc17519a7e960096d2888e47ab18dd8 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org 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 --- drivers/extcon/extcon-max8997.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c index 632192d027bf..172e116ac1ce 100644 --- a/drivers/extcon/extcon-max8997.c +++ b/drivers/extcon/extcon-max8997.c @@ -311,12 +311,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) {