Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp483094yba; Mon, 1 Apr 2019 10:11:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIKM+iphAtj5U6JvPF3O3zo2u1pKesynOw1HFU6ll3KNKXFsd0N9ALlfOyCI1+ndWE3+fl X-Received: by 2002:a62:2a97:: with SMTP id q145mr64842095pfq.22.1554138705166; Mon, 01 Apr 2019 10:11:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554138705; cv=none; d=google.com; s=arc-20160816; b=XG8H//2tSGe4emTTEdDdRhKAWA1t5YMBbohKGzz2bkEody1lenwApcRVMkr5eSkRYe 4TF7FbHvia1SF14GOKksgfCBtn3mXmJ5VnrVYDdcsmTEXjz3FM2ETLpzo1igDbI5eylG RziTGuisXQkBz6xR/Xf0pDyqZ4sLEXuqpKLSs2jhO9a+FEktZj2pIhnF5MOOyhqaVwDT tWfCFiymae84ZXCFGzghQF1ZAc1jNDsbJ8o8A2fFrAOu+ON0OWA5sRPGl2+kUTMg4lAI eSPR7F2iGXkoVnFnlUU5I4y96iTmIrKl+zxaE9CQ52xDpkWQHEgK7pHjbZuFAJj+ucbv gZ7w== 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=zeKX9buhmweQVV5CbD2c54+4vfFkk6ITeOYsObU8qkw=; b=cwavjgZ0TxqkpbsRKTnIYsF2wAct1qpa1O+O6emyTqA75JSd7U7a/ke2Yg5aUlobV0 zB5iS/wPVuIDxlh6m5DNpdmd9ulSZyLGtmcFdDLu379iOz1CXkt+mH/dtgQuD/DyyZeq YUh3USgU/lzfZfA3Fl4XilA0Yi2fdIqgmJjbIZErmrlUCl4SddCCIydyxqYGE2ho8oue 4MKu+pZWWk+vVQCg6uquauffr4Zh4tW0gyjO4vfZXqXm+81leBHyFIydTcWKbqaNm+Kl BnuiFPM7Z6q3jEAAwshondys1bEe8NNS7Ge9p9axflAJ+YA2fL0T6YXFc2wS4pjUGL2m 4X0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=csouvXCm; 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 v4si9079424pgr.591.2019.04.01.10.11.29; Mon, 01 Apr 2019 10:11:45 -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=csouvXCm; 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 S1729892AbfDARKE (ORCPT + 99 others); Mon, 1 Apr 2019 13:10:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:57396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729121AbfDARKD (ORCPT ); Mon, 1 Apr 2019 13:10:03 -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 2E26A206B8; Mon, 1 Apr 2019 17:10:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554138602; bh=G0zWZOrLHjQgQ/Zb5hP09wHTSh2GXqYagcs7Z/bPMEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=csouvXCmxq6PS+UyT/EM1vECsI9nFK6mXCGnz/h5/sVYr9g4wYFBitWG1kZgk8hWi p3ylnHoK2JcRqVH05+ycJysEPHmz9zDMWeqPds78FJdWpOY8w7S5eGXVa3+lnerKrW O6wUlQpeYLnZyDtmzsYLZGGqHPqaoE2MWbkQTPOA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chen-Yu Tsai Subject: [PATCH 5.0 113/146] phy: sun4i-usb: Support set_mode to USB_HOST for non-OTG PHYs Date: Mon, 1 Apr 2019 19:02:05 +0200 Message-Id: <20190401170058.038873324@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190401170048.449559024@linuxfoundation.org> References: <20190401170048.449559024@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 5.0-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 @@ -485,8 +485,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: