mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Jerome Brunet <jbrunet@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	 Neil Armstrong <neil.armstrong@linaro.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Jiucheng Xu <jiucheng.xu@amlogic.com>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 8/9] reset: amlogic: split the device core and platform probe
Date: Thu, 12 Sep 2024 10:12:14 +0200	[thread overview]
Message-ID: <8cb81058c8f45e378675e078e296336a2cf74308.camel@pengutronix.de> (raw)
In-Reply-To: <20240910-meson-rst-aux-v5-8-60be62635d3e@baylibre.com>

On Di, 2024-09-10 at 18:32 +0200, Jerome Brunet wrote:
> To prepare the addition of the auxiliary device support, split
> out the device coomon functions from the probe of the platform device.
> 
> The device core function will be common to both the platform and auxiliary
> driver.
> 
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  drivers/reset/amlogic/Kconfig              |   7 +-
>  drivers/reset/amlogic/Makefile             |   1 +
>  drivers/reset/amlogic/reset-meson-common.c | 121 ++++++++++++++++++++++++++++
>  drivers/reset/amlogic/reset-meson.c        | 122 ++++-------------------------
>  drivers/reset/amlogic/reset-meson.h        |  24 ++++++
>  5 files changed, 167 insertions(+), 108 deletions(-)
> 
> diff --git a/drivers/reset/amlogic/Kconfig b/drivers/reset/amlogic/Kconfig
> index 532e6a4f7865..1d77987088f4 100644
> --- a/drivers/reset/amlogic/Kconfig
> +++ b/drivers/reset/amlogic/Kconfig
> @@ -1,10 +1,15 @@
> +config RESET_MESON_COMMON
> +	tristate
> +	select REGMAP
> +
>  config RESET_MESON
>  	tristate "Meson Reset Driver"
>  	depends on ARCH_MESON || COMPILE_TEST
>  	default ARCH_MESON
>  	select REGMAP_MMIO
> +	select RESET_MESON_COMMON
>  	help
> -	  This enables the reset driver for Amlogic Meson SoCs.
> +	  This enables the reset driver for Amlogic SoCs.
>  
>  config RESET_MESON_AUDIO_ARB
>  	tristate "Meson Audio Memory Arbiter Reset Driver"
> diff --git a/drivers/reset/amlogic/Makefile b/drivers/reset/amlogic/Makefile
> index 55509fc78513..74aaa2fb5e13 100644
> --- a/drivers/reset/amlogic/Makefile
> +++ b/drivers/reset/amlogic/Makefile
> @@ -1,2 +1,3 @@
>  obj-$(CONFIG_RESET_MESON) += reset-meson.o
> +obj-$(CONFIG_RESET_MESON_COMMON) += reset-meson-common.o
>  obj-$(CONFIG_RESET_MESON_AUDIO_ARB) += reset-meson-audio-arb.o
> diff --git a/drivers/reset/amlogic/reset-meson-common.c b/drivers/reset/amlogic/reset-meson-common.c
> new file mode 100644
> index 000000000000..d57544801ae9
> --- /dev/null
> +++ b/drivers/reset/amlogic/reset-meson-common.c
> @@ -0,0 +1,121 @@
> +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
> +/*
> + * Amlogic Meson Reset core functions
> + *
> + * Copyright (c) 2016-2024 BayLibre, SAS.
> + * Authors: Neil Armstrong <narmstrong@baylibre.com>
> + *          Jerome Brunet <jbrunet@baylibre.com>
> + */
> +
> +#include <linux/device.h>
> +#include <linux/module.h>
> +#include <linux/regmap.h>
> +#include <linux/reset-controller.h>
> +
> +#include "reset-meson.h"
> +
> +struct meson_reset {
> +	const struct meson_reset_param *param;
> +	struct reset_controller_dev rcdev;
> +	struct regmap *map;
> +};
> +
> +static void meson_reset_offset_and_bit(struct meson_reset *data,
> +				       unsigned long id,
> +				       unsigned int *offset,
> +				       unsigned int *bit)
> +{
> +	unsigned int stride = regmap_get_reg_stride(data->map);
> +
> +	*offset = (id / (stride * BITS_PER_BYTE)) * stride;
> +	*bit = id % (stride * BITS_PER_BYTE);
> +}
> +
> +static int meson_reset_reset(struct reset_controller_dev *rcdev,
> +			     unsigned long id)

checkpatch --strict complains about the alignment here.
I'll fix this up when applying, no need to resend.

regards
Philipp

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  parent reply	other threads:[~2024-09-12  8:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10 16:32 [PATCH v5 0/9] reset: amlogic: move audio reset drivers out of CCF Jerome Brunet
2024-09-10 16:32 ` [PATCH v5 1/9] reset: amlogic: convert driver to regmap Jerome Brunet
2024-09-10 16:32 ` [PATCH v5 2/9] reset: amlogic: use generic data matching function Jerome Brunet
2024-09-10 16:32 ` [PATCH v5 3/9] reset: amlogic: make parameters unsigned Jerome Brunet
2024-09-10 16:32 ` [PATCH v5 4/9] reset: amlogic: add driver parameters Jerome Brunet
2024-09-11 10:24   ` Neil Armstrong
2024-09-10 16:32 ` [PATCH v5 5/9] reset: amlogic: use reset number instead of register count Jerome Brunet
2024-09-10 16:32 ` [PATCH v5 6/9] reset: amlogic: add reset status support Jerome Brunet
2024-09-10 16:32 ` [PATCH v5 7/9] reset: amlogic: move drivers to a dedicated directory Jerome Brunet
2024-09-10 16:32 ` [PATCH v5 8/9] reset: amlogic: split the device core and platform probe Jerome Brunet
2024-09-11 10:24   ` Neil Armstrong
2024-09-12  8:12   ` Philipp Zabel [this message]
2024-09-13  6:53     ` Jerome Brunet
2024-09-30 16:56       ` Philipp Zabel
2024-10-04 13:30         ` Jerome Brunet
2024-10-07  8:37           ` Philipp Zabel
2024-10-08  7:51             ` Jerome Brunet
2024-09-10 16:32 ` [PATCH v5 9/9] reset: amlogic: add auxiliary reset driver support Jerome Brunet
2024-09-12  8:11 ` [PATCH v5 0/9] reset: amlogic: move audio reset drivers out of CCF Philipp Zabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8cb81058c8f45e378675e078e296336a2cf74308.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=jbrunet@baylibre.com \
    --cc=jiucheng.xu@amlogic.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=neil.armstrong@linaro.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®