Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp495097rdh; Thu, 23 Nov 2023 09:23:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IFM9S7XmerteTW6G+tAbsu/Slg0YpQuNYtIEUpwN1bdIbyroNrHMR+qHXtk+toqD91NEFcd X-Received: by 2002:a05:6a00:1248:b0:6cb:52ce:e25b with SMTP id u8-20020a056a00124800b006cb52cee25bmr149667pfi.34.1700760219172; Thu, 23 Nov 2023 09:23:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700760219; cv=none; d=google.com; s=arc-20160816; b=I+hnlaUiIirlMkfbFUHEb9iY1RzGMHrHCDTa6rUv5FJVlBwmc3XXB/3TfStgfTvgtl JQIuAsCeWmvmrvnWkhg47PnEFJEviKyPI1k80M0xs9hLd3fzDhV31YU9i/cFmln/b+4+ L+67Rq39koFWfIIhtVcRRBfDWNLKfhQlEBsZJL82AOlU7Xg3c7sMHuikYr5T46a/VbBY ATdPvYOjV3W2/wzpdBqH13TAtwvg5Ck/oQoyvIWg1ieaKpASR7f339Qul1Z+wwWA38iS 5b4X6UU9YBrepS5Pta1NaooQuqSNnpnduYu590h783Kk8hIheLu03i9wUbF2wqFWdBIl xtKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ELfSg9bSOKTZcvVm9RsH9bKrmrjcyTXWuNO7uepK/8k=; fh=nSaBoYi3QV6vuGBGd3uVE0FLy7z4wo4UGBglXfUdO/g=; b=sS/pKrk9UlUXeKMNzLxOQvlrO4Lhg9N5Ebq5QK8ep/PI34T4JHwn11UldpYbI3sp1T coQx72f3+k/mQ0IrbsgQDskBS4g+PkydCy2fy4oZekgDvoNes2shBHN+Qvp4HVH67I7n taKFAlgqlIGbLccLnYhRTeNZcmmH8oX4FOhVzUMoUlf8BnK8cPCMmB/idztex44YQCzF XERxBBaf/ey5f/6vhp8LSseOgX8rtK2iI/MT+J0qeL9OoxcIOWMhVZwhtIAHMQlcHaC8 dP6z9wVQhdB/2QZP8lbb1z+AcbfGqGs7SF1ny7cZi2shPoKu1096k4wF2L2AZ0xqS1Is Ci1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XEnd+Al+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id z7-20020a631907000000b005b3d703ca05si1682971pgl.780.2023.11.23.09.23.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 09:23:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XEnd+Al+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 06CFB81EA710; Thu, 23 Nov 2023 09:22:56 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345436AbjKWRWe (ORCPT + 99 others); Thu, 23 Nov 2023 12:22:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjKWRWc (ORCPT ); Thu, 23 Nov 2023 12:22:32 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AD68D62 for ; Thu, 23 Nov 2023 09:22:39 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0C0EC433D9; Thu, 23 Nov 2023 17:22:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700760159; bh=2D3aUhEExlMCoGyBeeeacQjJUG+XraZinasPd6JBJW0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XEnd+Al+R2lAela/niSU367F4vosKZr3w25UtMD2C+vBQ7mtTDqd6shdG3Th7MK1w sEV0HrmSPBJkl17Gsn1VN95x1gItdZsCpWWxFTF5KUTYtDZfENPNPemsasuvv+Wi9R 6sV80XlhTRfQajBK+lGsKWT3F2ieHOEIOO76zu5Q= Date: Thu, 23 Nov 2023 13:55:57 +0000 From: Greg Kroah-Hartman To: Frieder Schrempf Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Matthias Kaehlcke , Frieder Schrempf , Anand Moon , Benjamin Bara , Icenowy Zheng , Rob Herring , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Subject: Re: [PATCH 1/2] usb: misc: onboard_usb_hub: Add support for clock input Message-ID: <2023112329-augmented-ecology-0753@gregkh> References: <20231123134728.709533-1-frieder@fris.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231123134728.709533-1-frieder@fris.de> X-Spam-Status: No, score=0.2 required=5.0 tests=DATE_IN_PAST_03_06, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 23 Nov 2023 09:22:57 -0800 (PST) On Thu, Nov 23, 2023 at 02:47:20PM +0100, Frieder Schrempf wrote: > From: Frieder Schrempf > > Most onboard USB hubs have a dedicated crystal oscillator but on some > boards the clock signal for the hub is provided by the SoC. > > In order to support this, we add the possibility of specifying a > clock in the devicetree that gets enabled/disabled when the hub > is powered up/down. > > Signed-off-by: Frieder Schrempf > --- > drivers/usb/misc/onboard_usb_hub.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/usb/misc/onboard_usb_hub.c b/drivers/usb/misc/onboard_usb_hub.c > index a341b2fbb7b44..e710e3c82ba9b 100644 > --- a/drivers/usb/misc/onboard_usb_hub.c > +++ b/drivers/usb/misc/onboard_usb_hub.c > @@ -5,6 +5,7 @@ > * Copyright (c) 2022, Google LLC > */ > > +#include > #include > #include > #include > @@ -60,12 +61,19 @@ struct onboard_hub { > bool going_away; > struct list_head udev_list; > struct mutex lock; > + struct clk *clk; > }; > > static int onboard_hub_power_on(struct onboard_hub *hub) > { > int err; > > + err = clk_prepare_enable(hub->clk); > + if (err) { > + dev_err(hub->dev, "failed to enable clock: %d\n", err); > + return err; > + } But what happens if clk is not set here? And doesn't clk_prepare_enable() print out a message if it fails? thanks, greg k-h