Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2668804imj; Mon, 11 Feb 2019 06:46:01 -0800 (PST) X-Google-Smtp-Source: AHgI3IawYf5HsaB26dRNCc3kpU4woNZ3w8u6Dsp8Pf5dE7W1ul++doOBQy76rzAbv4XWpcdYK3iN X-Received: by 2002:a17:902:9a84:: with SMTP id w4mr29125821plp.283.1549896361175; Mon, 11 Feb 2019 06:46:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549896361; cv=none; d=google.com; s=arc-20160816; b=zpeO+oNXrYV0ch77MSaz2D7lvA7QnfoqGvis3NLcAhE21npwiXo0FOEzJxFzKKChlN e/XTflw8e93F+vTjdWcoNT/A4t3FYPbm4FbjrHDx6hBOdG9qR6EkSQcQgChmUivv0B+G r5TLll3xtkBXPSjQhgAIgSz5dsKbluN0gPfXQsQ+E4zUuFnORm4YZOd9Vps7g9dX/lJo mf6YJXK+ojWOpXaiDvrq1vVK0+okSn9UaDAjfjbxRpPDJ0Mur+JCKnzgYwu2vTPlxEnx KBr4EggNb6S/jnHk6ATHew+43x0ndmRuzH3htWk94487fwNMR5A2Rzlbgbf2DK6GJIgx 4wEQ== 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=3ENckc6nFgMnXUxl0YKHGfo0rnUbWHb+hw+Y3FSPVaU=; b=yDqOz/BaI0cwBmQHfgbZQj+/tsd1Q0f9Y3M2XyFj4JIqCJc98TpsUmNGqjhAiXUFT6 jGrEp+4uQgeoG27+elSgY3CuUeu0vpdeM5KHwQe1+WxUlV4F/uN3DEA51ebL77gxKzSJ qGi6YQBWMToWYP5O7DBmvnQJyGqdpvDNYhSgM7WRGvhUB2ibh+s9WxjCXBpQr/QI1dv5 T2eES34GOZFyx2+G1DWzKmhs+2pDD2lv1KvwaJKTEqRAtqMhRAUPU0zTg29VBF2dEpGJ W3nUtB6LMWOQE3tbFEXOTEDKRYACpBE4FyqsecjcyqHsadRYx2rSh+3BFoOsc03EJ0M4 ub8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0nMTTQp1; 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 m187si10650277pfm.51.2019.02.11.06.45.45; Mon, 11 Feb 2019 06:46:01 -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=0nMTTQp1; 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 S1732366AbfBKOos (ORCPT + 99 others); Mon, 11 Feb 2019 09:44:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:57624 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732459AbfBKOop (ORCPT ); Mon, 11 Feb 2019 09:44:45 -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 A687C206BA; Mon, 11 Feb 2019 14:44:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549896285; bh=ZQXMWhFA2zpWSEtA2NY9Z/bE/TLSA0kDpZiS8rmtous=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0nMTTQp1vmYEgCSfPOg1uS8xoAR4kClfH8eVG4W+idx8gbH1HQ3RYdtHdyXWYpsEs 6OTifRjKzYQOZWf7UXC4E3nMnm5cfFVnrdhlQQhHmVIec7sIDULhCtTzJhM1X8MoN2 scq93VBZA1EXPpAivssNcz7n343E1wZfLAnLCiXw= 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.19 134/313] phy: sun4i-usb: add support for missing USB PHY index Date: Mon, 11 Feb 2019 15:16:54 +0100 Message-Id: <20190211141902.659334263@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141852.749630980@linuxfoundation.org> References: <20190211141852.749630980@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.19-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