Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: Gabor Juhos <juhosg@openwrt.org>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	linux-mips@linux-mips.org, "Luis R. Rodriguez" <mcgrof@gmail.com>,
	Cliff Holden <Cliff.Holden@Atheros.com>,
	Imre Kaloz <kaloz@openwrt.org>
Subject: Re: [RFC 08/18] MIPS: ath79: add common watchdog device
Date: Sat, 13 Nov 2010 14:53:09 +0300	[thread overview]
Message-ID: <4CDE7C25.4080204@mvista.com> (raw)
In-Reply-To: <1289598684-30624-9-git-send-email-juhosg@openwrt.org>

Hello.

On 13-11-2010 0:51, Gabor Juhos wrote:

> All supported SoCs have a built-in hardware watchdog driver. This patch
> registers a platform_device for that to make it usable.

> Signed-off-by: Gabor Juhos<juhosg@openwrt.org>
> Signed-off-by: Imre Kaloz<kaloz@openwrt.org>
[...]

> diff --git a/arch/mips/ath79/Kconfig b/arch/mips/ath79/Kconfig
> index 2bd35ef..79bb528 100644
> --- a/arch/mips/ath79/Kconfig
> +++ b/arch/mips/ath79/Kconfig
> @@ -28,4 +28,7 @@ config ATH79_DEV_LEDS_GPIO
>   config ATH79_DEV_UART
>   	def_bool y
>
> +config ATH79_DEV_WDT
> +	def_bool y

    What's the point of introducing this?

> diff --git a/arch/mips/ath79/dev-wdt.c b/arch/mips/ath79/dev-wdt.c
> new file mode 100644
> index 0000000..ba6b8bd
> --- /dev/null
> +++ b/arch/mips/ath79/dev-wdt.c
> @@ -0,0 +1,30 @@
> +/*
> + *  Atheros AR71XX/AR724X/AR913X watchdog device
> + *
> + *  Copyright (C) 2008-2010 Gabor Juhos<juhosg@openwrt.org>
> + *  Copyright (C) 2008 Imre Kaloz<kaloz@openwrt.org>
> + *
> + *  Parts of this file are based on Atheros' 2.6.15 BSP
> + *
> + *  This program is free software; you can redistribute it and/or modify it
> + *  under the terms of the GNU General Public License version 2 as published
> + *  by the Free Software Foundation.
> + */
> +
> +#include<linux/kernel.h>
> +#include<linux/init.h>
> +#include<linux/platform_device.h>
> +
> +#include<asm/mach-ath79/ar71xx_regs.h>
> +#include "common.h"
> +#include "dev-wdt.h"
> +
> +static struct platform_device ath79_wdt_device = {
> +	.name		= "ath79-wdt",
> +	.id		= -1,
> +};
> +
> +void __init ath79_register_wdt(void)
> +{
> +	platform_device_register(&ath79_wdt_device);
> +}

    I'm not sure creating a separate file for the WDT platfrom device is 
really worth it...

> diff --git a/arch/mips/ath79/dev-wdt.h b/arch/mips/ath79/dev-wdt.h
> new file mode 100644
> index 0000000..2546415
> --- /dev/null
> +++ b/arch/mips/ath79/dev-wdt.h
> @@ -0,0 +1,17 @@
> +/*
> + *  Atheros AR71XX/AR724X/AR913X watchdog device
> + *
> + *  Copyright (C) 2008-2010 Gabor Juhos<juhosg@openwrt.org>
> + *  Copyright (C) 2008 Imre Kaloz<kaloz@openwrt.org>
> + *
> + *  This program is free software; you can redistribute it and/or modify it
> + *  under the terms of the GNU General Public License version 2 as published
> + *  by the Free Software Foundation.
> + */
> +
> +#ifndef _ATH_DEV_WDT_H
> +#define _ATH_DEV_WDT_H
> +
> +void ath79_register_wdt(void) __init;
> +
> +#endif

    I think this should better be put into some more common header...

