Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1285707lqo; Fri, 17 May 2024 18:29:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVWsVEr0veuVlGlNWeFQc1QIRfEl1lfNLvkPmapXzn0C5CLfFGx8HYyQvDqM9uBD9TPqb1BKf/OoA/vAnuxguRo69EezBiyJqiac3iseQ== X-Google-Smtp-Source: AGHT+IEuwzxAuXbqpPXRFbJ42vQpfrBkJjkhG48azyfi74XdywWS1u87hLjumGPfEOeTOFN6cSFW X-Received: by 2002:ac8:7fcb:0:b0:43a:d899:9089 with SMTP id d75a77b69052e-43dfdb9185bmr251525971cf.41.1715995768056; Fri, 17 May 2024 18:29:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715995768; cv=pass; d=google.com; s=arc-20160816; b=bkCDLz+TIwfyG6JfikWUoFG04gpNA08IBx1osfVCx6tRkY/WSykMQDGA3coZx2G+/5 zVyio6BDBf7Bm4/ghWmvqkFWxUsKRU1SPiOfkU+P64xd0i59gVVs13hAW6GTmJRYsJTn Fbb/AWmz4Zn8N5pZpvEA3Plc1RvP0enYk8OCdXZdQyMORFc4IgUeyvZv8PbLgcsZFhJo tumwa3if0U7Ewe5kr9S9FCi2mAzaQz1zb5IMhh7/NIVixjYTLqtd3F7FIYPWCXL9ksH5 8AH7fKfTSIUdiWEyAUSw2D9vCCcsrNoaGoDDWe+E3jv8YMAzaWKs/09bVyuUpVdhWrNT 3UqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature :dkim-filter; bh=AZKg+0v7j7yA5sSyJOkuQm+dR23h+2ArrHxYVBhrY/I=; fh=gg5Fl5S6y2MC5YLCA04WVhNG0wxAYrSORGgGsIMAM2w=; b=QCSqXjyLTHTKA6p22tZ7uRkbRJU1A7WRzqDSwN7ClFkrKQihv760h/4i3CK/mh4iS7 cl+GQ7DxzifoWZ7ivu7X3rg70qHOlTB/vzXN8TLenWk+fJDj7+h5vFG0SjFhFbUApLbL RJIPRzuPtgcWOQ+3o/Sto7yV9tBHY+MhZKZVAmqY+xBeAKzQvsZgivtvIaapEE8bazud MlSLAbOmkL+TB40bUXX4KgHwkXoWkyxZs1QOh35TpQysFTj6PusSSLwfiMgxrIBuRsCH D9tR+K/fH4FDlhSugNDZFXaa/xzzI5vMbcq5rp2msRx6Wln45WfQHAU1HGVuWrpEoh9x HPpw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=OwEPqBh5; arc=pass (i=1 spf=pass spfdomain=sberdevices.ru dkim=pass dkdomain=salutedevices.com dmarc=pass fromdomain=salutedevices.com); spf=pass (google.com: domain of linux-kernel+bounces-182736-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182736-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=salutedevices.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43e39db38d4si61581641cf.629.2024.05.17.18.29.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 18:29:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182736-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=OwEPqBh5; arc=pass (i=1 spf=pass spfdomain=sberdevices.ru dkim=pass dkdomain=salutedevices.com dmarc=pass fromdomain=salutedevices.com); spf=pass (google.com: domain of linux-kernel+bounces-182736-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182736-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=salutedevices.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B4EE71C2160A for ; Sat, 18 May 2024 01:29:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A8CFE4A29; Sat, 18 May 2024 01:29:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b="OwEPqBh5" Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) (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 F1894653; Sat, 18 May 2024 01:29:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.89.224.132 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715995761; cv=none; b=Dl8gbZ+y3cT9PeJZfB20UZEqGc3bT7xijtLhR5bPN8COgs8YfXkd3IXyTRb9JIiktNX2ymiNxgDZyUl7EPVuD6asIqR6+ns5GhMjm5kOItGdWBQqeiiPs+70Y5EQOyjX/vcEGT6wUqLk0om9/9JNeFxvvBKwUNzPq8ahARV943Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715995761; c=relaxed/simple; bh=8G7tL8nD9d2hUGZR4z9MrJFi0euwCo/CgnkUMXelI4U=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=U5YOZsY60j9NrEGTxajtKbh3yKEA6EkfVlRosE4Nbyd//ArSlYkOX0Z5S7cdSOMMUCC8sSVOOlPGFHC8OblVSR84z3X+IjInYnyazek9l9NtYLtY50aqneMALTtA70qN5oHhk4mQO1rUZlsxEPjepmD5wJtE5aqCW9qH0iZz4rg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=salutedevices.com; spf=pass smtp.mailfrom=sberdevices.ru; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b=OwEPqBh5; arc=none smtp.client-ip=45.89.224.132 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=salutedevices.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sberdevices.ru Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 25810120009; Sat, 18 May 2024 04:29:07 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 25810120009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1715995747; bh=AZKg+0v7j7yA5sSyJOkuQm+dR23h+2ArrHxYVBhrY/I=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type:From; b=OwEPqBh5WFlvxcpgmcDV+4R53+Se/IdjZdTbRaeQAAwS91uU/kYPgmZY2NBe96eRR Gwoj3/Mt6SRZJuDeSsasD0Nu6yOi9adgr+wTM+VeMh+ICIq5WMXNhm4D12Dyr4lwxp FphRtZGexpF9XpnwHz5JGhqgM3p+4bHZaes3Ha8k3YyXEBwpz4W3g3CAoypKQ0aVdr hkkwbXMS3wsxJ5HkHmHKgAmwolvUgqNcdRIGYLwCSOh4o6YjNRvugozwdYZ0E5phjc TDghzoSB62uMt3RSfTFjiQINVmbJDkBmZB+B+EYgQaK5UP0xX6j1YQqendRNBDchJP P4fRnOObd33Pw== Received: from smtp.sberdevices.ru (p-i-exch-sc-m02.sberdevices.ru [172.16.192.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Sat, 18 May 2024 04:29:06 +0300 (MSK) Received: from [192.168.20.2] (100.64.160.123) by p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sat, 18 May 2024 04:29:06 +0300 Message-ID: Date: Sat, 18 May 2024 04:28:15 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 7/9] reset: amlogic: add auxiliary reset driver support Content-Language: en-US To: Jerome Brunet , Philipp Zabel , Stephen Boyd , Neil Armstrong CC: , , References: <20240516150842.705844-1-jbrunet@baylibre.com> <20240516150842.705844-8-jbrunet@baylibre.com> From: Jan Dakinevich In-Reply-To: <20240516150842.705844-8-jbrunet@baylibre.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 185325 [May 18 2024] X-KSMG-AntiSpam-Version: 6.1.0.4 X-KSMG-AntiSpam-Envelope-From: YVDakinevich@sberdevices.ru X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 20 0.3.20 743589a8af6ec90b529f2124c2bbfc3ce1d2f20f, {Tracking_smtp_not_equal_from}, {Tracking_from_domain_doesnt_match_to}, sberdevices.ru:7.1.1,5.0.1;smtp.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1;127.0.0.199:7.1.2, FromAlignment: n, {Tracking_smtp_domain_mismatch}, {Tracking_smtp_domain_2level_mismatch}, {Tracking_white_helo}, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2024/05/17 20:54:00 #25244128 X-KSMG-AntiVirus-Status: Clean, skipped On 5/16/24 18:08, Jerome Brunet wrote: > Add support for the reset controller present in the audio clock > controller of the g12 and sm1 SoC families, using the auxiliary bus. > > This is expected to replace the driver currently present directly > within the related clock driver. > > Signed-off-by: Jerome Brunet > --- > drivers/reset/Kconfig | 1 + > drivers/reset/reset-meson.c | 46 ++++++++++++++++++- > include/soc/amlogic/meson8b-auxiliary-reset.h | 17 +++++++ > 3 files changed, 63 insertions(+), 1 deletion(-) > create mode 100644 include/soc/amlogic/meson8b-auxiliary-reset.h > > diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig > index 85b27c42cf65..4ceb4dc48fbc 100644 > --- a/drivers/reset/Kconfig > +++ b/drivers/reset/Kconfig > @@ -134,6 +134,7 @@ config RESET_MCHP_SPARX5 > config RESET_MESON > tristate "Meson Reset Driver" > depends on ARCH_MESON || COMPILE_TEST > + depends on AUXILIARY_BUS I don't understand, who enables AUXILIARY_BUS. If I'm not mistaken, AUXILIARY_BUS should be selected by something that is going to use it, and it is not intended for defconfig. > default ARCH_MESON > help > This enables the reset driver for Amlogic Meson SoCs. > diff --git a/drivers/reset/reset-meson.c b/drivers/reset/reset-meson.c > index e34a10b15593..b5ddb85296ec 100644 > --- a/drivers/reset/reset-meson.c > +++ b/drivers/reset/reset-meson.c > @@ -5,6 +5,7 @@ > * Copyright (c) 2016 BayLibre, SAS. > * Author: Neil Armstrong > */ > +#include > #include > #include > #include > @@ -16,6 +17,8 @@ > #include > #include > > +#include > + > struct meson_reset_param { > const struct reset_control_ops *reset_ops; > unsigned int reset_num; > @@ -218,6 +221,47 @@ static struct platform_driver meson_reset_pltf_driver = { > }; > module_platform_driver(meson_reset_pltf_driver); > > -MODULE_DESCRIPTION("Amlogic Meson Reset Controller driver"); > +static const struct meson_reset_param meson_g12a_audio_param = { > + .reset_ops = &meson_reset_toggle_ops, > + .reset_num = 26, > + .level_offset = 0x24, > +}; > + > +static const struct meson_reset_param meson_sm1_audio_param = { > + .reset_ops = &meson_reset_toggle_ops, > + .reset_num = 39, > + .level_offset = 0x28, > +}; > + > +static const struct auxiliary_device_id meson_reset_aux_ids[] = { > + { > + .name = "axg-audio-clkc.rst-g12a", > + .driver_data = (kernel_ulong_t)&meson_g12a_audio_param, > + }, { > + .name = "axg-audio-clkc.rst-sm1", > + .driver_data = (kernel_ulong_t)&meson_sm1_audio_param, > + }, > +}; > +MODULE_DEVICE_TABLE(auxiliary, meson_reset_aux_ids); > + > +static int meson_reset_aux_probe(struct auxiliary_device *adev, > + const struct auxiliary_device_id *id) > +{ > + const struct meson_reset_param *param = > + (const struct meson_reset_param *)(id->driver_data); > + struct meson8b_reset_adev *raux = > + to_meson8b_reset_adev(adev); > + > + return meson_reset_probe(&adev->dev, raux->map, param); > +} > + > +static struct auxiliary_driver meson_reset_aux_driver = { > + .probe = meson_reset_aux_probe, > + .id_table = meson_reset_aux_ids, > +}; > +module_auxiliary_driver(meson_reset_aux_driver); > + > +MODULE_DESCRIPTION("Amlogic Meson Reset driver"); > MODULE_AUTHOR("Neil Armstrong "); > +MODULE_AUTHOR("Jerome Brunet "); > MODULE_LICENSE("Dual BSD/GPL"); > diff --git a/include/soc/amlogic/meson8b-auxiliary-reset.h b/include/soc/amlogic/meson8b-auxiliary-reset.h > new file mode 100644 > index 000000000000..0a465deb4440 > --- /dev/null > +++ b/include/soc/amlogic/meson8b-auxiliary-reset.h > @@ -0,0 +1,17 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef __SOC_AMLOGIC_MESON8B_AUX_RESET_H > +#define __SOC_AMLOGIC_MESON8B_AUX_RESET_H > + > +#include > +#include > +#include > + > +struct meson8b_reset_adev { > + struct auxiliary_device adev; > + struct regmap *map; > +}; > + > +#define to_meson8b_reset_adev(_adev) \ > + container_of((_adev), struct meson8b_reset_adev, adev) > + > +#endif /* __SOC_AMLOGIC_MESON8B_AUX_RESET_H */ -- Best regards Jan Dakinevich