Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp43019lqs; Thu, 13 Jun 2024 03:19:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXHZ7At/xjxtwoQ1Th6UInBodvnPo3taxOluPkwSnBGkLrhNR29ByeLef3BByW3+mQnSI2cBzWPIiL10s501/calPF7oDdibOuVeL0p/A== X-Google-Smtp-Source: AGHT+IFWfndaBBxpb0bZFue4dv32G/LI8Kxb7KGZnjAP8CmZFutwC8J9hKwerGuEoYriG8V+OIg9 X-Received: by 2002:a05:6358:6f15:b0:19e:f3c4:44ce with SMTP id e5c5f4694b2df-19f69d37d38mr559847755d.12.1718273977892; Thu, 13 Jun 2024 03:19:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718273977; cv=pass; d=google.com; s=arc-20160816; b=StS6ZOYKLO58J05Tx1C7EOTBUYndJ34Ao/sogeFYNnsA3bIAIGOu3NnQOx3CMNCMRn q4GqwXckn4Obr7pc7aNINguuh1RtGNy8HGZSHunYhNyRMZ+m6AGXxuzeXlHBbmw1jCsq /n66AZEVpmmcV+7XuxmkxIAXrqvQ33suYXerqT4xtrFxJUED+SJOFlsSmamb3q2aYkvC hZOq4XBCabeJUsyXGMxTZzs0yX7YjPy07wPuGnv5UybHzVFqSzqUwnfleUtnqz3amHzy 0X8PoAm2leU/xPpakTrBUzs8nQ7or2A5vYKxiG+Nggi1fMppj/DoQ288MzRTSIRoqJL2 bEEg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=aCTkK4uPvyN5EPmGILT+j3bzlqaQqHiiUqqzBMYByzw=; fh=Uk939nF6+mS/rfGeahYMYBsi6uJM+buVe+i52tWGmTE=; b=WjACrhnZkEpdKCV/jxmNV2Nn1Gy27wy9h9Wa5/MknQeDRL4JyD1rhgDDg507IAAMW7 hINp8ARuooZaPyJSf7fhOiCXT3FL1HFimqw5adWmTjlsy6W7Alv/gaIXYTp9J1Xxh46P OKTU5aonMO26T3SkXJ/xzf/UW0FuTqJb2OPxhk2n1MZlficmX0FHLO4WhYGrI++v6Pr9 sZVZ7mKfYz6Ew9I73aEdGCHy78tCl57CgLsiLK30rqqaLfL5anHUGlsR9JnUCwUyZ8gz +pBkl5qxkeEmHhxASUGKJBVC1GlecTZOhISZT699EFu77iR673DBjBj8xn/2Kt7b7MZY F0Jg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gc9UWQbl; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-212987-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212987-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6fee453ac56si994625a12.530.2024.06.13.03.19.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 03:19:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212987-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gc9UWQbl; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-212987-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212987-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 73B27B21186 for ; Thu, 13 Jun 2024 09:55:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE59A1411CF; Thu, 13 Jun 2024 09:54:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gc9UWQbl" Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 518291304AA; Thu, 13 Jun 2024 09:54:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718272496; cv=none; b=YYIx//dYhigempq6cyENvhS0dXc8AmsG+pn0pg2B/Kf5Mq8GaDpEY55UaQfsQoLxnMcjoGPb0a2BU4+oKn0jUoSffWIIy/X5E1NM3xyqQwlYNtznKrD4IeZl1/51mHGveuLUbItOmOBde44SwGm45UTtOmbRYwwa/nn3mfcrLBI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718272496; c=relaxed/simple; bh=nyhD0QEQnN8q2PdwNwl3A2WK3my9sXc9o7+HfIXyEhI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=cYFBUKQg91KIa9VujSIU2/BoNgdvkdr8WDstilAozftdyNoMg/LjYQDUw6FQysTcSGhHC4CAdf2JvlD1IpceqxGYwxcn+Cqq6Nlzoh2vXXE7OOVrVxpZYN19iOu9xHfua7jxPfOSdSRaQYBa02bfUE4G24Jvj+/c7zHAkSnIMAE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gc9UWQbl; arc=none smtp.client-ip=209.85.166.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-il1-f175.google.com with SMTP id e9e14a558f8ab-3737b412ad6so2773795ab.2; Thu, 13 Jun 2024 02:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718272494; x=1718877294; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aCTkK4uPvyN5EPmGILT+j3bzlqaQqHiiUqqzBMYByzw=; b=gc9UWQblb+7TEr7dxfsAwX9s34Wc/H5Tww87AvfXViDN41tC1LOb/1oAEskk0b7jD0 6op/xBjKA6x1KUF6ADIhYypPsoL/gYwD6aI6PEj760DY7lv99gFaNQu4+bJ0aXlv4nLO p8UrX2lvcXJ9XV3N2oOqvBCOlppnWYEhyTLREI9em6uuTEu6Whpn/ZUbFotXf37KI7jF 1JsjfcHlYLyiWoSo3XQMpUKtdt3Xqu61j+56E0PsOtJr/MShBE8QLgh5aPp7U1LJ69H0 9pq9D4gB0VmWbL+bvoO0EKrfuN6N/JC1+fZ9QdOOP+0H+mah0lLWLzJS7Q8XchKXT7Zt LNIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718272494; x=1718877294; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aCTkK4uPvyN5EPmGILT+j3bzlqaQqHiiUqqzBMYByzw=; b=U1KXOcOFherf7kLFRSqttGbLeHu9z1RduryJrQeC05LwTQ1+uwZwvZXn6J0zJaSlOc kPQA8N4J4dVMiP8HO98fh6BFCy1sa+1tgb+w56kDO8WwPwRu3BaAQq+avsSQf/Q5s9kS xnAFfk6YPqey9BY8HjIdQj89vd6A/RHgkhkN4FtLxwhEHb+8NBtcVLLaMeOYjpEqVEHf bllK662//EHQuUbtHTGdZ83u9E139ICqN4OdRfWIYLvoAhlgQolp8sKRGB82e5yAMdRH B4lQGjN7GfMZYhTnIQfxzK40cbEHMScn7nwG6UM74L4VDBUuzxUhAisCVsC/mMRfx5cD yrLA== X-Forwarded-Encrypted: i=1; AJvYcCUbiDZGCNuXI7tUWN4LLZosYU5wNBA40TOgMIQXRaY7I+7trvfy1vfaQw8oRKSR3Ah+3lIdjOeSaYe6gTphj7S6UW3Zh3kbkg0fk85tOkwlM8R6WxW/yD656xU1sUCsRjLOkOFFIXP9kGMopIp5m+twgv6xr7LQZlP28aW8t7Rjfx3qag== X-Gm-Message-State: AOJu0YwLvZMb7If5tiylblln1TByuNwt+AxZLNo5NZ8/44+4gT5L/5Ck cM6zaMiSFQSowMvGxQLY43vF9h4HyNLJDuZmsNhIRkj6EpcaXvWUZ1xWPUbOGXdaND+G4kY/TPg mP7h4hh51pE34C4zZxsRtDyd0ah8= X-Received: by 2002:a92:cf11:0:b0:375:a04d:e1e0 with SMTP id e9e14a558f8ab-375cd1973edmr33811725ab.24.1718272494318; Thu, 13 Jun 2024 02:54:54 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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> <20240613093906.trc2rahodmhqd4lt@pengutronix.de> In-Reply-To: <20240613093906.trc2rahodmhqd4lt@pengutronix.de> From: Shengjiu Wang Date: Thu, 13 Jun 2024 17:54:43 +0800 Message-ID: Subject: Re: [PATCH v7 2/5] clk: imx: clk-audiomix: Add reset controller To: Marco Felsch 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jun 13, 2024 at 5:39=E2=80=AFPM Marco Felsch wrote: > > On 24-06-13, Shengjiu Wang wrote: > > On Thu, Jun 13, 2024 at 4:20=E2=80=AFPM 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. ok, will add it. best regards Shengjiu Wang > > > > > help > > > > Build the driver for i.MX8MP CCM Clock Driver > > > > > > > > diff --git a/drivers/clk/imx/clk-imx8mp-audiomix.c b/drivers/clk/im= x/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.c= om/ > > 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 =3D _adev; > > > > + > > > > + auxiliary_device_delete(adev); > > > > + auxiliary_device_uninit(adev); > > > > +} > > > > + > > > > +static void clk_imx8mp_audiomix_reset_adev_release(struct device *= dev) > > > > +{ > > > > + struct auxiliary_device *adev =3D to_auxiliary_dev(dev); > > > > + > > > > + kfree(adev); > > > > +} > > > > + > > > > +static int clk_imx8mp_audiomix_reset_controller_register(struct de= vice *dev, > > > > + struct clk_i= mx8mp_audiomix_priv *priv) > > > > +{ > > > > + struct auxiliary_device *adev __free(kfree) =3D NULL; > > > > + int ret; > > > > + > > > > + if (!of_property_present(dev->of_node, "#reset-cells")) > > > > + return 0; > > > > + > > > > + adev =3D kzalloc(sizeof(*adev), GFP_KERNEL); > > > > + if (!adev) > > > > + return -ENOMEM; > > > > + > > > > + adev->name =3D "reset"; > > > > + adev->dev.parent =3D dev; > > > > + adev->dev.release =3D clk_imx8mp_audiomix_reset_adev_release; > > > > + > > > > + ret =3D auxiliary_device_init(adev); > > > > + if (ret) > > > > + return ret; > > > > + > > > > + ret =3D auxiliary_device_add(adev); > > > > + if (ret) { > > > > + auxiliary_device_uninit(adev); > > > > + return ret; > > > > + } > > > > + > > > > + return devm_add_action_or_reset(dev, clk_imx8mp_audiomix_rese= t_unregister_adev, > > > > + no_free_ptr(adev)); > > > > +} > > > > + > > > > +#else /* !CONFIG_RESET_CONTROLLER */ > > > > + > > > > +static int clk_imx8mp_audiomix_reset_controller_register(struct cl= k_imx8mp_audiomix_priv *priv) > > > > +{ > > > > + return 0; > > > > +} > > > > + > > > > +#endif /* !CONFIG_RESET_CONTROLLER */ > > > > + > > > > static void clk_imx8mp_audiomix_save_restore(struct device *dev, b= ool save) > > > > { > > > > struct clk_imx8mp_audiomix_priv *priv =3D dev_get_drvdata(dev= ); > > > > @@ -337,6 +396,10 @@ static int clk_imx8mp_audiomix_probe(struct pl= atform_device *pdev) > > > > if (ret) > > > > goto err_clk_register; > > > > > > > > + ret =3D clk_imx8mp_audiomix_reset_controller_register(dev, pr= iv); > > > > + if (ret) > > > > + goto err_clk_register; > > > > + > > > > pm_runtime_put_sync(dev); > > > > return 0; > > > > > > > > -- > > > > 2.34.1 > > > > > > > > > > > > > >