* [PATCH] mx35_3ds: Add watchdog support @ 2010-11-15 14:31 Fabio Estevam 2010-11-15 15:52 ` Uwe Kleine-König 0 siblings, 1 reply; 6+ messages in thread From: Fabio Estevam @ 2010-11-15 14:31 UTC (permalink / raw) To: linux-arm-kernel mx35_3ds: Add watchdog support. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> --- arch/arm/mach-mx3/mach-mx35_3ds.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mx3/mach-mx35_3ds.c b/arch/arm/mach-mx3/mach-mx35_3ds.c index 6b51fec..30e73bd 100644 --- a/arch/arm/mach-mx3/mach-mx35_3ds.c +++ b/arch/arm/mach-mx3/mach-mx35_3ds.c @@ -79,6 +79,7 @@ static const struct mxc_nand_platform_data mx35pdk_nand_board_info __initconst = static struct platform_device *devices[] __initdata = { &mx35pdk_flash, + &imx_wdt_device0, }; static iomux_v3_cfg_t mx35pdk_pads[] = { -- 1.6.0.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] mx35_3ds: Add watchdog support 2010-11-15 14:31 [PATCH] mx35_3ds: Add watchdog support Fabio Estevam @ 2010-11-15 15:52 ` Uwe Kleine-König 2010-11-15 17:31 ` Fabio Estevam 0 siblings, 1 reply; 6+ messages in thread From: Uwe Kleine-König @ 2010-11-15 15:52 UTC (permalink / raw) To: linux-arm-kernel Hi Fabio, On Mon, Nov 15, 2010 at 06:31:09AM -0800, Fabio Estevam wrote: > mx35_3ds: Add watchdog support. I just converted the mx3 watchdog device to dynamic allocation. Will take care of mx35_3ds. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] mx35_3ds: Add watchdog support 2010-11-15 15:52 ` Uwe Kleine-König @ 2010-11-15 17:31 ` Fabio Estevam 2010-11-15 19:04 ` Russell King - ARM Linux 2010-11-16 6:38 ` Uwe Kleine-König 0 siblings, 2 replies; 6+ messages in thread From: Fabio Estevam @ 2010-11-15 17:31 UTC (permalink / raw) To: linux-arm-kernel Hi Uwe and Wolfram, --- On Mon, 11/15/10, Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> wrote: > From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> > Subject: Re: [PATCH] mx35_3ds: Add watchdog support > To: "Fabio Estevam" <fabioestevam@yahoo.com> > Cc: fabio.estevam at freescale.com, s.hauer at pengutronix.de, linux-arm-kernel at lists.infradead.org > Date: Monday, November 15, 2010, 1:52 PM > Hi Fabio, > > On Mon, Nov 15, 2010 at 06:31:09AM -0800, Fabio Estevam > wrote: > > mx35_3ds: Add watchdog support. > I just converted the mx3 watchdog device to dynamic > allocation.? Will > take care of mx35_3ds. Ok, understood. I have also started testing watchdog on MX51. As there is no watchdog clock entry in the CCM block on MX51 I thought on doing the following: diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c index 2ee7dac..63f600c 100644 --- a/drivers/watchdog/imx2_wdt.c +++ b/drivers/watchdog/imx2_wdt.c @@ -270,10 +270,12 @@ static int __init imx2_wdt_probe(struct platform_device *pdev) return -ENOMEM; } - imx2_wdt.clk = clk_get_sys("imx-wdt.0", NULL); - if (IS_ERR(imx2_wdt.clk)) { - dev_err(&pdev->dev, "can't get Watchdog clock\n"); - return PTR_ERR(imx2_wdt.clk); + if (!cpu_is_mx51()) { + imx2_wdt.clk = clk_get_sys("imx-wdt.0", NULL); + if (IS_ERR(imx2_wdt.clk)) { + dev_err(&pdev->dev, "can't get Watchdog clock\n"); + return PTR_ERR(imx2_wdt.clk); + } } Does this look a correct approach? Regards, Fabio Estevam ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] mx35_3ds: Add watchdog support 2010-11-15 17:31 ` Fabio Estevam @ 2010-11-15 19:04 ` Russell King - ARM Linux 2010-11-16 6:38 ` Uwe Kleine-König 1 sibling, 0 replies; 6+ messages in thread From: Russell King - ARM Linux @ 2010-11-15 19:04 UTC (permalink / raw) To: linux-arm-kernel On Mon, Nov 15, 2010 at 09:31:34AM -0800, Fabio Estevam wrote: > diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c > index 2ee7dac..63f600c 100644 > --- a/drivers/watchdog/imx2_wdt.c > +++ b/drivers/watchdog/imx2_wdt.c > @@ -270,10 +270,12 @@ static int __init imx2_wdt_probe(struct > platform_device *pdev) > return -ENOMEM; > } > > - imx2_wdt.clk = clk_get_sys("imx-wdt.0", NULL); > - if (IS_ERR(imx2_wdt.clk)) { > - dev_err(&pdev->dev, "can't get Watchdog clock\n"); > - return PTR_ERR(imx2_wdt.clk); > + if (!cpu_is_mx51()) { > + imx2_wdt.clk = clk_get_sys("imx-wdt.0", NULL); > + if (IS_ERR(imx2_wdt.clk)) { > + dev_err(&pdev->dev, "can't get Watchdog clock\n"); > + return PTR_ERR(imx2_wdt.clk); > + } > } Why not do what we do on other platforms (such as omap) and provide a dummy imx-wdt.0 clock for non-MX51 CPUs? Then you don't need to code such stuff into drivers. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] mx35_3ds: Add watchdog support 2010-11-15 17:31 ` Fabio Estevam 2010-11-15 19:04 ` Russell King - ARM Linux @ 2010-11-16 6:38 ` Uwe Kleine-König 2010-11-16 9:25 ` Fabio Estevam 1 sibling, 1 reply; 6+ messages in thread From: Uwe Kleine-König @ 2010-11-16 6:38 UTC (permalink / raw) To: linux-arm-kernel Hi Fabio, On Mon, Nov 15, 2010 at 09:31:34AM -0800, Fabio Estevam wrote: > Hi Uwe and Wolfram, > > --- On Mon, 11/15/10, Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> wrote: > > > From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> > > Subject: Re: [PATCH] mx35_3ds: Add watchdog support > > To: "Fabio Estevam" <fabioestevam@yahoo.com> > > Cc: fabio.estevam at freescale.com, s.hauer at pengutronix.de, linux-arm-kernel at lists.infradead.org > > Date: Monday, November 15, 2010, 1:52 PM > > Hi Fabio, > > > > On Mon, Nov 15, 2010 at 06:31:09AM -0800, Fabio Estevam > > wrote: > > > mx35_3ds: Add watchdog support. > > I just converted the mx3 watchdog device to dynamic > > allocation.? Will > > take care of mx35_3ds. > > Ok, understood. > > I have also started testing watchdog on MX51. > > As there is no watchdog clock entry in the CCM block on MX51 I thought on doing the following: > > diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c > index 2ee7dac..63f600c 100644 > --- a/drivers/watchdog/imx2_wdt.c > +++ b/drivers/watchdog/imx2_wdt.c > @@ -270,10 +270,12 @@ static int __init imx2_wdt_probe(struct > platform_device *pdev) > return -ENOMEM; > } > > - imx2_wdt.clk = clk_get_sys("imx-wdt.0", NULL); > - if (IS_ERR(imx2_wdt.clk)) { > - dev_err(&pdev->dev, "can't get Watchdog clock\n"); > - return PTR_ERR(imx2_wdt.clk); > + if (!cpu_is_mx51()) { > + imx2_wdt.clk = clk_get_sys("imx-wdt.0", NULL); > + if (IS_ERR(imx2_wdt.clk)) { > + dev_err(&pdev->dev, "can't get Watchdog clock\n"); > + return PTR_ERR(imx2_wdt.clk); > + } (Minor note: after your patch the brackets don't balance anymore.) I wonder why the driver uses clk_get_sys("imx-wdt.0", NULL). IMHO it should use clk_get(&pdev->dev, NULL). (For that to work we need to register the clock using "imx2-wdt.0". (Or even better "imx2-wdt".)) Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] mx35_3ds: Add watchdog support 2010-11-16 6:38 ` Uwe Kleine-König @ 2010-11-16 9:25 ` Fabio Estevam 0 siblings, 0 replies; 6+ messages in thread From: Fabio Estevam @ 2010-11-16 9:25 UTC (permalink / raw) To: linux-arm-kernel Hi Uwe and Wolfram, --- On Tue, 11/16/10, Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> wrote: ... > > I wonder why the driver uses clk_get_sys("imx-wdt.0", > NULL). > IMHO it should use clk_get(&pdev->dev, NULL).? > (For that to work we need > to register the clock using "imx2-wdt.0".? (Or even > better "imx2-wdt".)) I sent a patch for registering a dummy watchdog clock: http://www.spinics.net/lists/arm-kernel/msg104087.html This way we don?t need to change the watchdog driver. Let me know what you think. Regards, Fabio Estevam ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-11-16 9:25 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-11-15 14:31 [PATCH] mx35_3ds: Add watchdog support Fabio Estevam 2010-11-15 15:52 ` Uwe Kleine-König 2010-11-15 17:31 ` Fabio Estevam 2010-11-15 19:04 ` Russell King - ARM Linux 2010-11-16 6:38 ` Uwe Kleine-König 2010-11-16 9:25 ` Fabio Estevam
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).