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=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 52C95C169C4 for ; Mon, 11 Feb 2019 15:27:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 23CAB21B1A for ; Mon, 11 Feb 2019 15:27:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549898823; bh=U99msPssP2y9fGEB+sJXyh1dZwUzFuiYUWoKdttBHYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hYlevoKKV8MXLem1ahFI+Et6wvEhF98W7ELbGUvB3Lbw5RhQUbMcZH/sX/dVaZ1gH 9+BMEh8ZPy8zlw1vSOoBTWQi6UzuTqPeyHJ5rck7bGVMgiVMr35tphPVaCgyxsm0E2 OyJkkME1PbPHIdJQWqHKAwx8Hsy90Nms1uyxKOog= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389853AbfBKO7n (ORCPT ); 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