Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ARM] Orion/Kirkwood: rename orion5x_wdt to orion_wdt

The Orion watchdog driver is also used on Kirkwood.

Convention is to use orion5x for stuff specific to 88F5xxx Orion chips
and simply "orion" for shared stuff across SoCs including Kirkwood.

Signed-off-by: Nicolas Pitre <nico@marvell.com>

+69 -69
+3 -3
arch/arm/mach-kirkwood/common.c
··· 30 30 #include <plat/mvsdio.h> 31 31 #include <plat/mv_xor.h> 32 32 #include <plat/orion_nand.h> 33 - #include <plat/orion5x_wdt.h> 33 + #include <plat/orion_wdt.h> 34 34 #include <plat/time.h> 35 35 #include "common.h" 36 36 ··· 771 771 /***************************************************************************** 772 772 * Watchdog 773 773 ****************************************************************************/ 774 - static struct orion5x_wdt_platform_data kirkwood_wdt_data = { 774 + static struct orion_wdt_platform_data kirkwood_wdt_data = { 775 775 .tclk = 0, 776 776 }; 777 777 778 778 static struct platform_device kirkwood_wdt_device = { 779 - .name = "orion5x_wdt", 779 + .name = "orion_wdt", 780 780 .id = -1, 781 781 .dev = { 782 782 .platform_data = &kirkwood_wdt_data,
+3 -3
arch/arm/mach-orion5x/common.c
··· 31 31 #include <plat/ehci-orion.h> 32 32 #include <plat/mv_xor.h> 33 33 #include <plat/orion_nand.h> 34 - #include <plat/orion5x_wdt.h> 34 + #include <plat/orion_wdt.h> 35 35 #include <plat/time.h> 36 36 #include "common.h" 37 37 ··· 540 540 /***************************************************************************** 541 541 * Watchdog 542 542 ****************************************************************************/ 543 - static struct orion5x_wdt_platform_data orion5x_wdt_data = { 543 + static struct orion_wdt_platform_data orion5x_wdt_data = { 544 544 .tclk = 0, 545 545 }; 546 546 547 547 static struct platform_device orion5x_wdt_device = { 548 - .name = "orion5x_wdt", 548 + .name = "orion_wdt", 549 549 .id = -1, 550 550 .dev = { 551 551 .platform_data = &orion5x_wdt_data,
+4 -4
arch/arm/plat-orion/include/plat/orion5x_wdt.h arch/arm/plat-orion/include/plat/orion_wdt.h
··· 1 1 /* 2 - * arch/arm/plat-orion/include/plat/orion5x_wdt.h 2 + * arch/arm/plat-orion/include/plat/orion_wdt.h 3 3 * 4 4 * This file is licensed under the terms of the GNU General Public 5 5 * License version 2. This program is licensed "as is" without any 6 6 * warranty of any kind, whether express or implied. 7 7 */ 8 8 9 - #ifndef __PLAT_ORION5X_WDT_H 10 - #define __PLAT_ORION5X_WDT_H 9 + #ifndef __PLAT_ORION_WDT_H 10 + #define __PLAT_ORION_WDT_H 11 11 12 - struct orion5x_wdt_platform_data { 12 + struct orion_wdt_platform_data { 13 13 u32 tclk; /* no <linux/clk.h> support yet */ 14 14 }; 15 15
+4 -4
drivers/watchdog/Kconfig
··· 231 231 NOTE: once enabled, this timer cannot be disabled. 232 232 Say N if you are unsure. 233 233 234 - config ORION5X_WATCHDOG 235 - tristate "Orion5x watchdog" 234 + config ORION_WATCHDOG 235 + tristate "Orion watchdog" 236 236 depends on ARCH_ORION5X || ARCH_KIRKWOOD 237 237 help 238 238 Say Y here if to include support for the watchdog timer 239 - in the Orion5x and Kirkwood ARM SoCs. 239 + in the Marvell Orion5x and Kirkwood ARM SoCs. 240 240 To compile this driver as a module, choose M here: the 241 - module will be called orion5x_wdt. 241 + module will be called orion_wdt. 242 242 243 243 # AVR32 Architecture 244 244
+1 -1
drivers/watchdog/Makefile
··· 40 40 obj-$(CONFIG_PNX4008_WATCHDOG) += pnx4008_wdt.o 41 41 obj-$(CONFIG_IOP_WATCHDOG) += iop_wdt.o 42 42 obj-$(CONFIG_DAVINCI_WATCHDOG) += davinci_wdt.o 43 - obj-$(CONFIG_ORION5X_WATCHDOG) += orion5x_wdt.o 43 + obj-$(CONFIG_ORION_WATCHDOG) += orion_wdt.o 44 44 45 45 # AVR32 Architecture 46 46 obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
+54 -54
drivers/watchdog/orion5x_wdt.c drivers/watchdog/orion_wdt.c
··· 1 1 /* 2 - * drivers/watchdog/orion5x_wdt.c 2 + * drivers/watchdog/orion_wdt.c 3 3 * 4 - * Watchdog driver for Orion5x processors 4 + * Watchdog driver for Orion/Kirkwood processors 5 5 * 6 6 * Author: Sylver Bruneau <sylver.bruneau@googlemail.com> 7 7 * ··· 23 23 #include <linux/io.h> 24 24 #include <linux/spinlock.h> 25 25 #include <mach/bridge-regs.h> 26 - #include <plat/orion5x_wdt.h> 26 + #include <plat/orion_wdt.h> 27 27 28 28 /* 29 29 * Watchdog timer block registers. ··· 43 43 static unsigned long wdt_status; 44 44 static spinlock_t wdt_lock; 45 45 46 - static void orion5x_wdt_ping(void) 46 + static void orion_wdt_ping(void) 47 47 { 48 48 spin_lock(&wdt_lock); 49 49 ··· 53 53 spin_unlock(&wdt_lock); 54 54 } 55 55 56 - static void orion5x_wdt_enable(void) 56 + static void orion_wdt_enable(void) 57 57 { 58 58 u32 reg; 59 59 ··· 80 80 spin_unlock(&wdt_lock); 81 81 } 82 82 83 - static void orion5x_wdt_disable(void) 83 + static void orion_wdt_disable(void) 84 84 { 85 85 u32 reg; 86 86 ··· 99 99 spin_unlock(&wdt_lock); 100 100 } 101 101 102 - static int orion5x_wdt_get_timeleft(int *time_left) 102 + static int orion_wdt_get_timeleft(int *time_left) 103 103 { 104 104 spin_lock(&wdt_lock); 105 105 *time_left = readl(WDT_VAL) / wdt_tclk; ··· 107 107 return 0; 108 108 } 109 109 110 - static int orion5x_wdt_open(struct inode *inode, struct file *file) 110 + static int orion_wdt_open(struct inode *inode, struct file *file) 111 111 { 112 112 if (test_and_set_bit(WDT_IN_USE, &wdt_status)) 113 113 return -EBUSY; 114 114 clear_bit(WDT_OK_TO_CLOSE, &wdt_status); 115 - orion5x_wdt_enable(); 115 + orion_wdt_enable(); 116 116 return nonseekable_open(inode, file); 117 117 } 118 118 119 - static ssize_t orion5x_wdt_write(struct file *file, const char *data, 119 + static ssize_t orion_wdt_write(struct file *file, const char *data, 120 120 size_t len, loff_t *ppos) 121 121 { 122 122 if (len) { ··· 133 133 set_bit(WDT_OK_TO_CLOSE, &wdt_status); 134 134 } 135 135 } 136 - orion5x_wdt_ping(); 136 + orion_wdt_ping(); 137 137 } 138 138 return len; 139 139 } 140 140 141 - static int orion5x_wdt_settimeout(int new_time) 141 + static int orion_wdt_settimeout(int new_time) 142 142 { 143 143 if ((new_time <= 0) || (new_time > wdt_max_duration)) 144 144 return -EINVAL; 145 145 146 146 /* Set new watchdog time to be used when 147 - * orion5x_wdt_enable() or orion5x_wdt_ping() is called. */ 147 + * orion_wdt_enable() or orion_wdt_ping() is called. */ 148 148 heartbeat = new_time; 149 149 return 0; 150 150 } ··· 152 152 static const struct watchdog_info ident = { 153 153 .options = WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT | 154 154 WDIOF_KEEPALIVEPING, 155 - .identity = "Orion5x Watchdog", 155 + .identity = "Orion Watchdog", 156 156 }; 157 157 158 - static long orion5x_wdt_ioctl(struct file *file, unsigned int cmd, 158 + static long orion_wdt_ioctl(struct file *file, unsigned int cmd, 159 159 unsigned long arg) 160 160 { 161 161 int ret = -ENOTTY; ··· 173 173 break; 174 174 175 175 case WDIOC_KEEPALIVE: 176 - orion5x_wdt_ping(); 176 + orion_wdt_ping(); 177 177 ret = 0; 178 178 break; 179 179 ··· 182 182 if (ret) 183 183 break; 184 184 185 - if (orion5x_wdt_settimeout(time)) { 185 + if (orion_wdt_settimeout(time)) { 186 186 ret = -EINVAL; 187 187 break; 188 188 } 189 - orion5x_wdt_ping(); 189 + orion_wdt_ping(); 190 190 /* Fall through */ 191 191 192 192 case WDIOC_GETTIMEOUT: ··· 194 194 break; 195 195 196 196 case WDIOC_GETTIMELEFT: 197 - if (orion5x_wdt_get_timeleft(&time)) { 197 + if (orion_wdt_get_timeleft(&time)) { 198 198 ret = -EINVAL; 199 199 break; 200 200 } ··· 204 204 return ret; 205 205 } 206 206 207 - static int orion5x_wdt_release(struct inode *inode, struct file *file) 207 + static int orion_wdt_release(struct inode *inode, struct file *file) 208 208 { 209 209 if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) 210 - orion5x_wdt_disable(); 210 + orion_wdt_disable(); 211 211 else 212 212 printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - " 213 213 "timer will not stop\n"); ··· 218 218 } 219 219 220 220 221 - static const struct file_operations orion5x_wdt_fops = { 221 + static const struct file_operations orion_wdt_fops = { 222 222 .owner = THIS_MODULE, 223 223 .llseek = no_llseek, 224 - .write = orion5x_wdt_write, 225 - .unlocked_ioctl = orion5x_wdt_ioctl, 226 - .open = orion5x_wdt_open, 227 - .release = orion5x_wdt_release, 224 + .write = orion_wdt_write, 225 + .unlocked_ioctl = orion_wdt_ioctl, 226 + .open = orion_wdt_open, 227 + .release = orion_wdt_release, 228 228 }; 229 229 230 - static struct miscdevice orion5x_wdt_miscdev = { 230 + static struct miscdevice orion_wdt_miscdev = { 231 231 .minor = WATCHDOG_MINOR, 232 232 .name = "watchdog", 233 - .fops = &orion5x_wdt_fops, 233 + .fops = &orion_wdt_fops, 234 234 }; 235 235 236 - static int __devinit orion5x_wdt_probe(struct platform_device *pdev) 236 + static int __devinit orion_wdt_probe(struct platform_device *pdev) 237 237 { 238 - struct orion5x_wdt_platform_data *pdata = pdev->dev.platform_data; 238 + struct orion_wdt_platform_data *pdata = pdev->dev.platform_data; 239 239 int ret; 240 240 241 241 if (pdata) { 242 242 wdt_tclk = pdata->tclk; 243 243 } else { 244 - printk(KERN_ERR "Orion5x Watchdog misses platform data\n"); 244 + printk(KERN_ERR "Orion Watchdog misses platform data\n"); 245 245 return -ENODEV; 246 246 } 247 247 248 - if (orion5x_wdt_miscdev.parent) 248 + if (orion_wdt_miscdev.parent) 249 249 return -EBUSY; 250 - orion5x_wdt_miscdev.parent = &pdev->dev; 250 + orion_wdt_miscdev.parent = &pdev->dev; 251 251 252 252 wdt_max_duration = WDT_MAX_CYCLE_COUNT / wdt_tclk; 253 - if (orion5x_wdt_settimeout(heartbeat)) 253 + if (orion_wdt_settimeout(heartbeat)) 254 254 heartbeat = wdt_max_duration; 255 255 256 - ret = misc_register(&orion5x_wdt_miscdev); 256 + ret = misc_register(&orion_wdt_miscdev); 257 257 if (ret) 258 258 return ret; 259 259 260 - printk(KERN_INFO "Orion5x Watchdog Timer: Initial timeout %d sec%s\n", 260 + printk(KERN_INFO "Orion Watchdog Timer: Initial timeout %d sec%s\n", 261 261 heartbeat, nowayout ? ", nowayout" : ""); 262 262 return 0; 263 263 } 264 264 265 - static int __devexit orion5x_wdt_remove(struct platform_device *pdev) 265 + static int __devexit orion_wdt_remove(struct platform_device *pdev) 266 266 { 267 267 int ret; 268 268 269 269 if (test_bit(WDT_IN_USE, &wdt_status)) { 270 - orion5x_wdt_disable(); 270 + orion_wdt_disable(); 271 271 clear_bit(WDT_IN_USE, &wdt_status); 272 272 } 273 273 274 - ret = misc_deregister(&orion5x_wdt_miscdev); 274 + ret = misc_deregister(&orion_wdt_miscdev); 275 275 if (!ret) 276 - orion5x_wdt_miscdev.parent = NULL; 276 + orion_wdt_miscdev.parent = NULL; 277 277 278 278 return ret; 279 279 } 280 280 281 - static void orion5x_wdt_shutdown(struct platform_device *pdev) 281 + static void orion_wdt_shutdown(struct platform_device *pdev) 282 282 { 283 283 if (test_bit(WDT_IN_USE, &wdt_status)) 284 - orion5x_wdt_disable(); 284 + orion_wdt_disable(); 285 285 } 286 286 287 - static struct platform_driver orion5x_wdt_driver = { 288 - .probe = orion5x_wdt_probe, 289 - .remove = __devexit_p(orion5x_wdt_remove), 290 - .shutdown = orion5x_wdt_shutdown, 287 + static struct platform_driver orion_wdt_driver = { 288 + .probe = orion_wdt_probe, 289 + .remove = __devexit_p(orion_wdt_remove), 290 + .shutdown = orion_wdt_shutdown, 291 291 .driver = { 292 292 .owner = THIS_MODULE, 293 - .name = "orion5x_wdt", 293 + .name = "orion_wdt", 294 294 }, 295 295 }; 296 296 297 - static int __init orion5x_wdt_init(void) 297 + static int __init orion_wdt_init(void) 298 298 { 299 299 spin_lock_init(&wdt_lock); 300 - return platform_driver_register(&orion5x_wdt_driver); 300 + return platform_driver_register(&orion_wdt_driver); 301 301 } 302 302 303 - static void __exit orion5x_wdt_exit(void) 303 + static void __exit orion_wdt_exit(void) 304 304 { 305 - platform_driver_unregister(&orion5x_wdt_driver); 305 + platform_driver_unregister(&orion_wdt_driver); 306 306 } 307 307 308 - module_init(orion5x_wdt_init); 309 - module_exit(orion5x_wdt_exit); 308 + module_init(orion_wdt_init); 309 + module_exit(orion_wdt_exit); 310 310 311 311 MODULE_AUTHOR("Sylver Bruneau <sylver.bruneau@googlemail.com>"); 312 - MODULE_DESCRIPTION("Orion5x Processor Watchdog"); 312 + MODULE_DESCRIPTION("Orion Processor Watchdog"); 313 313 314 314 module_param(heartbeat, int, 0); 315 315 MODULE_PARM_DESC(heartbeat, "Initial watchdog heartbeat in seconds");