Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp25180lqs; Thu, 13 Jun 2024 02:39:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXOGPxCwm1Ju4jNFzU4Hz31FFXf2ZlylwA7xDykXHHcsp69690PlmiEuruES/oV0tKAZPQWF7QyNv/7ipUiemN8h67c8kedURnsnT7Ypg== X-Google-Smtp-Source: AGHT+IGlOxlvP3vveVlGD+gk4AJBHkVQ1jg54tZKikA33jIec+Onm3QRDDPPE+lkWJbM8o9wL8/a X-Received: by 2002:a17:906:3bc5:b0:a6f:37ca:7fa7 with SMTP id a640c23a62f3a-a6f524037d8mr137996366b.10.1718271591794; Thu, 13 Jun 2024 02:39:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718271591; cv=pass; d=google.com; s=arc-20160816; b=MBLQbk7ROxkMCUmiJvMkWsDf+IEHrO7tnFhpR2kZNc8GSRLGRNY1AmJsv0qk0qoD3f GLHV5xBYCEriP5SY2qbb/pAH4dIdwQlYWZ374vuVOF4O9P8r9HuNkeYXqF9S5Qmm/smj XTcGP5w7bEni2nlGj2eBEn7dfFzGmEVQWSmOYJVthAqJybvTti3Sh2OTAfgi+JnZJnqz TVadDJ3vGLfZfmmezgrmaQsT5cdBqneCl6pWVaAhYbgolQksoLs/zLU06MialQ86X9+H o5I8BGJLA6hy7z3lArhxn8nxoHZUq+tqsOuO9AgzWe2ERF8djuon1huAkFSb8jw3Qjwd tjPQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date; bh=OVXgVicFtnbjYyFx1Zy9vmtT/hPVeH6OCi+YDCJtzhM=; fh=w4Wl3mxscbe+xb5Xd6ZpdqHnZRWzoJliTJfW9s/++gE=; b=COt1tZdLx3ABimbRw3n8k+fzLpIPiiLG/KWEDfW+Vllqlyvi+CzXoDo22vY6mdzA10 Z4xyaz7K+zA/E0YEDwlJLvFkX/HPAycB814eJNxCXkCSsUaYjzLJM3h8+b9DIuAj8oex W54CQYatanU5K+Yns1rA8+/Udt/0SLQKTUMq5qcQ9Oe18jDHZahgArJl8l7VHzX1HYQ1 3qVfk5AvT2beGjZhYxBNlejgN/MFjYvMnsQpYtJ2l5scCeSJC5IbaeQurNz0z+ywZUdb 6DR6dSyQUQ6/eibUqzHNvHbEi0L6qGhTJcYm1ktSC7Wtm21/CS+2dLTVkHXFciaK2TSm 8SAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-212969-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212969-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56d21f31si49621166b.142.2024.06.13.02.39.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 02:39:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212969-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-212969-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212969-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5C82B1F22FD3 for ; Thu, 13 Jun 2024 09:39:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D988140367; Thu, 13 Jun 2024 09:39:39 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D735A13F449 for ; Thu, 13 Jun 2024 09:39:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718271578; cv=none; b=uQ+C383UnPgNZkJBXwmf6fqDSkMVF+4l+HlNorsQmMHCF+Es+aJp5RPkOLzmbIQ+n27Rz5avD+qOaLFjox59+15nuwZI79q+V/HSc8oi3dC0rDhD9Sdk1ppKDYB+rJ4+enoNmVu/poJ3TiQmvN3Rpj9Of6D1QrdKbo8v0XHe9iI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718271578; c=relaxed/simple; bh=iLQX6wuI1C08F/UQlPVe2qnRK6e+oxmbatREJ02+xTQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RtWdufP69PbSlGGS4VsZmK7mZqngTI/feWurp9QwmEBYz0XpKHxbBrPLpoh7AKkmXKVztY2I4rqpT+7ACLUHnnNmmuEatTyTzZ8wjZPSOBMANivGn8IRNU4Xio+vzXoeKmCFCz+7QH5RTXDMdttQafgkVdmRBvQcp2/egKuamo4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sHgvD-0002DT-Gy; Thu, 13 Jun 2024 11:39:07 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sHgvC-001zsF-Uc; Thu, 13 Jun 2024 11:39:06 +0200 Received: from mfe by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1sHgvC-008SNC-2h; Thu, 13 Jun 2024 11:39:06 +0200 Date: Thu, 13 Jun 2024 11:39:06 +0200 From: Marco Felsch To: Shengjiu Wang Cc: Shengjiu Wang , p.zabel@pengutronix.de, abelvesa@kernel.org, peng.fan@nxp.com, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, marex@denx.de, linux-clk@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 2/5] clk: imx: clk-audiomix: Add reset controller Message-ID: <20240613093906.trc2rahodmhqd4lt@pengutronix.de> References: <1718243482-18552-1-git-send-email-shengjiu.wang@nxp.com> <1718243482-18552-3-git-send-email-shengjiu.wang@nxp.com> <20240613081949.yty3hznopp3u2qwq@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On 24-06-13, Shengjiu Wang wrote: > On Thu, Jun 13, 2024 at 4:20 PM Marco Felsch wrote: > > > > On 24-06-13, Shengjiu Wang wrote: > > > Audiomix block control can be a reset controller for > > > Enhanced Audio Return Channel (EARC), which is one of > > > modules in this audiomix subsystem. > > > > > > The reset controller is supported by the auxiliary device > > > framework. > > > > > > Signed-off-by: Shengjiu Wang > > > Reviewed-by: Frank Li > > > --- > > > drivers/clk/imx/Kconfig | 1 + > > > drivers/clk/imx/clk-imx8mp-audiomix.c | 63 +++++++++++++++++++++++++++ > > > 2 files changed, 64 insertions(+) > > > > > > diff --git a/drivers/clk/imx/Kconfig b/drivers/clk/imx/Kconfig > > > index 6da0fba68225..9edfb030bea9 100644 > > > --- a/drivers/clk/imx/Kconfig > > > +++ b/drivers/clk/imx/Kconfig > > > @@ -81,6 +81,7 @@ config CLK_IMX8MP > > > tristate "IMX8MP CCM Clock Driver" > > > depends on ARCH_MXC || COMPILE_TEST > > > select MXC_CLK > > > + select AUXILIARY_BUS > > > > select AUXILIARY_BUS if RESET_CONTROLLER > > Do we really need this change? > > I checked other drivers like MCHP_CLK_MPFS, but they don't have > this condition also. Since you made the whole reset optional I would like to pull reset dependency optional as well e.g. pulling it only if you really use it. In the end the RESET_CONTROLLER is enabled most the time. > > > help > > > Build the driver for i.MX8MP CCM Clock Driver > > > > > > diff --git a/drivers/clk/imx/clk-imx8mp-audiomix.c b/drivers/clk/imx/clk-imx8mp-audiomix.c > > > index b381d6f784c8..517b1f88661b 100644 > > > --- a/drivers/clk/imx/clk-imx8mp-audiomix.c > > > +++ b/drivers/clk/imx/clk-imx8mp-audiomix.c > > > @@ -5,6 +5,7 @@ > > > * Copyright (C) 2022 Marek Vasut > > > */ > > > > > > +#include > > > #include > > > #include > > > #include > > > @@ -13,6 +14,7 @@ > > > #include > > > #include > > > #include > > > +#include > > ^ > > This is an unrelated change. > > This is for the fix of this issue > > https://lore.kernel.org/oe-kbuild-all/202405201844.zf7UkDmq-lkp@intel.com/ Thanks for the link. Regards, Marco > Best regards > Shengjiu wang > > > > > Regards, > > Marco > > > > > > > > #include > > > > > > @@ -217,6 +219,63 @@ struct clk_imx8mp_audiomix_priv { > > > struct clk_hw_onecell_data clk_data; > > > }; > > > > > > +#if IS_ENABLED(CONFIG_RESET_CONTROLLER) > > > + > > > +static void clk_imx8mp_audiomix_reset_unregister_adev(void *_adev) > > > +{ > > > + struct auxiliary_device *adev = _adev; > > > + > > > + auxiliary_device_delete(adev); > > > + auxiliary_device_uninit(adev); > > > +} > > > + > > > +static void clk_imx8mp_audiomix_reset_adev_release(struct device *dev) > > > +{ > > > + struct auxiliary_device *adev = to_auxiliary_dev(dev); > > > + > > > + kfree(adev); > > > +} > > > + > > > +static int clk_imx8mp_audiomix_reset_controller_register(struct device *dev, > > > + struct clk_imx8mp_audiomix_priv *priv) > > > +{ > > > + struct auxiliary_device *adev __free(kfree) = NULL; > > > + int ret; > > > + > > > + if (!of_property_present(dev->of_node, "#reset-cells")) > > > + return 0; > > > + > > > + adev = kzalloc(sizeof(*adev), GFP_KERNEL); > > > + if (!adev) > > > + return -ENOMEM; > > > + > > > + adev->name = "reset"; > > > + adev->dev.parent = dev; > > > + adev->dev.release = clk_imx8mp_audiomix_reset_adev_release; > > > + > > > + ret = auxiliary_device_init(adev); > > > + if (ret) > > > + return ret; > > > + > > > + ret = auxiliary_device_add(adev); > > > + if (ret) { > > > + auxiliary_device_uninit(adev); > > > + return ret; > > > + } > > > + > > > + return devm_add_action_or_reset(dev, clk_imx8mp_audiomix_reset_unregister_adev, > > > + no_free_ptr(adev)); > > > +} > > > + > > > +#else /* !CONFIG_RESET_CONTROLLER */ > > > + > > > +static int clk_imx8mp_audiomix_reset_controller_register(struct clk_imx8mp_audiomix_priv *priv) > > > +{ > > > + return 0; > > > +} > > > + > > > +#endif /* !CONFIG_RESET_CONTROLLER */ > > > + > > > static void clk_imx8mp_audiomix_save_restore(struct device *dev, bool save) > > > { > > > struct clk_imx8mp_audiomix_priv *priv = dev_get_drvdata(dev); > > > @@ -337,6 +396,10 @@ static int clk_imx8mp_audiomix_probe(struct platform_device *pdev) > > > if (ret) > > > goto err_clk_register; > > > > > > + ret = clk_imx8mp_audiomix_reset_controller_register(dev, priv); > > > + if (ret) > > > + goto err_clk_register; > > > + > > > pm_runtime_put_sync(dev); > > > return 0; > > > > > > -- > > > 2.34.1 > > > > > > > > > >