Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2652751imj; Mon, 11 Feb 2019 06:30:48 -0800 (PST) X-Google-Smtp-Source: AHgI3IbeYVWb8Ho8eDsz5HxTlmroF9/cUXZ5/FE+/KrW5J7bTeiC3iaBl0uKVny3n4UvG6N401p0 X-Received: by 2002:a62:9657:: with SMTP id c84mr37661693pfe.77.1549895448253; Mon, 11 Feb 2019 06:30:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895448; cv=none; d=google.com; s=arc-20160816; b=xosMvTc0x6lWKvVV1DMPe1ebl6C80/PTdaz5I6Eo53HbF/gpw3itDgr7XZ3PdaG3fn tQAsRtsrr93PStTMx27FhXB6WS2f3nkICdgRADIeGy58+3lP/1tllH3nRaLdjjGER0Qz QoM1DeCvjsOZ/c4EorxW2f8e/2hConSQ6giDZ6dC+fyg4oLaORkZkmfm6D72j1OFrBJw 6qzlGZiPKwOMSjYg5pINenrfhSsqXtiUmh23w0+mTRofJIlNQwi0h8GjjdlSeGB1+oX6 NjuGzHXlnKaL8yLiRsKE8V/m+yBSfm0WKUR3Am4Qt3RGSl1l8p/wugsOUP+dTXetrfzR Q5zw== 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=dG4mU6JO/oXcHSA9sZIRhS+CyhHLNJC2lLOaQy+QF9Y=; b=VSlwPKlCRrdfwUACyTcAQX2R10MDRxouRB0ExzIdE4oPUdeQmzPoL4mDgnF3YD4bzm DBqF1jFYJvtV1DP6bhztslzm9gygCTo7GpeJ2q27eqBtVaeBZaqDSK1d6JpHtTXSTz4P bRqapQRtdzglLTYVhwTEBWOztu2abTXFF/LFJZEnSRvXEXC4ifkrrmDY63TYIM6QqNV9 6w07xo+Rk5GXJvJBUsJUyIqJkvcl7rSLE3mSHNnd4oNMuQWkW42khstnduQCjqhROT35 zOhHRdSNRNQ2VNeyrOqhudz75BM+hapy7k+EEa+/jjb1s4ncpMAzlqJ4zbFBvQLUYTvr FiVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="lP/GJoqH"; 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 m11si10397983plt.26.2019.02.11.06.30.31; Mon, 11 Feb 2019 06:30:48 -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="lP/GJoqH"; 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 S1728655AbfBKO2V (ORCPT + 99 others); Mon, 11 Feb 2019 09:28:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:34094 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728915AbfBKO2M (ORCPT ); Mon, 11 Feb 2019 09:28:12 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 52B8120821; Mon, 11 Feb 2019 14:28:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895291; bh=huWnGPNCVeJWvkX8MsbMHTObWK0fw4Ut4nx2x9UOWEQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lP/GJoqHGMPZLuV023ZGY95IHd3L0e+t3aiqMiFkVix5A8zUKG8RlGU27BrHPW1t0 Qgfs6GOu3koO9wBYKbqyBdUl2tOR91Zid8xzoKD14tU3tSbY4AdKCy/Wf/Ao8ewcyD mHarqWCJozgmBlqBvHexu1h5sSFYS7mB9dJjrVj8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Icenowy Zheng , Chen-Yu Tsai , Kishon Vijay Abraham I , Sasha Levin Subject: [PATCH 4.20 157/352] phy: sun4i-usb: add support for missing USB PHY index Date: Mon, 11 Feb 2019 15:16:24 +0100 Message-Id: <20190211141856.772346406@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@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.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 2659392e5c08dff626e6db1d739adff58a94604d ] The new Allwinner H6 SoC's USB2 PHY has two holes -- USB1 (which is a 3.0 port with dedicated PHY) and USB2 (which doesn't exist at all). Add support for this kind of missing USB PHY index. Signed-off-by: Icenowy Zheng Reviewed-by: Chen-Yu Tsai Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Sasha Levin --- drivers/phy/allwinner/phy-sun4i-usb.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c index d4dcd39b8d76..881078ff73f6 100644 --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c @@ -126,6 +126,7 @@ struct sun4i_usb_phy_cfg { bool dedicated_clocks; bool enable_pmu_unk1; bool phy0_dual_route; + int missing_phys; }; struct sun4i_usb_phy_data { @@ -646,6 +647,9 @@ static struct phy *sun4i_usb_phy_xlate(struct device *dev, if (args->args[0] >= data->cfg->num_phys) return ERR_PTR(-ENODEV); + if (data->cfg->missing_phys & BIT(args->args[0])) + return ERR_PTR(-ENODEV); + return data->phys[args->args[0]].phy; } @@ -741,6 +745,9 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev) struct sun4i_usb_phy *phy = data->phys + i; char name[16]; + if (data->cfg->missing_phys & BIT(i)) + continue; + snprintf(name, sizeof(name), "usb%d_vbus", i); phy->vbus = devm_regulator_get_optional(dev, name); if (IS_ERR(phy->vbus)) { -- 2.19.1