aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/coh901327_wdt.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-07-07headers: separate linux/mod_devicetable.h from linux/platform_device.hRandy Dunlap1-0/+1
At over 4000 #includes, <linux/platform_device.h> is the 9th most #included header file in the Linux kernel. It does not need <linux/mod_devicetable.h>, so drop that header and explicitly add <linux/mod_devicetable.h> to source files that need it. 4146 #include <linux/platform_device.h> After this patch, there are 225 files that use <linux/mod_devicetable.h>, for a reduction of around 3900 times that <linux/mod_devicetable.h> does not have to be read & parsed. 225 #include <linux/mod_devicetable.h> This patch was build-tested on 20 different arch-es. It also makes these drivers SubmitChecklist#1 compliant. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reported-by: kbuild test robot <lkp@intel.com> # drivers/media/platform/vimc/ Reported-by: kbuild test robot <lkp@intel.com> # drivers/pinctrl/pinctrl-u300.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-03watchdog: coh901327: make license text and module licence matchMarcus Folkesson1-2/+2
Licence text is specifying "GPLv2" but the MODULE_LICENSE is set to "GPLv2 or later". See include/linux/module.h: "GPL" [GNU Public License v2 or later] "GPL v2" [GNU Public License v2] When on it, add SPDX identifier tag. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2018-03-03watchdog: coh901327: make use of timeout-secs provided in devicetreeMarcus Folkesson1-6/+8
watchdog_init_timeout() will allways pick timeout_param since it defaults to a valid timeout. Following best practice described in Documentation/watchdog/watchdog-kernel-api.txt to make use of the parameter logic. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2017-09-09watchdog: coh901327_wdt: constify watchdog_ops structureGustavo A. R. Silva1-1/+1
Check for watchdog_ops structures that are only stored in the ops field of a watchdog_device structure. This field is declared const, so watchdog_ops structures that have this property can be declared as const also. This issue was detected using Coccinelle and the following semantic patch: @r disable optional_qualifier@ identifier i; position p; @@ static struct watchdog_ops i@p = { ... }; @ok@ identifier r.i; struct watchdog_device e; position p; @@ e.ops = &i@p; @bad@ position p != {r.p,ok.p}; identifier r.i; struct watchdog_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct watchdog_ops i = { ... }; Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2017-02-24watchdog: coh901327_wdt: Use dev variable instead of pdev->devGuenter Roeck1-19/+15
Use a local dev variable instead of dereferencing pdev->dev several times in the probe function to make the code easier to read. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-24watchdog: coh901327_wdt: Use devm_ioremap_resource to map resourcesGuenter Roeck1-26/+5
Map resources using devm_ioremap_resource() to simplify error handling. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-24watchdog: coh901327_wdt: Keep clock enabled after loading driverGuenter Roeck1-20/+1
Enabling the clock before accessing chip registers and disabling it afterwards does not really make sense and only adds complexity to the driver. In addition to that, a comment int the driver suggests that it does not serve a useful purpose either. "The watchdog block is of course always clocked, the clk_enable()/clk_disable() calls are mainly for performing reference counting higher up in the clock hierarchy." Just keep the clock enabled instead. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-24watchdog: coh901327_wdt: Simplify error handling in probe functionGuenter Roeck1-4/+2
Checking if there is no error followed by a goto if there is one is confusing. Reverse the logic. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-09-09Watchdog: Fix parent of watchdog_devicesPratyush Anand1-0/+1
/sys/class/watchdog/watchdogn/device/modalias can help to identify the driver/module for a given watchdog node. However, many wdt devices do not set their parent and so, we do not see an entry for device in sysfs for such devices. This patch fixes parent of watchdog_device so that /sys/class/watchdog/watchdogn/device is populated. Exceptions: booke, diag288, octeon, softdog and w83627hf -- They do not have any parent. Not sure, how we can identify driver for these devices. Signed-off-by: Pratyush Anand <panand@redhat.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Lubomir Rintel <lkundrak@v3.sk> Acked-by: Maxime Coquelin <maxime.coquelin@st.com> Acked-by: Thierry Reding <treding@nvidia.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2014-10-20watchdog: drop owner assignment from platform_driversWolfram Sang1-1/+0
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2013-05-31watchdog: coh901327: devicetree supportLinus Walleij1-3/+9
This adds support for probing the COH 901 327 watchdog from the device tree and also adds associated bindings. Acked-by: Wim Van Sebroeck <wim@iguana.be> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-01-17watchdog: convert drivers/watchdog/* to use module_platform_driver_probeFabio Porcedda1-11/+1
This makes the code a bit smaller by getting rid of some boilerplate code. Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com> Cc: Wim Van Sebroeck <wim@iguana.be> Cc: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-23watchdog: coh901327_wdt: use clk_prepare/unprepareLinus Walleij1-3/+4
Make sure we prepare/unprepare the COH901327 watchdog timer as is required by the clk API especially if you use common clock. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by : Pankaj Jangra <jangra.pankaj9@gmail.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-03-27watchdog: coh901327_wdt.c: fix timeoutWim Van Sebroeck1-6/+10
Set the timeout value properly so that we don't get faulty values for the WDIOC_GETTIMEOUT iotcl. 'margin' should be an unsigned int. Also add a check to see if margin is a valid parameter after it is loaded as a module. Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Wolfram Sang <w.sang@pengutronix.de>
2012-03-27watchdog: coh901327: convert to use watchdog coreLinus Walleij1-137/+55
This converts the COH901327 watchdog to use the watchdog core. I followed Wolframs document, looked at some other drivers and tested it on the U300. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Cc: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2011-12-26watchdog: move coh901327 state holdersLinus Walleij1-2/+4
The state holders used in the PM path of the drivers report as unused variables when compiling without CONFIG_PM so let's move them inside CONFIG_PM. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2011-11-05watchdog: irq: Remove IRQF_DISABLEDYong Zhang1-1/+1
This flag is a NOOP and can be removed now. Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2010-03-07[WATCHDOG] watchdog_info constifyWim Van Sebroeck1-1/+1
make the watchdog_info struct const where possible. Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2009-12-04tree-wide: fix assorted typos all over the placeAndré Goddard Rosa1-1/+1
That is "success", "unknown", "through", "performance", "[re|un]mapping" , "access", "default", "reasonable", "[con]currently", "temperature" , "channel", "[un]used", "application", "example","hierarchy", "therefore" , "[over|under]flow", "contiguous", "threshold", "enough" and others. Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-09-18[WATCHDOG] Use DIV_ROUND_UP() macro in the coh901327 WDTLinus Walleij1-1/+1
I saw Julia Lawalls various commits fixing up the use of rounding macros and since my already submitted patch was not caught in this I took it upon myself to fix it up for this driver as well. Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2009-08-02[WATCHDOG] Fix COH 901 327 watchdog enablementLinus Walleij1-0/+11
Since the COH 901 327 found in U300 is clocked at 32 kHz we need to wait for the interrupt clearing flag to propagate through hardware in order not to accidentally fire off any interrupts when we enable them. Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2009-06-20[WATCHDOG] U300 COH 901 327 watchdog driverLinus Walleij1-0/+537
This patch adds support for the U300 COH 901 327 watchdog for the U300 platform recently added to RMK:s ARM tree. Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>