From patchwork Sun Apr 19 15:48:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1272946 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=nic.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=nic.cz header.i=@nic.cz header.a=rsa-sha256 header.s=default header.b=HzrHJ06e; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 494vRH08mRz9s71 for ; Mon, 20 Apr 2020 01:50:02 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7F35681A07; Sun, 19 Apr 2020 17:49:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=nic.cz header.i=@nic.cz header.b="HzrHJ06e"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BA76680574; Sun, 19 Apr 2020 17:49:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.nic.cz (lists.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A6F5F813C3 for ; Sun, 19 Apr 2020 17:48:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=marek.behun@nic.cz Received: from dellmb.labs.office.nic.cz (unknown [IPv6:2001:1488:fffe:6:cac7:3539:7f1f:463]) by mail.nic.cz (Postfix) with ESMTP id 3B5F0140EA8; Sun, 19 Apr 2020 17:48:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1587311336; bh=MhKQiglk/kbk3zsjr4Gm8bGEc+F6m+vNW1rdG2XKU2k=; h=From:To:Date; b=HzrHJ06eHCP5KXaMos9vvAmcMlxCckvwqsxEmESZbq9dcRuMcPMTBNCsudhEe3Llq 8KfmB0zQnbT0iByfyTt5f9Wfcv771jPDfbtcEILBA9XljQ+vxl1+K9Ijx6Y6FrF0NR LOAkbiXkaApYC+ugSt3TFfwsJcWC5PewNSPJwq18= From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: u-boot@lists.denx.de, Konstantin Porotchkin , make@marvell.com, Vladimir Vid , "Matwey V . Kornilov" , Miquel Raynal , Gregory CLEMENT , Andrew Lunn , Thomas Petazzoni , Tomasz Maciej Nowak , Ellie Reeves , Vladimir Oltean , Marek Vasut , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 06/11] usb: xhci-mvebu: call generic-phy initialization Date: Sun, 19 Apr 2020 17:48:45 +0200 Message-Id: <20200419154850.25868-7-marek.behun@nic.cz> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200419154850.25868-1-marek.behun@nic.cz> References: <20200419154850.25868-1-marek.behun@nic.cz> MIME-Version: 1.0 X-Spamd-Bar: / X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Use the new usb_phys_setup and usb_phys_shutdown to initialize potential generic-phys in the xhci-mvebu driver. Signed-off-by: Marek BehĂșn --- drivers/usb/host/xhci-mvebu.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-mvebu.c b/drivers/usb/host/xhci-mvebu.c index 2b871046ae..2939e658ef 100644 --- a/drivers/usb/host/xhci-mvebu.c +++ b/drivers/usb/host/xhci-mvebu.c @@ -14,6 +14,8 @@ #include +#include "phy.h" + struct mvebu_xhci_platdata { fdt_addr_t hcd_base; }; @@ -49,6 +51,10 @@ static int xhci_usb_probe(struct udevice *dev) len = HC_LENGTH(xhci_readl(&ctx->hcd->cr_capbase)); hcor = (struct xhci_hcor *)((uintptr_t)ctx->hcd + len); + ret = usb_phys_setup(dev); + if (ret) + return ret; + ret = device_get_supply_regulator(dev, "vbus-supply", ®ulator); if (!ret) { ret = regulator_set_enable(regulator, true); @@ -64,6 +70,17 @@ static int xhci_usb_probe(struct udevice *dev) return xhci_register(dev, ctx->hcd, hcor); } +static int xhci_usb_remove(struct udevice *dev) +{ + int ret; + + ret = xhci_deregister(dev); + if (ret) + return ret; + + return usb_phys_shutdown(dev); +} + static int xhci_usb_ofdata_to_platdata(struct udevice *dev) { struct mvebu_xhci_platdata *plat = dev_get_platdata(dev); @@ -93,7 +110,7 @@ U_BOOT_DRIVER(usb_xhci) = { .of_match = xhci_usb_ids, .ofdata_to_platdata = xhci_usb_ofdata_to_platdata, .probe = xhci_usb_probe, - .remove = xhci_deregister, + .remove = xhci_usb_remove, .ops = &xhci_usb_ops, .platdata_auto_alloc_size = sizeof(struct mvebu_xhci_platdata), .priv_auto_alloc_size = sizeof(struct mvebu_xhci),