Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2684353imj; Mon, 11 Feb 2019 07:00:57 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ9DaoiJ3X2NuMJ7TzGhCDuUqzYU1o0evZLrVGdcH8xZ+1imt4IoOq0tRr2LrjCSlU9OVzN X-Received: by 2002:a62:41cc:: with SMTP id g73mr12235276pfd.145.1549897256941; Mon, 11 Feb 2019 07:00:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549897256; cv=none; d=google.com; s=arc-20160816; b=NU7Q3Y98sI/WRNux3dQb+djf/RhDwS+anXhvAVBt7cvipxMWb/G18ne1+ruhnJo7x7 s9NawFNdp+LIfH1G/9mc21norC/FSuQ5rG8BHDSJQf7zgVhkJbvb/Wl1r7qQpbifI0di taT0YaO5Hd2Rv5N324EfIgAbabF9BX/nHdtgSfMWYCf/0gdXkT83tI2boJ6hjfmXXbVl UpRUmsM2Wh/ZK40m/pGIB185dGaH1Q+LxyiKlLQ2t5S+IulXwtr3Uy+vGW4C1ag1PCd4 9kS0wnebIqqXmiiVSFbBhW48z6zxWuGXzGh3/b0GQJiRQzCVV2QfNtiAsDYTQPLjiDTI z3yQ== 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=4WXzSKDwSdUeui5VlfFbWTFXj5FnmqU6vfXqrxboE1I=; b=PosNpsPhkb4PP1kha/nZWLBiuKtuXmCba+SRZGcU2R03ixjxwVY3gkwUbD23osShA8 FM+AoPmwI+1S7qix2t6QAx8ECJiGV9uh7atoNJMrjUWWe//WwGtvX8Doe/HuH8jq8bfx Wua5DMrLTd+z3u2U5fnUhFGTstAbhuITWdHl72pAMUGEAXSLVLvg2Lp8V66t5vr+6kls cDzYOfbqEtaP1P8IWoUTNbs4WKBjDcvA/qJH7Ymy+se58qThILpTpPrSJXW9pjiCCAl6 dnEYUeq078sxlra3aaP3tKQFEkdc3xaLXCi3el8zYOhyc6rj+GXpBXUCFEEi8kyGgyYW 7RgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bPsbbztR; 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 b11si10806190plb.427.2019.02.11.07.00.38; Mon, 11 Feb 2019 07:00:56 -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=bPsbbztR; 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 S2387943AbfBKO7n (ORCPT + 99 others); Mon, 11 Feb 2019 09:59:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:47426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389124AbfBKO7i (ORCPT ); Mon, 11 Feb 2019 09:59:38 -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 F1AA7222A4; Mon, 11 Feb 2019 14:59:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897177; bh=U99msPssP2y9fGEB+sJXyh1dZwUzFuiYUWoKdttBHYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bPsbbztRIWhZpM/rQc62nPgypQ5mE43XbQqkwwJJl0G7ExyGHUiTus5cj0pGLHeSi tx1LH+sn52YL3UcmYhEVtDlFLz7rg1rVDKhZwE0fpR6KHUsZpFN2DfAJwmCCgSVW6f U22o+nSWwFK14b4P2lwwiadDXSCx1oDUFT+dAphU= 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.14 087/205] phy: sun4i-usb: add support for missing USB PHY index Date: Mon, 11 Feb 2019 15:18:05 +0100 Message-Id: <20190211141834.359668284@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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. ------------------ [ 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 afedb8cd1990..d1ccff527756 100644 --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c @@ -125,6 +125,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 { @@ -645,6 +646,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; } @@ -740,6 +744,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