From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF049C43381 for ; Tue, 26 Mar 2019 07:49:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E75F20856 for ; Tue, 26 Mar 2019 07:49:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553586576; bh=fzcac+XjDHl1sPhup+GYnqv3PLGbzmoghLqcy6nxXpw=; h=Subject:To:From:Date:List-ID:From; b=WEZ1CMAi2aFgWFr4jFiWZ7eTfpLIvj8EH2xYSVtC9sM98zwKohhaFpka1m/ErFy7b yqyYMIbp+pKC3aVV5cWegbVIqccB4IyL9TrymCCHvmxf3YATJKae+th/+i9MDHHJYg cdU2m/ri6fLN+X7q/ovSfSQn4hgRLuCyEqRa+ipk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726111AbfCZHtg (ORCPT ); Tue, 26 Mar 2019 03:49:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:44452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725535AbfCZHtf (ORCPT ); Tue, 26 Mar 2019 03:49:35 -0400 Received: from localhost (unknown [104.132.152.111]) (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 8729D20828; Tue, 26 Mar 2019 07:49:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553586575; bh=fzcac+XjDHl1sPhup+GYnqv3PLGbzmoghLqcy6nxXpw=; h=Subject:To:From:Date:From; b=h7TEFuQw/wLj5RYdzWdQJmjVwCoiXCq1q6NGjSSPYy+QbvC/Cx47YU/OS+PQmfnWd /8B2N9zYdmygAzDhjqY9sgmVuPNM7pUiVKomSp1KiPbxFKdV92JAUIoMltclV3cNms EjWDv+kLs+mwiU3ySsglhizA6pufurVNWrVeFQJs= Subject: patch "phy: sun4i-usb: Support set_mode to USB_HOST for non-OTG PHYs" added to usb-linus To: wens@csie.org, gregkh@linuxfoundation.org, stable@vger.kernel.org From: Date: Tue, 26 Mar 2019 16:49:31 +0900 Message-ID: <1553586571204110@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled phy: sun4i-usb: Support set_mode to USB_HOST for non-OTG PHYs to my usb git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git in the usb-linus branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will hopefully also be merged in Linus's tree for the next -rc kernel release. If you have any questions about this process, please let me know. >From 1396929e8a903db80425343cacca766a18ad6409 Mon Sep 17 00:00:00 2001 From: Chen-Yu Tsai Date: Fri, 22 Mar 2019 16:51:07 +0800 Subject: phy: sun4i-usb: Support set_mode to USB_HOST for non-OTG PHYs 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(-) diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c index 5163097b43df..4bbd9ede38c8 100644 --- 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 phy *_phy, 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: -- 2.21.0