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 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 906A7C46467 for ; Tue, 3 Jan 2023 15:46:50 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 507CE8559A; Tue, 3 Jan 2023 16:45:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1672760732; bh=LchScu+SHrYes7eSQN7RhYt3egTxPWje+3rfdkWM0D0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=NvZB78h/AHxkAcqwdBQFyj7WIZ6YDxtg5bwZD4Q5hU0K0Oll4UJ8sQNtAGHBKRghq fXiFMltywJ0zY3Nyu19X39XwlhbCdz3W2OAprGD1MNH2W3yG3oySS2owgbPQ2EIemI EPDEhLLxPT+DsDHk19hCZIVGllnihkPpNd3d4gB61dORZSGyYDOw+Wykk2POZBHzZL lVTjJqjzkhBeywzotg1F1On8Kx+uICoKkBPuFeZLup5D1bpp5TiClIPRcvuToni+U2 AsWTCPkSotIGHzSD+B7nlZfXAPcbzyWgo4WmOMefZRaWfrQdzueI+2KVSWKQ3G+cr9 yj48RdbZHRcdg== Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 05AFA8557B; Tue, 3 Jan 2023 16:45:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1672760716; bh=LchScu+SHrYes7eSQN7RhYt3egTxPWje+3rfdkWM0D0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=uFjSfuMwfZEgk1Q5HmwH1/QQXrQBXT0bVNishVzlfHBVvuliHNTeNY/fUGCqdNAtZ fjPfZ5dxCyyVqVUvMRuPemdiKOIfOlXfah9NoQgl5Rtudhem7tOpUJpWt/pQAPUfYM 45/mkEtqeF5XjJVOt7FNpwKh5/apinUu2iCpsjdRVM4vwlc5kb3YSBPEcInkHOeI4a Pt+9nCZNGiL3zZz368r2dYHoiC/00pAn5p1kJIxlYeuAheHNOFqjX4BhCSbqOGBQX2 jbeWGfzazrpG31y9t/ypgLLr454IuRFIR2FchRf/kz3FuC1qsqsvDkCn/NNGO8mOMf c4YPNQVLH2J5w== Message-ID: <7caed2e3-d146-3909-ec3d-92847dc05bef@denx.de> Date: Tue, 3 Jan 2023 15:38:21 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH 4/4] usb: ohci-at91: Add USB PHY functionality Content-Language: en-US To: Sergiu.Moga@microchip.com, michal.simek@amd.com, jim.t90615@gmail.com, sumit.garg@linaro.org, weijie.gao@mediatek.com, sjg@chromium.org, Eugen.Hristev@microchip.com, Cristian.Birsan@microchip.com Cc: u-boot@lists.denx.de, Mihai.Sain@microchip.com References: <20221223123454.362757-1-sergiu.moga@microchip.com> <20221223123454.362757-5-sergiu.moga@microchip.com> <92352dd0-9606-ed73-ef93-33eee8e0e17c@denx.de> <87cd8fdd-784b-837b-b7cb-38e303bfc27d@microchip.com> From: Marek Vasut In-Reply-To: <87cd8fdd-784b-837b-b7cb-38e303bfc27d@microchip.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.6 at phobos.denx.de X-Virus-Status: Clean On 1/3/23 14:02, Sergiu.Moga@microchip.com wrote: > On 03.01.2023 01:33, Marek Vasut wrote: >> On 12/23/22 13:34, Sergiu Moga wrote: >>> Add the ability to enable/disable whatever USB PHY's are >>> passed to the AT91 OHCI driver through DT. >>> >>> Signed-off-by: Sergiu Moga >>> Tested-by: Mihai Sain >>> --- >>>   drivers/usb/host/ohci-at91.c | 31 +++++++++++++++++++++++++++++++ >>>   1 file changed, 31 insertions(+) >>> >>> diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c >>> index 5cf8f283e5..217f31b402 100644 >>> --- a/drivers/usb/host/ohci-at91.c >>> +++ b/drivers/usb/host/ohci-at91.c >>> @@ -74,6 +74,10 @@ int usb_cpu_init_fail(void) >>>   #include >>>   #include "ohci.h" >>> >>> +#if CONFIG_IS_ENABLED(PHY_MICROCHIP_SAMA7_USB) >>> +#include >>> +#endif >>> + >>>   #define AT91_MAX_USBH_PORTS        3 >>> >>>   #define at91_for_each_port(index)   \ >>> @@ -91,6 +95,10 @@ struct ohci_at91_priv { >>>       struct clk *fclk; >>>       struct clk *hclk; >>>       bool clocked; >>> + >>> +#if CONFIG_IS_ENABLED(PHY_MICROCHIP_SAMA7_USB) >>> +     struct phy phy[AT91_MAX_USBH_PORTS]; >>> +#endif >>>   }; >>> >>>   static void at91_start_clock(struct ohci_at91_priv *ohci_at91) >>> @@ -98,6 +106,13 @@ static void at91_start_clock(struct ohci_at91_priv >>> *ohci_at91) >>>       if (ohci_at91->clocked) >>>               return; >>> >>> +#if CONFIG_IS_ENABLED(PHY_MICROCHIP_SAMA7_USB) >> >> Use plain: >> >> if (CONFIG_IS_ENABLED(...)) { ... } >> >> instead of the #if ... , the compiler would optimize the code out >> correctly. >> > > > The build system complains that the generic_phy_* methods are not > present and, if possible, I would like not to have to enable the PHY > related CONFIGs on the boards that do not need it only to avoid these > warnings. Do include . If CONFIG_PHY is not set, then those generic_phy_*() functions become empty inline functions, where are optimized out by the compiler.