From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guenter Roeck Subject: Re: [PATCHv4] watchdog: dw: Enable OF support for DW watchdog timer Date: Tue, 22 Oct 2013 06:30:17 -0700 Message-ID: <52667DE9.2000605@roeck-us.net> References: <1382441671-18444-1-git-send-email-dinguyen@altera.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1382441671-18444-1-git-send-email-dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org, dinh.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Cc: Jamie Iles , Viresh Kumar , Wim Van Sebroeck , Pavel Machek , Rob Herring , Pawel Moll , Mark Rutland , Stephen Warren , Ian Campbell , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: devicetree@vger.kernel.org On 10/22/2013 04:34 AM, dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org wrote: > From: Dinh Nguyen > > Add device tree support to the DW watchdog timer. > > Signed-off-by: Dinh Nguyen > Acked-by: Jamie Iles > Reviewed-by: Pavel Machek > Cc: Guenter Roeck > Cc: Jamie Iles > Cc: Viresh Kumar > Cc: Wim Van Sebroeck > Cc: Pavel Machek > Cc: Rob Herring > Cc: Pawel Moll > Cc: Mark Rutland > Cc: Stephen Warren > Cc: Ian Campbell > Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Cc: linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > --- > v4: > - Add interrupts as an optional property, use "should contain". > v3: > - Clean up documentation > v2: > - Use of_match_ptr() for of_match_table > --- > .../devicetree/bindings/watchdog/dw_wdt.txt | 19 +++++++++++++++++++ > drivers/watchdog/dw_wdt.c | 8 ++++++++ > 2 files changed, 27 insertions(+) > create mode 100644 Documentation/devicetree/bindings/watchdog/dw_wdt.txt > > diff --git a/Documentation/devicetree/bindings/watchdog/dw_wdt.txt b/Documentation/devicetree/bindings/watchdog/dw_wdt.txt > new file mode 100644 > index 0000000..8f5948a > --- /dev/null > +++ b/Documentation/devicetree/bindings/watchdog/dw_wdt.txt > @@ -0,0 +1,19 @@ > +Synopsys Designware Watchdog Timer > + > +Required Properties: > + > +- compatible : Should contain "snps,dw-wdt" > +- reg : Base address and size of the watchdog timer register. > + Still missing 'clocks' here. Thanks, Guenter > +Optional Properties: > + > +- interrupts : The interrupt used for the watchdog timeout warning. > + > +Example: > + > + watchdog0: wd@ffd02000 { > + compatible = "snps,dw-wdt"; > + reg = <0xffd02000 0x1000>; > + interrupts = <0 171 4>; > + clocks = <&per_base_clk>; > + }; > diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c > index e621098..261fa42 100644 > --- a/drivers/watchdog/dw_wdt.c > +++ b/drivers/watchdog/dw_wdt.c > @@ -29,6 +29,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -340,12 +341,19 @@ static int dw_wdt_drv_remove(struct platform_device *pdev) > return 0; > } > > +static const struct of_device_id dw_wdt_of_match[] = { > + { .compatible = "snps,dw-wdt", }, > + { /* sentinel */ } > +}; > +MODULE_DEVICE_TABLE(of, dw_wdt_of_match); > + > static struct platform_driver dw_wdt_driver = { > .probe = dw_wdt_drv_probe, > .remove = dw_wdt_drv_remove, > .driver = { > .name = "dw_wdt", > .owner = THIS_MODULE, > + .of_match_table = of_match_ptr(dw_wdt_of_match), > #ifdef CONFIG_PM > .pm = &dw_wdt_pm_ops, > #endif /* CONFIG_PM */ > -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html