All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Figa <tomasz.figa@gmail.com>
To: Leela Krishna Amudala <l.krishna@samsung.com>
Cc: linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com,
	wim@iguana.be, t.figa@samsung.com, devicetree@vger.kernel.org,
	dianders@chromium.org, linux-watchdog@vger.kernel.org,
	cpgs@samsung.com, sachin.kamat@linaro.org
Subject: Re: [PATCH V7 3/3] watchdog: s3c2410_wdt: add device tree support and use syscon regmap interface to configure pmu register
Date: Mon, 11 Nov 2013 14:23:14 +0100	[thread overview]
Message-ID: <1730902.jenppXSjOg@flatron> (raw)
In-Reply-To: <1384173897-16106-4-git-send-email-l.krishna@samsung.com>

Hi Leela,

Thanks for addressing my comments for previous version. However now this
won't even build when CONFIG_OF is disabled. See my comments inline.

On Monday 11 of November 2013 18:14:57 Leela Krishna Amudala wrote:
> Add device tree support and use syscon regmap interface to configure
> AUTOMATIC_WDT_RESET_DISABLE and MASK_WDT_RESET_REQUEST registers of PMU
> to mask/unmask enable/disable of watchdog in probe and s2r scenarios.
> 
> Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com>
> ---
>  .../devicetree/bindings/watchdog/samsung-wdt.txt   |   21 ++-
>  drivers/watchdog/Kconfig                           |    1 +
>  drivers/watchdog/s3c2410_wdt.c                     |  154 +++++++++++++++++++-
>  3 files changed, 167 insertions(+), 9 deletions(-)
[snip]
> diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
> index 23aad7c..b57ccae 100644
> --- a/drivers/watchdog/s3c2410_wdt.c
> +++ b/drivers/watchdog/s3c2410_wdt.c
[snip]
> @@ -94,8 +107,56 @@ struct s3c2410_wdt {
>  	unsigned long		wtdat_save;
>  	struct watchdog_device	wdt_device;
>  	struct notifier_block	freq_transition;
> +	struct s3c2410_wdt_variant *pmu_config;
> +	struct regmap *pmureg;
> +};
> +
> +#ifdef CONFIG_OF
> +static const struct s3c2410_wdt_variant pmu_config_s3c2410 = {
> +	.quirks = 0
> +};
> +
> +static const struct s3c2410_wdt_variant pmu_config_5250  = {
> +	.disable_reg = WDT_DISABLE_REG_OFFSET,
> +	.mask_reset_reg = WDT_MASK_RESET_REG_OFFSET,
> +	.mask_bit = 20,
> +	.quirks = QUIRK_NEEDS_PMU_CONFIG
>  };
>  
> +static const struct s3c2410_wdt_variant pmu_config_5420 = {
> +	.disable_reg = WDT_DISABLE_REG_OFFSET,
> +	.mask_reset_reg = WDT_MASK_RESET_REG_OFFSET,
> +	.mask_bit = 0,
> +	.quirks = QUIRK_NEEDS_PMU_CONFIG
> +};

The three variant data structs above are under #ifdef CONFIG_OF, while
they are always needed for the platform match table.

However, since Exynos supports only DT-based device instantation,
I would move only the basic pmu_config_s3c2410 out of the ifdef and
limit the platform match table only to this single variant.

> +
> +static const struct of_device_id s3c2410_wdt_match[] = {
> +	{ .compatible = "samsung,s3c2410-wdt",
> +	  .data = &pmu_config_s3c2410 },
> +	{ .compatible = "samsung,exynos5250-wdt",
> +	  .data = &pmu_config_5250 },
> +	{ .compatible = "samsung,exynos5420-wdt",
> +	  .data = &pmu_config_5420 },
> +	{},
> +};
> +MODULE_DEVICE_TABLE(of, s3c2410_wdt_match);
> +#endif
> +
> +static const struct platform_device_id s3c_wdt_driver_ids[] = {

nit: For consistency with other names in this file, what about
calling this s3c2410_wdt_ids[] instead?

> +	{
> +		.name = "s3c2410-wdt",
> +		.driver_data = (unsigned long)&pmu_config_s3c2410,
> +	}, {
> +		.name = "exynos5250-wdt",
> +		.driver_data = (unsigned long)&pmu_config_5250,
> +	}, {
> +		.name = "exynos5420-wdt",
> +		.driver_data = (unsigned long)&pmu_config_5420,
> +	},

So, generally, you don't need the two Exynos variants above in this array.

Otherwise, the patch is fine.

Best regards,
Tomasz

  reply	other threads:[~2013-11-11 13:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11 12:44 [PATCH V7 0/3] Add watchdog DT nodes and use syscon regmap interfac to configure pmu registers Leela Krishna Amudala
2013-11-11 12:44 ` [PATCH V7 1/3] ARM: dts: Add pmu sysreg node to exynos5250 and exynos5420 dtsi files Leela Krishna Amudala
     [not found]   ` <1384173897-16106-2-git-send-email-l.krishna-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-11-11 13:00     ` Tomasz Figa
2013-11-11 13:00       ` Tomasz Figa
     [not found] ` <1384173897-16106-1-git-send-email-l.krishna-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-11-11 12:44   ` [PATCH V7 2/3] ARM: dts: update watchdog device nodes for Exynos5250 and Exynos5420 Leela Krishna Amudala
2013-11-11 12:44     ` Leela Krishna Amudala
     [not found]     ` <1384173897-16106-3-git-send-email-l.krishna-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-11-11 13:06       ` Tomasz Figa
2013-11-11 13:06         ` Tomasz Figa
2013-11-12  5:57         ` Leela Krishna Amudala
2013-11-11 12:44 ` [PATCH V7 3/3] watchdog: s3c2410_wdt: add device tree support and use syscon regmap interface to configure pmu register Leela Krishna Amudala
2013-11-11 13:23   ` Tomasz Figa [this message]
2013-11-12  6:00     ` Leela Krishna Amudala

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=1730902.jenppXSjOg@flatron \
    --to=tomasz.figa@gmail.com \
    --cc=cpgs@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=kgene.kim@samsung.com \
    --cc=l.krishna@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=sachin.kamat@linaro.org \
    --cc=t.figa@samsung.com \
    --cc=wim@iguana.be \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.