Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp517995yba; Mon, 1 Apr 2019 10:54:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhkvLmx3N5RXGl5sTYWAxBlFnY7Di3rx5myFMHz+vOEVpy02YMNW6ydVnHXzl6tWN3a2Br X-Received: by 2002:a63:4620:: with SMTP id t32mr59340061pga.363.1554141283586; Mon, 01 Apr 2019 10:54:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554141283; cv=none; d=google.com; s=arc-20160816; b=pn7MSvmPaaVaJ3Ykvoq29/9DxFglh8WQcj3FRumgbALCFaSy2Bm6BuaE8rkqoIZkmn ikLtAjFEjK1GjHsX9uSM9Z9P+xuTgYsFNzrKotLWVbG3k5PDPg0ab64rBV8bsNvasyij dIUIjabUXb6x2tISagtxpYfT5dBXcmSE95ILz52UAnYz9ejhYh0da16Vi9wLme6yPX1Q pYVPI0A1uvRVbFR3p6j2rVzoNm+xn61DmxD1z2ynSorYQowA8wIa50iDCwjDjRNCNyj0 3QMRtILeE9/6HTc9Im5nKtr5SV6JrthwsCV13TdQdcflY6A3tV7DlOZy//MzXaI/dqxT kSVA== 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=k2wZinmnzh8YCdwRfJlstUNqDCZEUhR2kgSrxhabdyo=; b=CqoVTVnc4SAFgwcDQvk6Xip5NtSCX8oc2IjXbQ63Z7ROu7w8wTNjjPi8BEbEn57hyt MkfeW1gy0KVz5duu4UQdF5yWg33DPYbHcG9rigros99hUDM4L8T1LwaSW4UluVNAFLUy HwFjTLxvHcPKhYDRmKuQNjXI/boTdUGY2MwNxHZNkBaKOwdxep2XRDpA8lSWbL8evP8a nhGG30CXZNOjgdNKQeuPqJjxVQ/dHBzayTKz+p0+jpVE4FpShGtCt2rJBAnFcE/JLq3O Bi1gMRtqwxxNjklil6BvPnB7T+M3CzInimCiadDzHd2AhOMRyhXblcP7eeS4dRuwNy09 EPow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QVA0dg04; 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 q13si9232986pfi.208.2019.04.01.10.54.28; Mon, 01 Apr 2019 10:54:43 -0700 (PDT) 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=QVA0dg04; 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 S1732345AbfDARY5 (ORCPT + 99 others); Mon, 1 Apr 2019 13:24:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:55822 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731693AbfDARYz (ORCPT ); Mon, 1 Apr 2019 13:24:55 -0400 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 19C602063F; Mon, 1 Apr 2019 17:24:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554139494; bh=yAmgXM3EGQp5oG6ydysiZ5QkYvOcZDFqki/YVArSfQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QVA0dg04RZ6gHw9UwmIXpccNdgOnt31ml2BOq+AvMUVTHTO1u6+WNgG4lRoQBncCp f/LjTy3Qv5FXZWsrppZWlcL4OYG/YqGhKEuGG3LrvEKkWDBHWXZVE4v+SoC7krMREJ TmNBuH45d+eKTiGHXW/rLwYZtV7O1rMXA7VEHBgs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chen-Yu Tsai Subject: [PATCH 4.14 093/107] phy: sun4i-usb: Support set_mode to USB_HOST for non-OTG PHYs Date: Mon, 1 Apr 2019 19:02:48 +0200 Message-Id: <20190401170054.126730563@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190401170045.246405031@linuxfoundation.org> References: <20190401170045.246405031@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chen-Yu Tsai commit 1396929e8a903db80425343cacca766a18ad6409 upstream. While only the first PHY supports mode switching, the remaining PHYs work in USB host mode. They should support set_mode with mode=USB_HOST instead of failing. This is especially needed now that the USB core does set_mode for all USB ports, which was added in commit b97a31348379 ("usb: core: comply to PHY framework"). Make set_mode with mode=USB_HOST a no-op instead of failing for the non-OTG USB PHYs. Fixes: 6ba43c291961 ("phy-sun4i-usb: Add support for phy_set_mode") Signed-off-by: Chen-Yu Tsai Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/phy/allwinner/phy-sun4i-usb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c @@ -480,8 +480,11 @@ static int sun4i_usb_phy_set_mode(struct struct sun4i_usb_phy_data *data = to_sun4i_usb_phy_data(phy); int new_mode; - if (phy->index != 0) + if (phy->index != 0) { + if (mode == PHY_MODE_USB_HOST) + return 0; return -EINVAL; + } switch (mode) { case PHY_MODE_USB_HOST: