aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-01-08 21:12:55 -0500
committerPaul Mundt <lethal@linux-sh.org>2012-01-08 21:12:55 -0500
commitca371d2854d48c0c22e7aa031df182f96dc85820 (patch)
tree1c62be8b4da0bfc82fa7ffa1ad5b0e958266cbd1 /drivers/sh
parent0d376945d0bc0a8f8e00861d506b10e42e8af372 (diff)
parenta0e86bd4252519321b0d102dc4ed90557aa7bee9 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into sh-latest
Conflicts: arch/arm/mach-shmobile/clock-sh73a0.c Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/sh')
-rw-r--r--drivers/sh/intc/core.c37
-rw-r--r--drivers/sh/intc/internals.h7
-rw-r--r--drivers/sh/intc/userimask.c16
3 files changed, 35 insertions, 25 deletions
diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c
index 8b7a141ff35e..e53e449b4eca 100644
--- a/drivers/sh/intc/core.c
+++ b/drivers/sh/intc/core.c
@@ -25,7 +25,7 @@
25#include <linux/stat.h> 25#include <linux/stat.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/sh_intc.h> 27#include <linux/sh_intc.h>
28#include <linux/sysdev.h> 28#include <linux/device.h>
29#include <linux/syscore_ops.h> 29#include <linux/syscore_ops.h>
30#include <linux/list.h> 30#include <linux/list.h>
31#include <linux/spinlock.h> 31#include <linux/spinlock.h>
@@ -354,6 +354,8 @@ int __init register_intc_controller(struct intc_desc *desc)
354 if (desc->force_enable) 354 if (desc->force_enable)
355 intc_enable_disable_enum(desc, d, desc->force_enable, 1); 355 intc_enable_disable_enum(desc, d, desc->force_enable, 1);
356 356
357 d->skip_suspend = desc->skip_syscore_suspend;
358
357 nr_intc_controllers++; 359 nr_intc_controllers++;
358 360
359 return 0; 361 return 0;
@@ -386,6 +388,9 @@ static int intc_suspend(void)
386 list_for_each_entry(d, &intc_list, list) { 388 list_for_each_entry(d, &intc_list, list) {
387 int irq; 389 int irq;
388 390
391 if (d->skip_suspend)
392 continue;
393
389 /* enable wakeup irqs belonging to this intc controller */ 394 /* enable wakeup irqs belonging to this intc controller */
390 for_each_active_irq(irq) { 395 for_each_active_irq(irq) {
391 struct irq_data *data; 396 struct irq_data *data;
@@ -409,6 +414,9 @@ static void intc_resume(void)
409 list_for_each_entry(d, &intc_list, list) { 414 list_for_each_entry(d, &intc_list, list) {
410 int irq; 415 int irq;
411 416
417 if (d->skip_suspend)
418 continue;
419
412 for_each_active_irq(irq) { 420 for_each_active_irq(irq) {
413 struct irq_data *data; 421 struct irq_data *data;
414 struct irq_chip *chip; 422 struct irq_chip *chip;
@@ -434,46 +442,47 @@ struct syscore_ops intc_syscore_ops = {
434 .resume = intc_resume, 442 .resume = intc_resume,
435}; 443};
436 444
437struct sysdev_class intc_sysdev_class = { 445struct bus_type intc_subsys = {
438 .name = "intc", 446 .name = "intc",
447 .dev_name = "intc",
439}; 448};
440 449
441static ssize_t 450static ssize_t
442show_intc_name(struct sys_device *dev, struct sysdev_attribute *attr, char *buf) 451show_intc_name(struct device *dev, struct device_attribute *attr, char *buf)
443{ 452{
444 struct intc_desc_int *d; 453 struct intc_desc_int *d;
445 454
446 d = container_of(dev, struct intc_desc_int, sysdev); 455 d = container_of(dev, struct intc_desc_int, dev);
447 456
448 return sprintf(buf, "%s\n", d->chip.name); 457 return sprintf(buf, "%s\n", d->chip.name);
449} 458}
450 459
451static SYSDEV_ATTR(name, S_IRUGO, show_intc_name, NULL); 460static DEVICE_ATTR(name, S_IRUGO, show_intc_name, NULL);
452 461
453static int __init register_intc_sysdevs(void) 462static int __init register_intc_devs(void)
454{ 463{
455 struct intc_desc_int *d; 464 struct intc_desc_int *d;
456 int error; 465 int error;
457 466
458 register_syscore_ops(&intc_syscore_ops); 467 register_syscore_ops(&intc_syscore_ops);
459 468
460 error = sysdev_class_register(&intc_sysdev_class); 469 error = subsys_system_register(&intc_subsys, NULL);
461 if (!error) { 470 if (!error) {
462 list_for_each_entry(d, &intc_list, list) { 471 list_for_each_entry(d, &intc_list, list) {
463 d->sysdev.id = d->index; 472 d->dev.id = d->index;
464 d->sysdev.cls = &intc_sysdev_class; 473 d->dev.bus = &intc_subsys;
465 error = sysdev_register(&d->sysdev); 474 error = device_register(&d->dev);
466 if (error == 0) 475 if (error == 0)
467 error = sysdev_create_file(&d->sysdev, 476 error = device_create_file(&d->dev,
468 &attr_name); 477 &dev_attr_name);
469 if (error) 478 if (error)
470 break; 479 break;
471 } 480 }
472 } 481 }
473 482
474 if (error) 483 if (error)
475 pr_err("sysdev registration error\n"); 484 pr_err("device registration error\n");
476 485
477 return error; 486 return error;
478} 487}
479device_initcall(register_intc_sysdevs); 488device_initcall(register_intc_devs);
diff --git a/drivers/sh/intc/internals.h b/drivers/sh/intc/internals.h
index 5b934851efa8..b0e9155ff739 100644
--- a/drivers/sh/intc/internals.h
+++ b/drivers/sh/intc/internals.h
@@ -4,7 +4,7 @@
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/radix-tree.h> 6#include <linux/radix-tree.h>
7#include <linux/sysdev.h> 7#include <linux/device.h>
8 8
9#define _INTC_MK(fn, mode, addr_e, addr_d, width, shift) \ 9#define _INTC_MK(fn, mode, addr_e, addr_d, width, shift) \
10 ((shift) | ((width) << 5) | ((fn) << 9) | ((mode) << 13) | \ 10 ((shift) | ((width) << 5) | ((fn) << 9) | ((mode) << 13) | \
@@ -51,7 +51,7 @@ struct intc_subgroup_entry {
51 51
52struct intc_desc_int { 52struct intc_desc_int {
53 struct list_head list; 53 struct list_head list;
54 struct sys_device sysdev; 54 struct device dev;
55 struct radix_tree_root tree; 55 struct radix_tree_root tree;
56 raw_spinlock_t lock; 56 raw_spinlock_t lock;
57 unsigned int index; 57 unsigned int index;
@@ -67,6 +67,7 @@ struct intc_desc_int {
67 struct intc_window *window; 67 struct intc_window *window;
68 unsigned int nr_windows; 68 unsigned int nr_windows;
69 struct irq_chip chip; 69 struct irq_chip chip;
70 bool skip_suspend;
70}; 71};
71 72
72 73
@@ -157,7 +158,7 @@ void _intc_enable(struct irq_data *data, unsigned long handle);
157extern struct list_head intc_list; 158extern struct list_head intc_list;
158extern raw_spinlock_t intc_big_lock; 159extern raw_spinlock_t intc_big_lock;
159extern unsigned int nr_intc_controllers; 160extern unsigned int nr_intc_controllers;
160extern struct sysdev_class intc_sysdev_class; 161extern struct bus_type intc_subsys;
161 162
162unsigned int intc_get_dfl_prio_level(void); 163unsigned int intc_get_dfl_prio_level(void);
163unsigned int intc_get_prio_level(unsigned int irq); 164unsigned int intc_get_prio_level(unsigned int irq);
diff --git a/drivers/sh/intc/userimask.c b/drivers/sh/intc/userimask.c
index 56bf9336b92b..e649ceaaa410 100644
--- a/drivers/sh/intc/userimask.c
+++ b/drivers/sh/intc/userimask.c
@@ -10,7 +10,7 @@
10#define pr_fmt(fmt) "intc: " fmt 10#define pr_fmt(fmt) "intc: " fmt
11 11
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/sysdev.h> 13#include <linux/device.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/stat.h> 16#include <linux/stat.h>
@@ -20,15 +20,15 @@
20static void __iomem *uimask; 20static void __iomem *uimask;
21 21
22static ssize_t 22static ssize_t
23show_intc_userimask(struct sysdev_class *cls, 23show_intc_userimask(struct device *dev,
24 struct sysdev_class_attribute *attr, char *buf) 24 struct device_attribute *attr, char *buf)
25{ 25{
26 return sprintf(buf, "%d\n", (__raw_readl(uimask) >> 4) & 0xf); 26 return sprintf(buf, "%d\n", (__raw_readl(uimask) >> 4) & 0xf);
27} 27}
28 28
29static ssize_t 29static ssize_t
30store_intc_userimask(struct sysdev_class *cls, 30store_intc_userimask(struct device *dev,
31 struct sysdev_class_attribute *attr, 31 struct device_attribute *attr,
32 const char *buf, size_t count) 32 const char *buf, size_t count)
33{ 33{
34 unsigned long level; 34 unsigned long level;
@@ -55,8 +55,8 @@ store_intc_userimask(struct sysdev_class *cls,
55 return count; 55 return count;
56} 56}
57 57
58static SYSDEV_CLASS_ATTR(userimask, S_IRUSR | S_IWUSR, 58static DEVICE_ATTR(userimask, S_IRUSR | S_IWUSR,
59 show_intc_userimask, store_intc_userimask); 59 show_intc_userimask, store_intc_userimask);
60 60
61 61
62static int __init userimask_sysdev_init(void) 62static int __init userimask_sysdev_init(void)
@@ -64,7 +64,7 @@ static int __init userimask_sysdev_init(void)
64 if (unlikely(!uimask)) 64 if (unlikely(!uimask))
65 return -ENXIO; 65 return -ENXIO;
66 66
67 return sysdev_class_create_file(&intc_sysdev_class, &attr_userimask); 67 return device_create_file(intc_subsys.dev_root, &dev_attr_userimask);
68} 68}
69late_initcall(userimask_sysdev_init); 69late_initcall(userimask_sysdev_init);
70 70