> diff --git a/arch/mips/ath79/setup.c b/arch/mips/ath79/setup.c
> index b36f9f2..693a9e6 100644
> --- a/arch/mips/ath79/setup.c
> +++ b/arch/mips/ath79/setup.c
> @@ -24,6 +24,7 @@
>   #include<asm/mach-ath79/ar71xx_regs.h>
>   #include "common.h"
>   #include "dev-uart.h"
> +#include "dev-wdt.h"
>   #include "machtypes.h"
>
>   #define ATH79_SYS_TYPE_LEN	64
> @@ -259,6 +260,7 @@ static int __init ath79_setup(void)
>   {
>   	ath79_gpio_init();
>   	ath79_register_uart();
> +	ath79_register_wdt();

    Now what if CONFIG_ATH79_DEV_WDT is not enabled? You'll siply get a linker 
error. I think you should define an empty inline ath79_register_wdt() in that 
case.

WBR, Sergei

  reply	other threads:[~2010-11-13 11:55 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-12 21:51 [RFC 00/18] MIPS: initial support for the Atheros AR71XX/AR724X/AR913X SoCs Gabor Juhos
2010-11-12 21:51 ` [RFC 01/18] MIPS: add initial support for the Atheros AR71XX/AR724X/AR931X SoCs Gabor Juhos
2010-11-12 21:51 ` [RFC 02/18] MIPS: ath79: add GPIOLIB support Gabor Juhos
2010-11-12 21:51 ` [RFC 03/18] MIPS: add generic support for multiple machines within a single kernel Gabor Juhos
2010-11-12 21:51 ` [RFC 04/18] MIPS: ath79: utilize the MIPS multi-machine support Gabor Juhos
2010-11-12 21:51 ` [RFC 05/18] MIPS: ath79: add initial support for the Atheros PB44 reference board Gabor Juhos
2010-11-13 11:46   ` Sergei Shtylyov
2010-11-14 17:41     ` Gabor Juhos
2010-11-12 21:51 ` [RFC 06/18] MIPS: ath79: add common GPIO LEDs device Gabor Juhos
2010-11-12 21:51 ` [RFC 07/18] watchdog: add driver for the Atheros AR71XX/AR724X/AR913X SoCs Gabor Juhos
2010-11-15 10:13   ` Wim Van Sebroeck
2010-11-15 10:30     ` Gabor Juhos
2010-11-12 21:51 ` [RFC 08/18] MIPS: ath79: add common watchdog device Gabor Juhos
2010-11-13 11:53   ` Sergei Shtylyov [this message]
2010-11-14 17:41     ` Gabor Juhos
2010-11-12 21:51 ` [RFC 09/18] input: add input driver for polled GPIO buttons Gabor Juhos
2010-11-12 21:51 ` [RFC 10/18] MIPS: ath79: add common GPIO buttons device Gabor Juhos
2010-11-12 21:51 ` [RFC 11/18] spi: add SPI controller driver for the Atheros AR71XX/AR724X/AR913X SoCs Gabor Juhos
2010-11-14  8:22   ` Grant Likely
2010-11-14 21:03     ` Gabor Juhos
2010-11-15  4:04       ` Grant Likely
2010-11-15  9:09         ` Gabor Juhos
2010-11-15 16:28           ` Grant Likely
2010-11-12 21:51 ` [RFC 12/18] MIPS: ath79: add common SPI controller device Gabor Juhos
2010-11-12 21:51 ` [RFC 13/18] USB: ehci: add workaround for Synopsys HC bug Gabor Juhos
2010-11-12 21:51 ` [RFC 14/18] USB: ehci: add bus glue for the Atheros AR71XX/AR724X/AR913X SoCs Gabor Juhos
2010-11-12 21:51 ` [RFC 15/18] USB: ohci: add bus glue for the Atheros AR71XX/AR7240 SoCs Gabor Juhos
2010-11-12 21:51 ` [RFC 16/18] MIPS: ath79: add common USB Host Controller device Gabor Juhos
2010-11-12 21:51 ` [RFC 17/18] MIPS: ath79: add initial support for the Atheros AP81 reference board Gabor Juhos
2010-11-12 21:51 ` [RFC 18/18] MIPS: ath79: add common WMAC device for AR913X based boards Gabor Juhos
2010-11-12 22:00 ` [RFC 00/18] MIPS: initial support for the Atheros AR71XX/AR724X/AR913X SoCs Luis R. Rodriguez

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=4CDE7C25.4080204@mvista.com \
    --to=sshtylyov@mvista.com \
    --cc=Cliff.Holden@Atheros.com \
    --cc=juhosg@openwrt.org \
    --cc=kaloz@openwrt.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mcgrof@gmail.com \
    --cc=ralf@linux-mips.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