diff options
123 files changed, 1157 insertions, 721 deletions
diff --git a/Documentation/Changes b/Documentation/Changes index 5f4828a034e3..b17580885273 100644 --- a/Documentation/Changes +++ b/Documentation/Changes | |||
@@ -2,13 +2,7 @@ Intro | |||
2 | ===== | 2 | ===== |
3 | 3 | ||
4 | This document is designed to provide a list of the minimum levels of | 4 | This document is designed to provide a list of the minimum levels of |
5 | software necessary to run the 2.6 kernels, as well as provide brief | 5 | software necessary to run the 3.0 kernels. |
6 | instructions regarding any other "Gotchas" users may encounter when | ||
7 | trying life on the Bleeding Edge. If upgrading from a pre-2.4.x | ||
8 | kernel, please consult the Changes file included with 2.4.x kernels for | ||
9 | additional information; most of that information will not be repeated | ||
10 | here. Basically, this document assumes that your system is already | ||
11 | functional and running at least 2.4.x kernels. | ||
12 | 6 | ||
13 | This document is originally based on my "Changes" file for 2.0.x kernels | 7 | This document is originally based on my "Changes" file for 2.0.x kernels |
14 | and therefore owes credit to the same people as that file (Jared Mauch, | 8 | and therefore owes credit to the same people as that file (Jared Mauch, |
@@ -22,11 +16,10 @@ Upgrade to at *least* these software revisions before thinking you've | |||
22 | encountered a bug! If you're unsure what version you're currently | 16 | encountered a bug! If you're unsure what version you're currently |
23 | running, the suggested command should tell you. | 17 | running, the suggested command should tell you. |
24 | 18 | ||
25 | Again, keep in mind that this list assumes you are already | 19 | Again, keep in mind that this list assumes you are already functionally |
26 | functionally running a Linux 2.4 kernel. Also, not all tools are | 20 | running a Linux kernel. Also, not all tools are necessary on all |
27 | necessary on all systems; obviously, if you don't have any ISDN | 21 | systems; obviously, if you don't have any ISDN hardware, for example, |
28 | hardware, for example, you probably needn't concern yourself with | 22 | you probably needn't concern yourself with isdn4k-utils. |
29 | isdn4k-utils. | ||
30 | 23 | ||
31 | o Gnu C 3.2 # gcc --version | 24 | o Gnu C 3.2 # gcc --version |
32 | o Gnu make 3.80 # make --version | 25 | o Gnu make 3.80 # make --version |
@@ -114,12 +107,12 @@ Ksymoops | |||
114 | 107 | ||
115 | If the unthinkable happens and your kernel oopses, you may need the | 108 | If the unthinkable happens and your kernel oopses, you may need the |
116 | ksymoops tool to decode it, but in most cases you don't. | 109 | ksymoops tool to decode it, but in most cases you don't. |
117 | In the 2.6 kernel it is generally preferred to build the kernel with | 110 | It is generally preferred to build the kernel with CONFIG_KALLSYMS so |
118 | CONFIG_KALLSYMS so that it produces readable dumps that can be used as-is | 111 | that it produces readable dumps that can be used as-is (this also |
119 | (this also produces better output than ksymoops). | 112 | produces better output than ksymoops). If for some reason your kernel |
120 | If for some reason your kernel is not build with CONFIG_KALLSYMS and | 113 | is not build with CONFIG_KALLSYMS and you have no way to rebuild and |
121 | you have no way to rebuild and reproduce the Oops with that option, then | 114 | reproduce the Oops with that option, then you can still decode that Oops |
122 | you can still decode that Oops with ksymoops. | 115 | with ksymoops. |
123 | 116 | ||
124 | Module-Init-Tools | 117 | Module-Init-Tools |
125 | ----------------- | 118 | ----------------- |
@@ -261,8 +254,8 @@ needs to be recompiled or (preferably) upgraded. | |||
261 | NFS-utils | 254 | NFS-utils |
262 | --------- | 255 | --------- |
263 | 256 | ||
264 | In 2.4 and earlier kernels, the nfs server needed to know about any | 257 | In ancient (2.4 and earlier) kernels, the nfs server needed to know |
265 | client that expected to be able to access files via NFS. This | 258 | about any client that expected to be able to access files via NFS. This |
266 | information would be given to the kernel by "mountd" when the client | 259 | information would be given to the kernel by "mountd" when the client |
267 | mounted the filesystem, or by "exportfs" at system startup. exportfs | 260 | mounted the filesystem, or by "exportfs" at system startup. exportfs |
268 | would take information about active clients from /var/lib/nfs/rmtab. | 261 | would take information about active clients from /var/lib/nfs/rmtab. |
@@ -272,11 +265,11 @@ which is not always easy, particularly when trying to implement | |||
272 | fail-over. Even when the system is working well, rmtab suffers from | 265 | fail-over. Even when the system is working well, rmtab suffers from |
273 | getting lots of old entries that never get removed. | 266 | getting lots of old entries that never get removed. |
274 | 267 | ||
275 | With 2.6 we have the option of having the kernel tell mountd when it | 268 | With modern kernels we have the option of having the kernel tell mountd |
276 | gets a request from an unknown host, and mountd can give appropriate | 269 | when it gets a request from an unknown host, and mountd can give |
277 | export information to the kernel. This removes the dependency on | 270 | appropriate export information to the kernel. This removes the |
278 | rmtab and means that the kernel only needs to know about currently | 271 | dependency on rmtab and means that the kernel only needs to know about |
279 | active clients. | 272 | currently active clients. |
280 | 273 | ||
281 | To enable this new functionality, you need to: | 274 | To enable this new functionality, you need to: |
282 | 275 | ||
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 72e238465b0b..b1c921c27519 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -583,3 +583,25 @@ Why: Superseded by the UVCIOC_CTRL_QUERY ioctl. | |||
583 | Who: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 583 | Who: Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
584 | 584 | ||
585 | ---------------------------- | 585 | ---------------------------- |
586 | |||
587 | What: For VIDIOC_S_FREQUENCY the type field must match the device node's type. | ||
588 | If not, return -EINVAL. | ||
589 | When: 3.2 | ||
590 | Why: It makes no sense to switch the tuner to radio mode by calling | ||
591 | VIDIOC_S_FREQUENCY on a video node, or to switch the tuner to tv mode by | ||
592 | calling VIDIOC_S_FREQUENCY on a radio node. This is the first step of a | ||
593 | move to more consistent handling of tv and radio tuners. | ||
594 | Who: Hans Verkuil <hans.verkuil@cisco.com> | ||
595 | |||
596 | ---------------------------- | ||
597 | |||
598 | What: Opening a radio device node will no longer automatically switch the | ||
599 | tuner mode from tv to radio. | ||
600 | When: 3.3 | ||
601 | Why: Just opening a V4L device should not change the state of the hardware | ||
602 | like that. It's very unexpected and against the V4L spec. Instead, you | ||
603 | switch to radio mode by calling VIDIOC_S_FREQUENCY. This is the second | ||
604 | and last step of the move to consistent handling of tv and radio tuners. | ||
605 | Who: Hans Verkuil <hans.verkuil@cisco.com> | ||
606 | |||
607 | ---------------------------- | ||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index fd248a318211..aa47be71df4c 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -2015,6 +2015,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
2015 | the default. | 2015 | the default. |
2016 | off: Turn ECRC off | 2016 | off: Turn ECRC off |
2017 | on: Turn ECRC on. | 2017 | on: Turn ECRC on. |
2018 | realloc reallocate PCI resources if allocations done by BIOS | ||
2019 | are erroneous. | ||
2018 | 2020 | ||
2019 | pcie_aspm= [PCIE] Forcibly enable or disable PCIe Active State Power | 2021 | pcie_aspm= [PCIE] Forcibly enable or disable PCIe Active State Power |
2020 | Management. | 2022 | Management. |
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt index 1565eefd6fd5..61815483efa3 100644 --- a/Documentation/laptops/thinkpad-acpi.txt +++ b/Documentation/laptops/thinkpad-acpi.txt | |||
@@ -534,6 +534,8 @@ Events that are never propagated by the driver: | |||
534 | 0x2404 System is waking up from hibernation to undock | 534 | 0x2404 System is waking up from hibernation to undock |
535 | 0x2405 System is waking up from hibernation to eject bay | 535 | 0x2405 System is waking up from hibernation to eject bay |
536 | 0x5010 Brightness level changed/control event | 536 | 0x5010 Brightness level changed/control event |
537 | 0x6000 KEYBOARD: Numlock key pressed | ||
538 | 0x6005 KEYBOARD: Fn key pressed (TO BE VERIFIED) | ||
537 | 539 | ||
538 | Events that are propagated by the driver to userspace: | 540 | Events that are propagated by the driver to userspace: |
539 | 541 | ||
@@ -545,6 +547,8 @@ Events that are propagated by the driver to userspace: | |||
545 | 0x3006 Bay hotplug request (hint to power up SATA link when | 547 | 0x3006 Bay hotplug request (hint to power up SATA link when |
546 | the optical drive tray is ejected) | 548 | the optical drive tray is ejected) |
547 | 0x4003 Undocked (see 0x2x04), can sleep again | 549 | 0x4003 Undocked (see 0x2x04), can sleep again |
550 | 0x4010 Docked into hotplug port replicator (non-ACPI dock) | ||
551 | 0x4011 Undocked from hotplug port replicator (non-ACPI dock) | ||
548 | 0x500B Tablet pen inserted into its storage bay | 552 | 0x500B Tablet pen inserted into its storage bay |
549 | 0x500C Tablet pen removed from its storage bay | 553 | 0x500C Tablet pen removed from its storage bay |
550 | 0x6011 ALARM: battery is too hot | 554 | 0x6011 ALARM: battery is too hot |
@@ -552,6 +556,7 @@ Events that are propagated by the driver to userspace: | |||
552 | 0x6021 ALARM: a sensor is too hot | 556 | 0x6021 ALARM: a sensor is too hot |
553 | 0x6022 ALARM: a sensor is extremely hot | 557 | 0x6022 ALARM: a sensor is extremely hot |
554 | 0x6030 System thermal table changed | 558 | 0x6030 System thermal table changed |
559 | 0x6040 Nvidia Optimus/AC adapter related (TO BE VERIFIED) | ||
555 | 560 | ||
556 | Battery nearly empty alarms are a last resort attempt to get the | 561 | Battery nearly empty alarms are a last resort attempt to get the |
557 | operating system to hibernate or shutdown cleanly (0x2313), or shutdown | 562 | operating system to hibernate or shutdown cleanly (0x2313), or shutdown |
diff --git a/Documentation/spinlocks.txt b/Documentation/spinlocks.txt index 2e3c64b1a6a5..9dbe885ecd8d 100644 --- a/Documentation/spinlocks.txt +++ b/Documentation/spinlocks.txt | |||
@@ -13,18 +13,8 @@ static DEFINE_SPINLOCK(xxx_lock); | |||
13 | The above is always safe. It will disable interrupts _locally_, but the | 13 | The above is always safe. It will disable interrupts _locally_, but the |
14 | spinlock itself will guarantee the global lock, so it will guarantee that | 14 | spinlock itself will guarantee the global lock, so it will guarantee that |
15 | there is only one thread-of-control within the region(s) protected by that | 15 | there is only one thread-of-control within the region(s) protected by that |
16 | lock. This works well even under UP. The above sequence under UP | 16 | lock. This works well even under UP also, so the code does _not_ need to |
17 | essentially is just the same as doing | 17 | worry about UP vs SMP issues: the spinlocks work correctly under both. |
18 | |||
19 | unsigned long flags; | ||
20 | |||
21 | save_flags(flags); cli(); | ||
22 | ... critical section ... | ||
23 | restore_flags(flags); | ||
24 | |||
25 | so the code does _not_ need to worry about UP vs SMP issues: the spinlocks | ||
26 | work correctly under both (and spinlocks are actually more efficient on | ||
27 | architectures that allow doing the "save_flags + cli" in one operation). | ||
28 | 18 | ||
29 | NOTE! Implications of spin_locks for memory are further described in: | 19 | NOTE! Implications of spin_locks for memory are further described in: |
30 | 20 | ||
@@ -36,27 +26,7 @@ The above is usually pretty simple (you usually need and want only one | |||
36 | spinlock for most things - using more than one spinlock can make things a | 26 | spinlock for most things - using more than one spinlock can make things a |
37 | lot more complex and even slower and is usually worth it only for | 27 | lot more complex and even slower and is usually worth it only for |
38 | sequences that you _know_ need to be split up: avoid it at all cost if you | 28 | sequences that you _know_ need to be split up: avoid it at all cost if you |
39 | aren't sure). HOWEVER, it _does_ mean that if you have some code that does | 29 | aren't sure). |
40 | |||
41 | cli(); | ||
42 | .. critical section .. | ||
43 | sti(); | ||
44 | |||
45 | and another sequence that does | ||
46 | |||
47 | spin_lock_irqsave(flags); | ||
48 | .. critical section .. | ||
49 | spin_unlock_irqrestore(flags); | ||
50 | |||
51 | then they are NOT mutually exclusive, and the critical regions can happen | ||
52 | at the same time on two different CPU's. That's fine per se, but the | ||
53 | critical regions had better be critical for different things (ie they | ||
54 | can't stomp on each other). | ||
55 | |||
56 | The above is a problem mainly if you end up mixing code - for example the | ||
57 | routines in ll_rw_block() tend to use cli/sti to protect the atomicity of | ||
58 | their actions, and if a driver uses spinlocks instead then you should | ||
59 | think about issues like the above. | ||
60 | 30 | ||
61 | This is really the only really hard part about spinlocks: once you start | 31 | This is really the only really hard part about spinlocks: once you start |
62 | using spinlocks they tend to expand to areas you might not have noticed | 32 | using spinlocks they tend to expand to areas you might not have noticed |
@@ -120,11 +90,10 @@ Lesson 3: spinlocks revisited. | |||
120 | 90 | ||
121 | The single spin-lock primitives above are by no means the only ones. They | 91 | The single spin-lock primitives above are by no means the only ones. They |
122 | are the most safe ones, and the ones that work under all circumstances, | 92 | are the most safe ones, and the ones that work under all circumstances, |
123 | but partly _because_ they are safe they are also fairly slow. They are | 93 | but partly _because_ they are safe they are also fairly slow. They are slower |
124 | much faster than a generic global cli/sti pair, but slower than they'd | 94 | than they'd need to be, because they do have to disable interrupts |
125 | need to be, because they do have to disable interrupts (which is just a | 95 | (which is just a single instruction on a x86, but it's an expensive one - |
126 | single instruction on a x86, but it's an expensive one - and on other | 96 | and on other architectures it can be worse). |
127 | architectures it can be worse). | ||
128 | 97 | ||
129 | If you have a case where you have to protect a data structure across | 98 | If you have a case where you have to protect a data structure across |
130 | several CPU's and you want to use spinlocks you can potentially use | 99 | several CPU's and you want to use spinlocks you can potentially use |
diff --git a/MAINTAINERS b/MAINTAINERS index 9820e89c827c..187282da9213 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -594,6 +594,16 @@ S: Maintained | |||
594 | F: arch/arm/lib/floppydma.S | 594 | F: arch/arm/lib/floppydma.S |
595 | F: arch/arm/include/asm/floppy.h | 595 | F: arch/arm/include/asm/floppy.h |
596 | 596 | ||
597 | ARM PMU PROFILING AND DEBUGGING | ||
598 | M: Will Deacon <will.deacon@arm.com> | ||
599 | S: Maintained | ||
600 | F: arch/arm/kernel/perf_event* | ||
601 | F: arch/arm/oprofile/common.c | ||
602 | F: arch/arm/kernel/pmu.c | ||
603 | F: arch/arm/include/asm/pmu.h | ||
604 | F: arch/arm/kernel/hw_breakpoint.c | ||
605 | F: arch/arm/include/asm/hw_breakpoint.h | ||
606 | |||
597 | ARM PORT | 607 | ARM PORT |
598 | M: Russell King <linux@arm.linux.org.uk> | 608 | M: Russell King <linux@arm.linux.org.uk> |
599 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 609 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
@@ -4982,7 +4992,7 @@ F: drivers/power/power_supply* | |||
4982 | 4992 | ||
4983 | PNP SUPPORT | 4993 | PNP SUPPORT |
4984 | M: Adam Belay <abelay@mit.edu> | 4994 | M: Adam Belay <abelay@mit.edu> |
4985 | M: Bjorn Helgaas <bjorn.helgaas@hp.com> | 4995 | M: Bjorn Helgaas <bhelgaas@google.com> |
4986 | S: Maintained | 4996 | S: Maintained |
4987 | F: drivers/pnp/ | 4997 | F: drivers/pnp/ |
4988 | 4998 | ||
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 3 | 1 | VERSION = 3 |
2 | PATCHLEVEL = 0 | 2 | PATCHLEVEL = 0 |
3 | SUBLEVEL = 0 | 3 | SUBLEVEL = 0 |
4 | EXTRAVERSION = -rc6 | 4 | EXTRAVERSION = -rc7 |
5 | NAME = Sneaky Weasel | 5 | NAME = Sneaky Weasel |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c index e5681636626f..841df7d21c2f 100644 --- a/arch/arm/common/dmabounce.c +++ b/arch/arm/common/dmabounce.c | |||
@@ -255,7 +255,7 @@ static inline dma_addr_t map_single(struct device *dev, void *ptr, size_t size, | |||
255 | if (buf == 0) { | 255 | if (buf == 0) { |
256 | dev_err(dev, "%s: unable to map unsafe buffer %p!\n", | 256 | dev_err(dev, "%s: unable to map unsafe buffer %p!\n", |
257 | __func__, ptr); | 257 | __func__, ptr); |
258 | return 0; | 258 | return ~0; |
259 | } | 259 | } |
260 | 260 | ||
261 | dev_dbg(dev, | 261 | dev_dbg(dev, |
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index d53c0abc4dd3..2b5b1421596c 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c | |||
@@ -583,7 +583,7 @@ static int armpmu_event_init(struct perf_event *event) | |||
583 | static void armpmu_enable(struct pmu *pmu) | 583 | static void armpmu_enable(struct pmu *pmu) |
584 | { | 584 | { |
585 | /* Enable all of the perf events on hardware. */ | 585 | /* Enable all of the perf events on hardware. */ |
586 | int idx; | 586 | int idx, enabled = 0; |
587 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | 587 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); |
588 | 588 | ||
589 | if (!armpmu) | 589 | if (!armpmu) |
@@ -596,9 +596,11 @@ static void armpmu_enable(struct pmu *pmu) | |||
596 | continue; | 596 | continue; |
597 | 597 | ||
598 | armpmu->enable(&event->hw, idx); | 598 | armpmu->enable(&event->hw, idx); |
599 | enabled = 1; | ||
599 | } | 600 | } |
600 | 601 | ||
601 | armpmu->start(); | 602 | if (enabled) |
603 | armpmu->start(); | ||
602 | } | 604 | } |
603 | 605 | ||
604 | static void armpmu_disable(struct pmu *pmu) | 606 | static void armpmu_disable(struct pmu *pmu) |
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index ed11fb08b05a..acbb447ac6b5 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -73,6 +73,7 @@ __setup("fpe=", fpe_setup); | |||
73 | #endif | 73 | #endif |
74 | 74 | ||
75 | extern void paging_init(struct machine_desc *desc); | 75 | extern void paging_init(struct machine_desc *desc); |
76 | extern void sanity_check_meminfo(void); | ||
76 | extern void reboot_setup(char *str); | 77 | extern void reboot_setup(char *str); |
77 | 78 | ||
78 | unsigned int processor_id; | 79 | unsigned int processor_id; |
@@ -900,6 +901,7 @@ void __init setup_arch(char **cmdline_p) | |||
900 | 901 | ||
901 | parse_early_param(); | 902 | parse_early_param(); |
902 | 903 | ||
904 | sanity_check_meminfo(); | ||
903 | arm_memblock_init(&meminfo, mdesc); | 905 | arm_memblock_init(&meminfo, mdesc); |
904 | 906 | ||
905 | paging_init(mdesc); | 907 | paging_init(mdesc); |
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index 60636f499cb3..2c277d40cee6 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c | |||
@@ -115,7 +115,7 @@ static void __cpuinit twd_calibrate_rate(void) | |||
115 | twd_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5); | 115 | twd_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5); |
116 | 116 | ||
117 | printk("%lu.%02luMHz.\n", twd_timer_rate / 1000000, | 117 | printk("%lu.%02luMHz.\n", twd_timer_rate / 1000000, |
118 | (twd_timer_rate / 1000000) % 100); | 118 | (twd_timer_rate / 10000) % 100); |
119 | } | 119 | } |
120 | } | 120 | } |
121 | 121 | ||
diff --git a/arch/arm/mach-davinci/irq.c b/arch/arm/mach-davinci/irq.c index bfe68ec4e1a6..d8c1af025931 100644 --- a/arch/arm/mach-davinci/irq.c +++ b/arch/arm/mach-davinci/irq.c | |||
@@ -53,7 +53,7 @@ davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num) | |||
53 | 53 | ||
54 | gc = irq_alloc_generic_chip("AINTC", 1, irq_start, base, handle_edge_irq); | 54 | gc = irq_alloc_generic_chip("AINTC", 1, irq_start, base, handle_edge_irq); |
55 | ct = gc->chip_types; | 55 | ct = gc->chip_types; |
56 | ct->chip.irq_ack = irq_gc_ack; | 56 | ct->chip.irq_ack = irq_gc_ack_set_bit; |
57 | ct->chip.irq_mask = irq_gc_mask_clr_bit; | 57 | ct->chip.irq_mask = irq_gc_mask_clr_bit; |
58 | ct->chip.irq_unmask = irq_gc_mask_set_bit; | 58 | ct->chip.irq_unmask = irq_gc_mask_set_bit; |
59 | 59 | ||
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 1d4b65fd673e..6659a0d137a3 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c | |||
@@ -251,9 +251,9 @@ static void ep93xx_uart_set_mctrl(struct amba_device *dev, | |||
251 | unsigned int mcr; | 251 | unsigned int mcr; |
252 | 252 | ||
253 | mcr = 0; | 253 | mcr = 0; |
254 | if (!(mctrl & TIOCM_RTS)) | 254 | if (mctrl & TIOCM_RTS) |
255 | mcr |= 2; | 255 | mcr |= 2; |
256 | if (!(mctrl & TIOCM_DTR)) | 256 | if (mctrl & TIOCM_DTR) |
257 | mcr |= 1; | 257 | mcr |= 1; |
258 | 258 | ||
259 | __raw_writel(mcr, base + EP93XX_UART_MCR_OFFSET); | 259 | __raw_writel(mcr, base + EP93XX_UART_MCR_OFFSET); |
diff --git a/arch/arm/mach-exynos4/cpu.c b/arch/arm/mach-exynos4/cpu.c index 9babe4473e88..bfd621460abf 100644 --- a/arch/arm/mach-exynos4/cpu.c +++ b/arch/arm/mach-exynos4/cpu.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <plat/sdhci.h> | 23 | #include <plat/sdhci.h> |
24 | #include <plat/devs.h> | 24 | #include <plat/devs.h> |
25 | #include <plat/fimc-core.h> | 25 | #include <plat/fimc-core.h> |
26 | #include <plat/iic-core.h> | ||
26 | 27 | ||
27 | #include <mach/regs-irq.h> | 28 | #include <mach/regs-irq.h> |
28 | 29 | ||
@@ -132,6 +133,11 @@ void __init exynos4_map_io(void) | |||
132 | s3c_fimc_setname(1, "exynos4-fimc"); | 133 | s3c_fimc_setname(1, "exynos4-fimc"); |
133 | s3c_fimc_setname(2, "exynos4-fimc"); | 134 | s3c_fimc_setname(2, "exynos4-fimc"); |
134 | s3c_fimc_setname(3, "exynos4-fimc"); | 135 | s3c_fimc_setname(3, "exynos4-fimc"); |
136 | |||
137 | /* The I2C bus controllers are directly compatible with s3c2440 */ | ||
138 | s3c_i2c0_setname("s3c2440-i2c"); | ||
139 | s3c_i2c1_setname("s3c2440-i2c"); | ||
140 | s3c_i2c2_setname("s3c2440-i2c"); | ||
135 | } | 141 | } |
136 | 142 | ||
137 | void __init exynos4_init_clocks(int xtal) | 143 | void __init exynos4_init_clocks(int xtal) |
diff --git a/arch/arm/mach-exynos4/dev-audio.c b/arch/arm/mach-exynos4/dev-audio.c index 1eed5f9f7bd3..983069a53239 100644 --- a/arch/arm/mach-exynos4/dev-audio.c +++ b/arch/arm/mach-exynos4/dev-audio.c | |||
@@ -330,7 +330,7 @@ struct platform_device exynos4_device_ac97 = { | |||
330 | 330 | ||
331 | static int exynos4_spdif_cfg_gpio(struct platform_device *pdev) | 331 | static int exynos4_spdif_cfg_gpio(struct platform_device *pdev) |
332 | { | 332 | { |
333 | s3c_gpio_cfgpin_range(EXYNOS4_GPC1(0), 2, S3C_GPIO_SFN(3)); | 333 | s3c_gpio_cfgpin_range(EXYNOS4_GPC1(0), 2, S3C_GPIO_SFN(4)); |
334 | 334 | ||
335 | return 0; | 335 | return 0; |
336 | } | 336 | } |
diff --git a/arch/arm/mach-exynos4/headsmp.S b/arch/arm/mach-exynos4/headsmp.S index 6c6cfc50c46b..3cdeb3647542 100644 --- a/arch/arm/mach-exynos4/headsmp.S +++ b/arch/arm/mach-exynos4/headsmp.S | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | 15 | ||
16 | __INIT | 16 | __CPUINIT |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * exynos4 specific entry point for secondary CPUs. This provides | 19 | * exynos4 specific entry point for secondary CPUs. This provides |
diff --git a/arch/arm/mach-exynos4/mach-smdkv310.c b/arch/arm/mach-exynos4/mach-smdkv310.c index 152676471b67..edd814110da8 100644 --- a/arch/arm/mach-exynos4/mach-smdkv310.c +++ b/arch/arm/mach-exynos4/mach-smdkv310.c | |||
@@ -78,9 +78,7 @@ static struct s3c2410_uartcfg smdkv310_uartcfgs[] __initdata = { | |||
78 | }; | 78 | }; |
79 | 79 | ||
80 | static struct s3c_sdhci_platdata smdkv310_hsmmc0_pdata __initdata = { | 80 | static struct s3c_sdhci_platdata smdkv310_hsmmc0_pdata __initdata = { |
81 | .cd_type = S3C_SDHCI_CD_GPIO, | 81 | .cd_type = S3C_SDHCI_CD_INTERNAL, |
82 | .ext_cd_gpio = EXYNOS4_GPK0(2), | ||
83 | .ext_cd_gpio_invert = 1, | ||
84 | .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, | 82 | .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, |
85 | #ifdef CONFIG_EXYNOS4_SDHCI_CH0_8BIT | 83 | #ifdef CONFIG_EXYNOS4_SDHCI_CH0_8BIT |
86 | .max_width = 8, | 84 | .max_width = 8, |
@@ -96,9 +94,7 @@ static struct s3c_sdhci_platdata smdkv310_hsmmc1_pdata __initdata = { | |||
96 | }; | 94 | }; |
97 | 95 | ||
98 | static struct s3c_sdhci_platdata smdkv310_hsmmc2_pdata __initdata = { | 96 | static struct s3c_sdhci_platdata smdkv310_hsmmc2_pdata __initdata = { |
99 | .cd_type = S3C_SDHCI_CD_GPIO, | 97 | .cd_type = S3C_SDHCI_CD_INTERNAL, |
100 | .ext_cd_gpio = EXYNOS4_GPK2(2), | ||
101 | .ext_cd_gpio_invert = 1, | ||
102 | .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, | 98 | .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, |
103 | #ifdef CONFIG_EXYNOS4_SDHCI_CH2_8BIT | 99 | #ifdef CONFIG_EXYNOS4_SDHCI_CH2_8BIT |
104 | .max_width = 8, | 100 | .max_width = 8, |
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c index 72b4e7631583..ab9f999106c7 100644 --- a/arch/arm/mach-mmp/pxa168.c +++ b/arch/arm/mach-mmp/pxa168.c | |||
@@ -79,7 +79,7 @@ static APBC_CLK(ssp4, PXA168_SSP4, 4, 0); | |||
79 | static APBC_CLK(ssp5, PXA168_SSP5, 4, 0); | 79 | static APBC_CLK(ssp5, PXA168_SSP5, 4, 0); |
80 | static APBC_CLK(keypad, PXA168_KPC, 0, 32000); | 80 | static APBC_CLK(keypad, PXA168_KPC, 0, 32000); |
81 | 81 | ||
82 | static APMU_CLK(nand, NAND, 0x01db, 208000000); | 82 | static APMU_CLK(nand, NAND, 0x19b, 156000000); |
83 | static APMU_CLK(lcd, LCD, 0x7f, 312000000); | 83 | static APMU_CLK(lcd, LCD, 0x7f, 312000000); |
84 | 84 | ||
85 | /* device and clock bindings */ | 85 | /* device and clock bindings */ |
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c index 8f92ccd26edf..1464607aa60d 100644 --- a/arch/arm/mach-mmp/pxa910.c +++ b/arch/arm/mach-mmp/pxa910.c | |||
@@ -110,7 +110,7 @@ static APBC_CLK(pwm2, PXA910_PWM2, 1, 13000000); | |||
110 | static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000); | 110 | static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000); |
111 | static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); | 111 | static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); |
112 | 112 | ||
113 | static APMU_CLK(nand, NAND, 0x01db, 208000000); | 113 | static APMU_CLK(nand, NAND, 0x19b, 156000000); |
114 | static APMU_CLK(u2o, USB, 0x1b, 480000000); | 114 | static APMU_CLK(u2o, USB, 0x1b, 480000000); |
115 | 115 | ||
116 | /* device and clock bindings */ | 116 | /* device and clock bindings */ |
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index de88c9297b68..f49ce85d2448 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c | |||
@@ -215,7 +215,7 @@ static struct omap_kp_platform_data ams_delta_kp_data __initdata = { | |||
215 | .delay = 9, | 215 | .delay = 9, |
216 | }; | 216 | }; |
217 | 217 | ||
218 | static struct platform_device ams_delta_kp_device __initdata = { | 218 | static struct platform_device ams_delta_kp_device = { |
219 | .name = "omap-keypad", | 219 | .name = "omap-keypad", |
220 | .id = -1, | 220 | .id = -1, |
221 | .dev = { | 221 | .dev = { |
@@ -225,12 +225,12 @@ static struct platform_device ams_delta_kp_device __initdata = { | |||
225 | .resource = ams_delta_kp_resources, | 225 | .resource = ams_delta_kp_resources, |
226 | }; | 226 | }; |
227 | 227 | ||
228 | static struct platform_device ams_delta_lcd_device __initdata = { | 228 | static struct platform_device ams_delta_lcd_device = { |
229 | .name = "lcd_ams_delta", | 229 | .name = "lcd_ams_delta", |
230 | .id = -1, | 230 | .id = -1, |
231 | }; | 231 | }; |
232 | 232 | ||
233 | static struct platform_device ams_delta_led_device __initdata = { | 233 | static struct platform_device ams_delta_led_device = { |
234 | .name = "ams-delta-led", | 234 | .name = "ams-delta-led", |
235 | .id = -1 | 235 | .id = -1 |
236 | }; | 236 | }; |
@@ -267,7 +267,7 @@ static struct soc_camera_link ams_delta_iclink = { | |||
267 | .power = ams_delta_camera_power, | 267 | .power = ams_delta_camera_power, |
268 | }; | 268 | }; |
269 | 269 | ||
270 | static struct platform_device ams_delta_camera_device __initdata = { | 270 | static struct platform_device ams_delta_camera_device = { |
271 | .name = "soc-camera-pdrv", | 271 | .name = "soc-camera-pdrv", |
272 | .id = 0, | 272 | .id = 0, |
273 | .dev = { | 273 | .dev = { |
diff --git a/arch/arm/mach-omap1/gpio15xx.c b/arch/arm/mach-omap1/gpio15xx.c index 04c4b04cf54e..364137c2042c 100644 --- a/arch/arm/mach-omap1/gpio15xx.c +++ b/arch/arm/mach-omap1/gpio15xx.c | |||
@@ -41,7 +41,7 @@ static struct __initdata omap_gpio_platform_data omap15xx_mpu_gpio_config = { | |||
41 | .bank_stride = 1, | 41 | .bank_stride = 1, |
42 | }; | 42 | }; |
43 | 43 | ||
44 | static struct __initdata platform_device omap15xx_mpu_gpio = { | 44 | static struct platform_device omap15xx_mpu_gpio = { |
45 | .name = "omap_gpio", | 45 | .name = "omap_gpio", |
46 | .id = 0, | 46 | .id = 0, |
47 | .dev = { | 47 | .dev = { |
@@ -70,7 +70,7 @@ static struct __initdata omap_gpio_platform_data omap15xx_gpio_config = { | |||
70 | .bank_width = 16, | 70 | .bank_width = 16, |
71 | }; | 71 | }; |
72 | 72 | ||
73 | static struct __initdata platform_device omap15xx_gpio = { | 73 | static struct platform_device omap15xx_gpio = { |
74 | .name = "omap_gpio", | 74 | .name = "omap_gpio", |
75 | .id = 1, | 75 | .id = 1, |
76 | .dev = { | 76 | .dev = { |
diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c index 5dd0d4c82b24..293a246e2824 100644 --- a/arch/arm/mach-omap1/gpio16xx.c +++ b/arch/arm/mach-omap1/gpio16xx.c | |||
@@ -44,7 +44,7 @@ static struct __initdata omap_gpio_platform_data omap16xx_mpu_gpio_config = { | |||
44 | .bank_stride = 1, | 44 | .bank_stride = 1, |
45 | }; | 45 | }; |
46 | 46 | ||
47 | static struct __initdata platform_device omap16xx_mpu_gpio = { | 47 | static struct platform_device omap16xx_mpu_gpio = { |
48 | .name = "omap_gpio", | 48 | .name = "omap_gpio", |
49 | .id = 0, | 49 | .id = 0, |
50 | .dev = { | 50 | .dev = { |
@@ -73,7 +73,7 @@ static struct __initdata omap_gpio_platform_data omap16xx_gpio1_config = { | |||
73 | .bank_width = 16, | 73 | .bank_width = 16, |
74 | }; | 74 | }; |
75 | 75 | ||
76 | static struct __initdata platform_device omap16xx_gpio1 = { | 76 | static struct platform_device omap16xx_gpio1 = { |
77 | .name = "omap_gpio", | 77 | .name = "omap_gpio", |
78 | .id = 1, | 78 | .id = 1, |
79 | .dev = { | 79 | .dev = { |
@@ -102,7 +102,7 @@ static struct __initdata omap_gpio_platform_data omap16xx_gpio2_config = { | |||
102 | .bank_width = 16, | 102 | .bank_width = 16, |
103 | }; | 103 | }; |
104 | 104 | ||
105 | static struct __initdata platform_device omap16xx_gpio2 = { | 105 | static struct platform_device omap16xx_gpio2 = { |
106 | .name = "omap_gpio", | 106 | .name = "omap_gpio", |
107 | .id = 2, | 107 | .id = 2, |
108 | .dev = { | 108 | .dev = { |
@@ -131,7 +131,7 @@ static struct __initdata omap_gpio_platform_data omap16xx_gpio3_config = { | |||
131 | .bank_width = 16, | 131 | .bank_width = 16, |
132 | }; | 132 | }; |
133 | 133 | ||
134 | static struct __initdata platform_device omap16xx_gpio3 = { | 134 | static struct platform_device omap16xx_gpio3 = { |
135 | .name = "omap_gpio", | 135 | .name = "omap_gpio", |
136 | .id = 3, | 136 | .id = 3, |
137 | .dev = { | 137 | .dev = { |
@@ -160,7 +160,7 @@ static struct __initdata omap_gpio_platform_data omap16xx_gpio4_config = { | |||
160 | .bank_width = 16, | 160 | .bank_width = 16, |
161 | }; | 161 | }; |
162 | 162 | ||
163 | static struct __initdata platform_device omap16xx_gpio4 = { | 163 | static struct platform_device omap16xx_gpio4 = { |
164 | .name = "omap_gpio", | 164 | .name = "omap_gpio", |
165 | .id = 4, | 165 | .id = 4, |
166 | .dev = { | 166 | .dev = { |
diff --git a/arch/arm/mach-omap1/gpio7xx.c b/arch/arm/mach-omap1/gpio7xx.c index 1204c8b871af..c6ad248d63a6 100644 --- a/arch/arm/mach-omap1/gpio7xx.c +++ b/arch/arm/mach-omap1/gpio7xx.c | |||
@@ -46,7 +46,7 @@ static struct __initdata omap_gpio_platform_data omap7xx_mpu_gpio_config = { | |||
46 | .bank_stride = 2, | 46 | .bank_stride = 2, |
47 | }; | 47 | }; |
48 | 48 | ||
49 | static struct __initdata platform_device omap7xx_mpu_gpio = { | 49 | static struct platform_device omap7xx_mpu_gpio = { |
50 | .name = "omap_gpio", | 50 | .name = "omap_gpio", |
51 | .id = 0, | 51 | .id = 0, |
52 | .dev = { | 52 | .dev = { |
@@ -75,7 +75,7 @@ static struct __initdata omap_gpio_platform_data omap7xx_gpio1_config = { | |||
75 | .bank_width = 32, | 75 | .bank_width = 32, |
76 | }; | 76 | }; |
77 | 77 | ||
78 | static struct __initdata platform_device omap7xx_gpio1 = { | 78 | static struct platform_device omap7xx_gpio1 = { |
79 | .name = "omap_gpio", | 79 | .name = "omap_gpio", |
80 | .id = 1, | 80 | .id = 1, |
81 | .dev = { | 81 | .dev = { |
@@ -104,7 +104,7 @@ static struct __initdata omap_gpio_platform_data omap7xx_gpio2_config = { | |||
104 | .bank_width = 32, | 104 | .bank_width = 32, |
105 | }; | 105 | }; |
106 | 106 | ||
107 | static struct __initdata platform_device omap7xx_gpio2 = { | 107 | static struct platform_device omap7xx_gpio2 = { |
108 | .name = "omap_gpio", | 108 | .name = "omap_gpio", |
109 | .id = 2, | 109 | .id = 2, |
110 | .dev = { | 110 | .dev = { |
@@ -133,7 +133,7 @@ static struct __initdata omap_gpio_platform_data omap7xx_gpio3_config = { | |||
133 | .bank_width = 32, | 133 | .bank_width = 32, |
134 | }; | 134 | }; |
135 | 135 | ||
136 | static struct __initdata platform_device omap7xx_gpio3 = { | 136 | static struct platform_device omap7xx_gpio3 = { |
137 | .name = "omap_gpio", | 137 | .name = "omap_gpio", |
138 | .id = 3, | 138 | .id = 3, |
139 | .dev = { | 139 | .dev = { |
@@ -162,7 +162,7 @@ static struct __initdata omap_gpio_platform_data omap7xx_gpio4_config = { | |||
162 | .bank_width = 32, | 162 | .bank_width = 32, |
163 | }; | 163 | }; |
164 | 164 | ||
165 | static struct __initdata platform_device omap7xx_gpio4 = { | 165 | static struct platform_device omap7xx_gpio4 = { |
166 | .name = "omap_gpio", | 166 | .name = "omap_gpio", |
167 | .id = 4, | 167 | .id = 4, |
168 | .dev = { | 168 | .dev = { |
@@ -191,7 +191,7 @@ static struct __initdata omap_gpio_platform_data omap7xx_gpio5_config = { | |||
191 | .bank_width = 32, | 191 | .bank_width = 32, |
192 | }; | 192 | }; |
193 | 193 | ||
194 | static struct __initdata platform_device omap7xx_gpio5 = { | 194 | static struct platform_device omap7xx_gpio5 = { |
195 | .name = "omap_gpio", | 195 | .name = "omap_gpio", |
196 | .id = 5, | 196 | .id = 5, |
197 | .dev = { | 197 | .dev = { |
@@ -220,7 +220,7 @@ static struct __initdata omap_gpio_platform_data omap7xx_gpio6_config = { | |||
220 | .bank_width = 32, | 220 | .bank_width = 32, |
221 | }; | 221 | }; |
222 | 222 | ||
223 | static struct __initdata platform_device omap7xx_gpio6 = { | 223 | static struct platform_device omap7xx_gpio6 = { |
224 | .name = "omap_gpio", | 224 | .name = "omap_gpio", |
225 | .id = 6, | 225 | .id = 6, |
226 | .dev = { | 226 | .dev = { |
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index 990366726c58..88bd6f7705f0 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
@@ -558,7 +558,7 @@ static struct radio_si4713_platform_data rx51_si4713_data __initdata_or_module = | |||
558 | .subdev_board_info = &rx51_si4713_board_info, | 558 | .subdev_board_info = &rx51_si4713_board_info, |
559 | }; | 559 | }; |
560 | 560 | ||
561 | static struct platform_device rx51_si4713_dev __initdata_or_module = { | 561 | static struct platform_device rx51_si4713_dev = { |
562 | .name = "radio-si4713", | 562 | .name = "radio-si4713", |
563 | .id = -1, | 563 | .id = -1, |
564 | .dev = { | 564 | .dev = { |
diff --git a/arch/arm/mach-pxa/mfp-pxa2xx.c b/arch/arm/mach-pxa/mfp-pxa2xx.c index 87ae3129f4f7..b27544bcafcb 100644 --- a/arch/arm/mach-pxa/mfp-pxa2xx.c +++ b/arch/arm/mach-pxa/mfp-pxa2xx.c | |||
@@ -347,9 +347,9 @@ static int pxa2xx_mfp_suspend(void) | |||
347 | if ((gpio_desc[i].config & MFP_LPM_KEEP_OUTPUT) && | 347 | if ((gpio_desc[i].config & MFP_LPM_KEEP_OUTPUT) && |
348 | (GPDR(i) & GPIO_bit(i))) { | 348 | (GPDR(i) & GPIO_bit(i))) { |
349 | if (GPLR(i) & GPIO_bit(i)) | 349 | if (GPLR(i) & GPIO_bit(i)) |
350 | PGSR(i) |= GPIO_bit(i); | 350 | PGSR(gpio_to_bank(i)) |= GPIO_bit(i); |
351 | else | 351 | else |
352 | PGSR(i) &= ~GPIO_bit(i); | 352 | PGSR(gpio_to_bank(i)) &= ~GPIO_bit(i); |
353 | } | 353 | } |
354 | } | 354 | } |
355 | 355 | ||
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c index d130f77b6d11..2f37d43f51b6 100644 --- a/arch/arm/mach-pxa/raumfeld.c +++ b/arch/arm/mach-pxa/raumfeld.c | |||
@@ -573,10 +573,10 @@ static struct pxafb_mode_info sharp_lq043t3dx02_mode = { | |||
573 | .xres = 480, | 573 | .xres = 480, |
574 | .yres = 272, | 574 | .yres = 272, |
575 | .bpp = 16, | 575 | .bpp = 16, |
576 | .hsync_len = 4, | 576 | .hsync_len = 41, |
577 | .left_margin = 2, | 577 | .left_margin = 2, |
578 | .right_margin = 1, | 578 | .right_margin = 1, |
579 | .vsync_len = 1, | 579 | .vsync_len = 10, |
580 | .upper_margin = 3, | 580 | .upper_margin = 3, |
581 | .lower_margin = 1, | 581 | .lower_margin = 1, |
582 | .sync = 0, | 582 | .sync = 0, |
@@ -596,29 +596,31 @@ static void __init raumfeld_lcd_init(void) | |||
596 | { | 596 | { |
597 | int ret; | 597 | int ret; |
598 | 598 | ||
599 | pxa_set_fb_info(NULL, &raumfeld_sharp_lcd_info); | ||
600 | |||
601 | /* Earlier devices had the backlight regulator controlled | ||
602 | * via PWM, later versions use another controller for that */ | ||
603 | if ((system_rev & 0xff) < 2) { | ||
604 | mfp_cfg_t raumfeld_pwm_pin_config = GPIO17_PWM0_OUT; | ||
605 | pxa3xx_mfp_config(&raumfeld_pwm_pin_config, 1); | ||
606 | platform_device_register(&raumfeld_pwm_backlight_device); | ||
607 | } else | ||
608 | platform_device_register(&raumfeld_lt3593_device); | ||
609 | |||
610 | ret = gpio_request(GPIO_TFT_VA_EN, "display VA enable"); | 599 | ret = gpio_request(GPIO_TFT_VA_EN, "display VA enable"); |
611 | if (ret < 0) | 600 | if (ret < 0) |
612 | pr_warning("Unable to request GPIO_TFT_VA_EN\n"); | 601 | pr_warning("Unable to request GPIO_TFT_VA_EN\n"); |
613 | else | 602 | else |
614 | gpio_direction_output(GPIO_TFT_VA_EN, 1); | 603 | gpio_direction_output(GPIO_TFT_VA_EN, 1); |
615 | 604 | ||
605 | msleep(100); | ||
606 | |||
616 | ret = gpio_request(GPIO_DISPLAY_ENABLE, "display enable"); | 607 | ret = gpio_request(GPIO_DISPLAY_ENABLE, "display enable"); |
617 | if (ret < 0) | 608 | if (ret < 0) |
618 | pr_warning("Unable to request GPIO_DISPLAY_ENABLE\n"); | 609 | pr_warning("Unable to request GPIO_DISPLAY_ENABLE\n"); |
619 | else | 610 | else |
620 | gpio_direction_output(GPIO_DISPLAY_ENABLE, 1); | 611 | gpio_direction_output(GPIO_DISPLAY_ENABLE, 1); |
621 | 612 | ||
613 | /* Hardware revision 2 has the backlight regulator controlled | ||
614 | * by an LT3593, earlier and later devices use PWM for that. */ | ||
615 | if ((system_rev & 0xff) == 2) { | ||
616 | platform_device_register(&raumfeld_lt3593_device); | ||
617 | } else { | ||
618 | mfp_cfg_t raumfeld_pwm_pin_config = GPIO17_PWM0_OUT; | ||
619 | pxa3xx_mfp_config(&raumfeld_pwm_pin_config, 1); | ||
620 | platform_device_register(&raumfeld_pwm_backlight_device); | ||
621 | } | ||
622 | |||
623 | pxa_set_fb_info(NULL, &raumfeld_sharp_lcd_info); | ||
622 | platform_device_register(&pxa3xx_device_gcu); | 624 | platform_device_register(&pxa3xx_device_gcu); |
623 | } | 625 | } |
624 | 626 | ||
@@ -657,10 +659,10 @@ static struct lis3lv02d_platform_data lis3_pdata = { | |||
657 | 659 | ||
658 | #define SPI_AK4104 \ | 660 | #define SPI_AK4104 \ |
659 | { \ | 661 | { \ |
660 | .modalias = "ak4104", \ | 662 | .modalias = "ak4104-codec", \ |
661 | .max_speed_hz = 10000, \ | 663 | .max_speed_hz = 10000, \ |
662 | .bus_num = 0, \ | 664 | .bus_num = 0, \ |
663 | .chip_select = 0, \ | 665 | .chip_select = 0, \ |
664 | .controller_data = (void *) GPIO_SPDIF_CS, \ | 666 | .controller_data = (void *) GPIO_SPDIF_CS, \ |
665 | } | 667 | } |
666 | 668 | ||
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c index dd3120df09fe..fc2dc0b3d4fe 100644 --- a/arch/arm/mach-s3c2440/mach-mini2440.c +++ b/arch/arm/mach-s3c2440/mach-mini2440.c | |||
@@ -552,7 +552,7 @@ struct mini2440_features_t { | |||
552 | struct platform_device *optional[8]; | 552 | struct platform_device *optional[8]; |
553 | }; | 553 | }; |
554 | 554 | ||
555 | static void mini2440_parse_features( | 555 | static void __init mini2440_parse_features( |
556 | struct mini2440_features_t * features, | 556 | struct mini2440_features_t * features, |
557 | const char * features_str ) | 557 | const char * features_str ) |
558 | { | 558 | { |
diff --git a/arch/arm/mach-s3c64xx/dev-spi.c b/arch/arm/mach-s3c64xx/dev-spi.c index 82db072cb836..5e6b42089eb4 100644 --- a/arch/arm/mach-s3c64xx/dev-spi.c +++ b/arch/arm/mach-s3c64xx/dev-spi.c | |||
@@ -88,6 +88,7 @@ static struct s3c64xx_spi_info s3c64xx_spi0_pdata = { | |||
88 | .cfg_gpio = s3c64xx_spi_cfg_gpio, | 88 | .cfg_gpio = s3c64xx_spi_cfg_gpio, |
89 | .fifo_lvl_mask = 0x7f, | 89 | .fifo_lvl_mask = 0x7f, |
90 | .rx_lvl_offset = 13, | 90 | .rx_lvl_offset = 13, |
91 | .tx_st_done = 21, | ||
91 | }; | 92 | }; |
92 | 93 | ||
93 | static u64 spi_dmamask = DMA_BIT_MASK(32); | 94 | static u64 spi_dmamask = DMA_BIT_MASK(32); |
@@ -132,6 +133,7 @@ static struct s3c64xx_spi_info s3c64xx_spi1_pdata = { | |||
132 | .cfg_gpio = s3c64xx_spi_cfg_gpio, | 133 | .cfg_gpio = s3c64xx_spi_cfg_gpio, |
133 | .fifo_lvl_mask = 0x7f, | 134 | .fifo_lvl_mask = 0x7f, |
134 | .rx_lvl_offset = 13, | 135 | .rx_lvl_offset = 13, |
136 | .tx_st_done = 21, | ||
135 | }; | 137 | }; |
136 | 138 | ||
137 | struct platform_device s3c64xx_device_spi1 = { | 139 | struct platform_device s3c64xx_device_spi1 = { |
diff --git a/arch/arm/mach-s5p64x0/dev-spi.c b/arch/arm/mach-s5p64x0/dev-spi.c index e78ee18c76e3..ac825e826326 100644 --- a/arch/arm/mach-s5p64x0/dev-spi.c +++ b/arch/arm/mach-s5p64x0/dev-spi.c | |||
@@ -112,12 +112,14 @@ static struct s3c64xx_spi_info s5p6440_spi0_pdata = { | |||
112 | .cfg_gpio = s5p6440_spi_cfg_gpio, | 112 | .cfg_gpio = s5p6440_spi_cfg_gpio, |
113 | .fifo_lvl_mask = 0x1ff, | 113 | .fifo_lvl_mask = 0x1ff, |
114 | .rx_lvl_offset = 15, | 114 | .rx_lvl_offset = 15, |
115 | .tx_st_done = 25, | ||
115 | }; | 116 | }; |
116 | 117 | ||
117 | static struct s3c64xx_spi_info s5p6450_spi0_pdata = { | 118 | static struct s3c64xx_spi_info s5p6450_spi0_pdata = { |
118 | .cfg_gpio = s5p6450_spi_cfg_gpio, | 119 | .cfg_gpio = s5p6450_spi_cfg_gpio, |
119 | .fifo_lvl_mask = 0x1ff, | 120 | .fifo_lvl_mask = 0x1ff, |
120 | .rx_lvl_offset = 15, | 121 | .rx_lvl_offset = 15, |
122 | .tx_st_done = 25, | ||
121 | }; | 123 | }; |
122 | 124 | ||
123 | static u64 spi_dmamask = DMA_BIT_MASK(32); | 125 | static u64 spi_dmamask = DMA_BIT_MASK(32); |
@@ -160,12 +162,14 @@ static struct s3c64xx_spi_info s5p6440_spi1_pdata = { | |||
160 | .cfg_gpio = s5p6440_spi_cfg_gpio, | 162 | .cfg_gpio = s5p6440_spi_cfg_gpio, |
161 | .fifo_lvl_mask = 0x7f, | 163 | .fifo_lvl_mask = 0x7f, |
162 | .rx_lvl_offset = 15, | 164 | .rx_lvl_offset = 15, |
165 | .tx_st_done = 25, | ||
163 | }; | 166 | }; |
164 | 167 | ||
165 | static struct s3c64xx_spi_info s5p6450_spi1_pdata = { | 168 | static struct s3c64xx_spi_info s5p6450_spi1_pdata = { |
166 | .cfg_gpio = s5p6450_spi_cfg_gpio, | 169 | .cfg_gpio = s5p6450_spi_cfg_gpio, |
167 | .fifo_lvl_mask = 0x7f, | 170 | .fifo_lvl_mask = 0x7f, |
168 | .rx_lvl_offset = 15, | 171 | .rx_lvl_offset = 15, |
172 | .tx_st_done = 25, | ||
169 | }; | 173 | }; |
170 | 174 | ||
171 | struct platform_device s5p64x0_device_spi1 = { | 175 | struct platform_device s5p64x0_device_spi1 = { |
diff --git a/arch/arm/mach-s5pc100/dev-spi.c b/arch/arm/mach-s5pc100/dev-spi.c index 57b19794d9bb..e5d6c4dceb56 100644 --- a/arch/arm/mach-s5pc100/dev-spi.c +++ b/arch/arm/mach-s5pc100/dev-spi.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <mach/dma.h> | 15 | #include <mach/dma.h> |
16 | #include <mach/map.h> | 16 | #include <mach/map.h> |
17 | #include <mach/spi-clocks.h> | 17 | #include <mach/spi-clocks.h> |
18 | #include <mach/irqs.h> | ||
18 | 19 | ||
19 | #include <plat/s3c64xx-spi.h> | 20 | #include <plat/s3c64xx-spi.h> |
20 | #include <plat/gpio-cfg.h> | 21 | #include <plat/gpio-cfg.h> |
@@ -90,6 +91,7 @@ static struct s3c64xx_spi_info s5pc100_spi0_pdata = { | |||
90 | .fifo_lvl_mask = 0x7f, | 91 | .fifo_lvl_mask = 0x7f, |
91 | .rx_lvl_offset = 13, | 92 | .rx_lvl_offset = 13, |
92 | .high_speed = 1, | 93 | .high_speed = 1, |
94 | .tx_st_done = 21, | ||
93 | }; | 95 | }; |
94 | 96 | ||
95 | static u64 spi_dmamask = DMA_BIT_MASK(32); | 97 | static u64 spi_dmamask = DMA_BIT_MASK(32); |
@@ -134,6 +136,7 @@ static struct s3c64xx_spi_info s5pc100_spi1_pdata = { | |||
134 | .fifo_lvl_mask = 0x7f, | 136 | .fifo_lvl_mask = 0x7f, |
135 | .rx_lvl_offset = 13, | 137 | .rx_lvl_offset = 13, |
136 | .high_speed = 1, | 138 | .high_speed = 1, |
139 | .tx_st_done = 21, | ||
137 | }; | 140 | }; |
138 | 141 | ||
139 | struct platform_device s5pc100_device_spi1 = { | 142 | struct platform_device s5pc100_device_spi1 = { |
@@ -176,6 +179,7 @@ static struct s3c64xx_spi_info s5pc100_spi2_pdata = { | |||
176 | .fifo_lvl_mask = 0x7f, | 179 | .fifo_lvl_mask = 0x7f, |
177 | .rx_lvl_offset = 13, | 180 | .rx_lvl_offset = 13, |
178 | .high_speed = 1, | 181 | .high_speed = 1, |
182 | .tx_st_done = 21, | ||
179 | }; | 183 | }; |
180 | 184 | ||
181 | struct platform_device s5pc100_device_spi2 = { | 185 | struct platform_device s5pc100_device_spi2 = { |
diff --git a/arch/arm/mach-s5pv210/dev-spi.c b/arch/arm/mach-s5pv210/dev-spi.c index e3249a47e3b1..eaf9a7bff7a0 100644 --- a/arch/arm/mach-s5pv210/dev-spi.c +++ b/arch/arm/mach-s5pv210/dev-spi.c | |||
@@ -85,6 +85,7 @@ static struct s3c64xx_spi_info s5pv210_spi0_pdata = { | |||
85 | .fifo_lvl_mask = 0x1ff, | 85 | .fifo_lvl_mask = 0x1ff, |
86 | .rx_lvl_offset = 15, | 86 | .rx_lvl_offset = 15, |
87 | .high_speed = 1, | 87 | .high_speed = 1, |
88 | .tx_st_done = 25, | ||
88 | }; | 89 | }; |
89 | 90 | ||
90 | static u64 spi_dmamask = DMA_BIT_MASK(32); | 91 | static u64 spi_dmamask = DMA_BIT_MASK(32); |
@@ -129,6 +130,7 @@ static struct s3c64xx_spi_info s5pv210_spi1_pdata = { | |||
129 | .fifo_lvl_mask = 0x7f, | 130 | .fifo_lvl_mask = 0x7f, |
130 | .rx_lvl_offset = 15, | 131 | .rx_lvl_offset = 15, |
131 | .high_speed = 1, | 132 | .high_speed = 1, |
133 | .tx_st_done = 25, | ||
132 | }; | 134 | }; |
133 | 135 | ||
134 | struct platform_device s5pv210_device_spi1 = { | 136 | struct platform_device s5pv210_device_spi1 = { |
diff --git a/arch/arm/mach-vt8500/irq.c b/arch/arm/mach-vt8500/irq.c index 245140c0df10..642de0408f25 100644 --- a/arch/arm/mach-vt8500/irq.c +++ b/arch/arm/mach-vt8500/irq.c | |||
@@ -39,9 +39,10 @@ | |||
39 | static void __iomem *ic_regbase; | 39 | static void __iomem *ic_regbase; |
40 | static void __iomem *sic_regbase; | 40 | static void __iomem *sic_regbase; |
41 | 41 | ||
42 | static void vt8500_irq_mask(unsigned int irq) | 42 | static void vt8500_irq_mask(struct irq_data *d) |
43 | { | 43 | { |
44 | void __iomem *base = ic_regbase; | 44 | void __iomem *base = ic_regbase; |
45 | unsigned irq = d->irq; | ||
45 | u8 edge; | 46 | u8 edge; |
46 | 47 | ||
47 | if (irq >= 64) { | 48 | if (irq >= 64) { |
@@ -64,9 +65,10 @@ static void vt8500_irq_mask(unsigned int irq) | |||
64 | } | 65 | } |
65 | } | 66 | } |
66 | 67 | ||
67 | static void vt8500_irq_unmask(unsigned int irq) | 68 | static void vt8500_irq_unmask(struct irq_data *d) |
68 | { | 69 | { |
69 | void __iomem *base = ic_regbase; | 70 | void __iomem *base = ic_regbase; |
71 | unsigned irq = d->irq; | ||
70 | u8 dctr; | 72 | u8 dctr; |
71 | 73 | ||
72 | if (irq >= 64) { | 74 | if (irq >= 64) { |
@@ -78,10 +80,11 @@ static void vt8500_irq_unmask(unsigned int irq) | |||
78 | writeb(dctr, base + VT8500_IC_DCTR + irq); | 80 | writeb(dctr, base + VT8500_IC_DCTR + irq); |
79 | } | 81 | } |
80 | 82 | ||
81 | static int vt8500_irq_set_type(unsigned int irq, unsigned int flow_type) | 83 | static int vt8500_irq_set_type(struct irq_data *d, unsigned int flow_type) |
82 | { | 84 | { |
83 | void __iomem *base = ic_regbase; | 85 | void __iomem *base = ic_regbase; |
84 | unsigned int orig_irq = irq; | 86 | unsigned irq = d->irq; |
87 | unsigned orig_irq = irq; | ||
85 | u8 dctr; | 88 | u8 dctr; |
86 | 89 | ||
87 | if (irq >= 64) { | 90 | if (irq >= 64) { |
@@ -114,11 +117,11 @@ static int vt8500_irq_set_type(unsigned int irq, unsigned int flow_type) | |||
114 | } | 117 | } |
115 | 118 | ||
116 | static struct irq_chip vt8500_irq_chip = { | 119 | static struct irq_chip vt8500_irq_chip = { |
117 | .name = "vt8500", | 120 | .name = "vt8500", |
118 | .ack = vt8500_irq_mask, | 121 | .irq_ack = vt8500_irq_mask, |
119 | .mask = vt8500_irq_mask, | 122 | .irq_mask = vt8500_irq_mask, |
120 | .unmask = vt8500_irq_unmask, | 123 | .irq_unmask = vt8500_irq_unmask, |
121 | .set_type = vt8500_irq_set_type, | 124 | .irq_set_type = vt8500_irq_set_type, |
122 | }; | 125 | }; |
123 | 126 | ||
124 | void __init vt8500_init_irq(void) | 127 | void __init vt8500_init_irq(void) |
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index ef59099a5463..44c086710d2b 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c | |||
@@ -120,17 +120,22 @@ static void l2x0_cache_sync(void) | |||
120 | spin_unlock_irqrestore(&l2x0_lock, flags); | 120 | spin_unlock_irqrestore(&l2x0_lock, flags); |
121 | } | 121 | } |
122 | 122 | ||
123 | static void l2x0_flush_all(void) | 123 | static void __l2x0_flush_all(void) |
124 | { | 124 | { |
125 | unsigned long flags; | ||
126 | |||
127 | /* clean all ways */ | ||
128 | spin_lock_irqsave(&l2x0_lock, flags); | ||
129 | debug_writel(0x03); | 125 | debug_writel(0x03); |
130 | writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_CLEAN_INV_WAY); | 126 | writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_CLEAN_INV_WAY); |
131 | cache_wait_way(l2x0_base + L2X0_CLEAN_INV_WAY, l2x0_way_mask); | 127 | cache_wait_way(l2x0_base + L2X0_CLEAN_INV_WAY, l2x0_way_mask); |
132 | cache_sync(); | 128 | cache_sync(); |
133 | debug_writel(0x00); | 129 | debug_writel(0x00); |
130 | } | ||
131 | |||
132 | static void l2x0_flush_all(void) | ||
133 | { | ||
134 | unsigned long flags; | ||
135 | |||
136 | /* clean all ways */ | ||
137 | spin_lock_irqsave(&l2x0_lock, flags); | ||
138 | __l2x0_flush_all(); | ||
134 | spin_unlock_irqrestore(&l2x0_lock, flags); | 139 | spin_unlock_irqrestore(&l2x0_lock, flags); |
135 | } | 140 | } |
136 | 141 | ||
@@ -266,7 +271,9 @@ static void l2x0_disable(void) | |||
266 | unsigned long flags; | 271 | unsigned long flags; |
267 | 272 | ||
268 | spin_lock_irqsave(&l2x0_lock, flags); | 273 | spin_lock_irqsave(&l2x0_lock, flags); |
269 | writel(0, l2x0_base + L2X0_CTRL); | 274 | __l2x0_flush_all(); |
275 | writel_relaxed(0, l2x0_base + L2X0_CTRL); | ||
276 | dsb(); | ||
270 | spin_unlock_irqrestore(&l2x0_lock, flags); | 277 | spin_unlock_irqrestore(&l2x0_lock, flags); |
271 | } | 278 | } |
272 | 279 | ||
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 9d9e736c2b4f..594d677b92c8 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -759,7 +759,7 @@ early_param("vmalloc", early_vmalloc); | |||
759 | 759 | ||
760 | static phys_addr_t lowmem_limit __initdata = 0; | 760 | static phys_addr_t lowmem_limit __initdata = 0; |
761 | 761 | ||
762 | static void __init sanity_check_meminfo(void) | 762 | void __init sanity_check_meminfo(void) |
763 | { | 763 | { |
764 | int i, j, highmem = 0; | 764 | int i, j, highmem = 0; |
765 | 765 | ||
@@ -1032,8 +1032,9 @@ void __init paging_init(struct machine_desc *mdesc) | |||
1032 | { | 1032 | { |
1033 | void *zero_page; | 1033 | void *zero_page; |
1034 | 1034 | ||
1035 | memblock_set_current_limit(lowmem_limit); | ||
1036 | |||
1035 | build_mem_type_table(); | 1037 | build_mem_type_table(); |
1036 | sanity_check_meminfo(); | ||
1037 | prepare_page_table(); | 1038 | prepare_page_table(); |
1038 | map_lowmem(); | 1039 | map_lowmem(); |
1039 | devicemaps_init(mdesc); | 1040 | devicemaps_init(mdesc); |
diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c index 687d02319a41..941a98c9e8aa 100644 --- a/arch/arm/mm/nommu.c +++ b/arch/arm/mm/nommu.c | |||
@@ -27,6 +27,10 @@ void __init arm_mm_memblock_reserve(void) | |||
27 | memblock_reserve(CONFIG_VECTORS_BASE, PAGE_SIZE); | 27 | memblock_reserve(CONFIG_VECTORS_BASE, PAGE_SIZE); |
28 | } | 28 | } |
29 | 29 | ||
30 | void __init sanity_check_meminfo(void) | ||
31 | { | ||
32 | } | ||
33 | |||
30 | /* | 34 | /* |
31 | * paging_init() sets up the page tables, initialises the zone memory | 35 | * paging_init() sets up the page tables, initialises the zone memory |
32 | * maps, and sets up the zero page, bad page and bad page tables. | 36 | * maps, and sets up the zero page, bad page and bad page tables. |
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c index 5b4fffab1eb4..41ab97ebe4cf 100644 --- a/arch/arm/plat-orion/gpio.c +++ b/arch/arm/plat-orion/gpio.c | |||
@@ -432,7 +432,7 @@ void __init orion_gpio_init(int gpio_base, int ngpio, | |||
432 | ct->regs.mask = ochip->mask_offset + GPIO_EDGE_MASK_OFF; | 432 | ct->regs.mask = ochip->mask_offset + GPIO_EDGE_MASK_OFF; |
433 | ct->regs.ack = GPIO_EDGE_CAUSE_OFF; | 433 | ct->regs.ack = GPIO_EDGE_CAUSE_OFF; |
434 | ct->type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING; | 434 | ct->type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING; |
435 | ct->chip.irq_ack = irq_gc_ack; | 435 | ct->chip.irq_ack = irq_gc_ack_clr_bit; |
436 | ct->chip.irq_mask = irq_gc_mask_clr_bit; | 436 | ct->chip.irq_mask = irq_gc_mask_clr_bit; |
437 | ct->chip.irq_unmask = irq_gc_mask_set_bit; | 437 | ct->chip.irq_unmask = irq_gc_mask_set_bit; |
438 | ct->chip.irq_set_type = gpio_irq_set_type; | 438 | ct->chip.irq_set_type = gpio_irq_set_type; |
diff --git a/arch/arm/plat-pxa/gpio.c b/arch/arm/plat-pxa/gpio.c index 48ebb9479b61..a11dc3670505 100644 --- a/arch/arm/plat-pxa/gpio.c +++ b/arch/arm/plat-pxa/gpio.c | |||
@@ -50,7 +50,7 @@ static inline void __iomem *gpio_chip_base(struct gpio_chip *c) | |||
50 | return container_of(c, struct pxa_gpio_chip, chip)->regbase; | 50 | return container_of(c, struct pxa_gpio_chip, chip)->regbase; |
51 | } | 51 | } |
52 | 52 | ||
53 | static inline struct pxa_gpio_chip *gpio_to_chip(unsigned gpio) | 53 | static inline struct pxa_gpio_chip *gpio_to_pxachip(unsigned gpio) |
54 | { | 54 | { |
55 | return &pxa_gpio_chips[gpio_to_bank(gpio)]; | 55 | return &pxa_gpio_chips[gpio_to_bank(gpio)]; |
56 | } | 56 | } |
@@ -161,7 +161,7 @@ static int pxa_gpio_irq_type(struct irq_data *d, unsigned int type) | |||
161 | int gpio = irq_to_gpio(d->irq); | 161 | int gpio = irq_to_gpio(d->irq); |
162 | unsigned long gpdr, mask = GPIO_bit(gpio); | 162 | unsigned long gpdr, mask = GPIO_bit(gpio); |
163 | 163 | ||
164 | c = gpio_to_chip(gpio); | 164 | c = gpio_to_pxachip(gpio); |
165 | 165 | ||
166 | if (type == IRQ_TYPE_PROBE) { | 166 | if (type == IRQ_TYPE_PROBE) { |
167 | /* Don't mess with enabled GPIOs using preconfigured edges or | 167 | /* Don't mess with enabled GPIOs using preconfigured edges or |
@@ -230,7 +230,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc) | |||
230 | static void pxa_ack_muxed_gpio(struct irq_data *d) | 230 | static void pxa_ack_muxed_gpio(struct irq_data *d) |
231 | { | 231 | { |
232 | int gpio = irq_to_gpio(d->irq); | 232 | int gpio = irq_to_gpio(d->irq); |
233 | struct pxa_gpio_chip *c = gpio_to_chip(gpio); | 233 | struct pxa_gpio_chip *c = gpio_to_pxachip(gpio); |
234 | 234 | ||
235 | __raw_writel(GPIO_bit(gpio), c->regbase + GEDR_OFFSET); | 235 | __raw_writel(GPIO_bit(gpio), c->regbase + GEDR_OFFSET); |
236 | } | 236 | } |
@@ -238,7 +238,7 @@ static void pxa_ack_muxed_gpio(struct irq_data *d) | |||
238 | static void pxa_mask_muxed_gpio(struct irq_data *d) | 238 | static void pxa_mask_muxed_gpio(struct irq_data *d) |
239 | { | 239 | { |
240 | int gpio = irq_to_gpio(d->irq); | 240 | int gpio = irq_to_gpio(d->irq); |
241 | struct pxa_gpio_chip *c = gpio_to_chip(gpio); | 241 | struct pxa_gpio_chip *c = gpio_to_pxachip(gpio); |
242 | uint32_t grer, gfer; | 242 | uint32_t grer, gfer; |
243 | 243 | ||
244 | c->irq_mask &= ~GPIO_bit(gpio); | 244 | c->irq_mask &= ~GPIO_bit(gpio); |
@@ -252,7 +252,7 @@ static void pxa_mask_muxed_gpio(struct irq_data *d) | |||
252 | static void pxa_unmask_muxed_gpio(struct irq_data *d) | 252 | static void pxa_unmask_muxed_gpio(struct irq_data *d) |
253 | { | 253 | { |
254 | int gpio = irq_to_gpio(d->irq); | 254 | int gpio = irq_to_gpio(d->irq); |
255 | struct pxa_gpio_chip *c = gpio_to_chip(gpio); | 255 | struct pxa_gpio_chip *c = gpio_to_pxachip(gpio); |
256 | 256 | ||
257 | c->irq_mask |= GPIO_bit(gpio); | 257 | c->irq_mask |= GPIO_bit(gpio); |
258 | update_edge_detect(c); | 258 | update_edge_detect(c); |
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c index 2abf9660bc6c..a79a8ccd25f6 100644 --- a/arch/arm/plat-s3c24xx/dma.c +++ b/arch/arm/plat-s3c24xx/dma.c | |||
@@ -1027,17 +1027,13 @@ int s3c2410_dma_config(unsigned int channel, | |||
1027 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); | 1027 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); |
1028 | unsigned int dcon; | 1028 | unsigned int dcon; |
1029 | 1029 | ||
1030 | pr_debug("%s: chan=%d, xfer_unit=%d, dcon=%08x\n", | 1030 | pr_debug("%s: chan=%d, xfer_unit=%d\n", __func__, channel, xferunit); |
1031 | __func__, channel, xferunit, dcon); | ||
1032 | 1031 | ||
1033 | if (chan == NULL) | 1032 | if (chan == NULL) |
1034 | return -EINVAL; | 1033 | return -EINVAL; |
1035 | 1034 | ||
1036 | pr_debug("%s: Initial dcon is %08x\n", __func__, dcon); | ||
1037 | |||
1038 | dcon = chan->dcon & dma_sel.dcon_mask; | 1035 | dcon = chan->dcon & dma_sel.dcon_mask; |
1039 | 1036 | pr_debug("%s: dcon is %08x\n", __func__, dcon); | |
1040 | pr_debug("%s: New dcon is %08x\n", __func__, dcon); | ||
1041 | 1037 | ||
1042 | switch (chan->req_ch) { | 1038 | switch (chan->req_ch) { |
1043 | case DMACH_I2S_IN: | 1039 | case DMACH_I2S_IN: |
@@ -1235,7 +1231,7 @@ static void s3c2410_dma_resume_chan(struct s3c2410_dma_chan *cp) | |||
1235 | /* restore channel's hardware configuration */ | 1231 | /* restore channel's hardware configuration */ |
1236 | 1232 | ||
1237 | if (!cp->in_use) | 1233 | if (!cp->in_use) |
1238 | return 0; | 1234 | return; |
1239 | 1235 | ||
1240 | printk(KERN_INFO "dma%d: restoring configuration\n", cp->number); | 1236 | printk(KERN_INFO "dma%d: restoring configuration\n", cp->number); |
1241 | 1237 | ||
@@ -1246,8 +1242,6 @@ static void s3c2410_dma_resume_chan(struct s3c2410_dma_chan *cp) | |||
1246 | 1242 | ||
1247 | if (cp->map != NULL) | 1243 | if (cp->map != NULL) |
1248 | dma_sel.select(cp, cp->map); | 1244 | dma_sel.select(cp, cp->map); |
1249 | |||
1250 | return 0; | ||
1251 | } | 1245 | } |
1252 | 1246 | ||
1253 | static void s3c2410_dma_resume(void) | 1247 | static void s3c2410_dma_resume(void) |
diff --git a/arch/arm/plat-s5p/irq-gpioint.c b/arch/arm/plat-s5p/irq-gpioint.c index 135abda31c9a..327ab9f662e8 100644 --- a/arch/arm/plat-s5p/irq-gpioint.c +++ b/arch/arm/plat-s5p/irq-gpioint.c | |||
@@ -152,7 +152,7 @@ static __init int s5p_gpioint_add(struct s3c_gpio_chip *chip) | |||
152 | if (!gc) | 152 | if (!gc) |
153 | return -ENOMEM; | 153 | return -ENOMEM; |
154 | ct = gc->chip_types; | 154 | ct = gc->chip_types; |
155 | ct->chip.irq_ack = irq_gc_ack; | 155 | ct->chip.irq_ack = irq_gc_ack_set_bit; |
156 | ct->chip.irq_mask = irq_gc_mask_set_bit; | 156 | ct->chip.irq_mask = irq_gc_mask_set_bit; |
157 | ct->chip.irq_unmask = irq_gc_mask_clr_bit; | 157 | ct->chip.irq_unmask = irq_gc_mask_clr_bit; |
158 | ct->chip.irq_set_type = s5p_gpioint_set_type, | 158 | ct->chip.irq_set_type = s5p_gpioint_set_type, |
diff --git a/arch/arm/plat-s5p/s5p-time.c b/arch/arm/plat-s5p/s5p-time.c index 899a8cc011ff..612934c48b0d 100644 --- a/arch/arm/plat-s5p/s5p-time.c +++ b/arch/arm/plat-s5p/s5p-time.c | |||
@@ -370,11 +370,11 @@ static void __init s5p_clocksource_init(void) | |||
370 | 370 | ||
371 | clock_rate = clk_get_rate(tin_source); | 371 | clock_rate = clk_get_rate(tin_source); |
372 | 372 | ||
373 | init_sched_clock(&cd, s5p_update_sched_clock, 32, clock_rate); | ||
374 | |||
375 | s5p_time_setup(timer_source.source_id, TCNT_MAX); | 373 | s5p_time_setup(timer_source.source_id, TCNT_MAX); |
376 | s5p_time_start(timer_source.source_id, PERIODIC); | 374 | s5p_time_start(timer_source.source_id, PERIODIC); |
377 | 375 | ||
376 | init_sched_clock(&cd, s5p_update_sched_clock, 32, clock_rate); | ||
377 | |||
378 | if (clocksource_register_hz(&time_clocksource, clock_rate)) | 378 | if (clocksource_register_hz(&time_clocksource, clock_rate)) |
379 | panic("%s: can't register clocksource\n", time_clocksource.name); | 379 | panic("%s: can't register clocksource\n", time_clocksource.name); |
380 | } | 380 | } |
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h index 4af108ff4112..e3b31c26ac3e 100644 --- a/arch/arm/plat-samsung/include/plat/devs.h +++ b/arch/arm/plat-samsung/include/plat/devs.h | |||
@@ -12,6 +12,10 @@ | |||
12 | * it under the terms of the GNU General Public License version 2 as | 12 | * it under the terms of the GNU General Public License version 2 as |
13 | * published by the Free Software Foundation. | 13 | * published by the Free Software Foundation. |
14 | */ | 14 | */ |
15 | |||
16 | #ifndef __PLAT_DEVS_H | ||
17 | #define __PLAT_DEVS_H __FILE__ | ||
18 | |||
15 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
16 | 20 | ||
17 | struct s3c24xx_uart_resources { | 21 | struct s3c24xx_uart_resources { |
@@ -159,3 +163,5 @@ extern struct platform_device s3c_device_ac97; | |||
159 | */ | 163 | */ |
160 | extern void *s3c_set_platdata(void *pd, size_t pdsize, | 164 | extern void *s3c_set_platdata(void *pd, size_t pdsize, |
161 | struct platform_device *pdev); | 165 | struct platform_device *pdev); |
166 | |||
167 | #endif /* __PLAT_DEVS_H */ | ||
diff --git a/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h b/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h index 0ffe34a21554..4c16fa3621bb 100644 --- a/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h +++ b/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h | |||
@@ -39,6 +39,7 @@ struct s3c64xx_spi_csinfo { | |||
39 | * @fifo_lvl_mask: All tx fifo_lvl fields start at offset-6 | 39 | * @fifo_lvl_mask: All tx fifo_lvl fields start at offset-6 |
40 | * @rx_lvl_offset: Depends on tx fifo_lvl field and bus number | 40 | * @rx_lvl_offset: Depends on tx fifo_lvl field and bus number |
41 | * @high_speed: If the controller supports HIGH_SPEED_EN bit | 41 | * @high_speed: If the controller supports HIGH_SPEED_EN bit |
42 | * @tx_st_done: Depends on tx fifo_lvl field | ||
42 | */ | 43 | */ |
43 | struct s3c64xx_spi_info { | 44 | struct s3c64xx_spi_info { |
44 | int src_clk_nr; | 45 | int src_clk_nr; |
@@ -53,6 +54,7 @@ struct s3c64xx_spi_info { | |||
53 | int fifo_lvl_mask; | 54 | int fifo_lvl_mask; |
54 | int rx_lvl_offset; | 55 | int rx_lvl_offset; |
55 | int high_speed; | 56 | int high_speed; |
57 | int tx_st_done; | ||
56 | }; | 58 | }; |
57 | 59 | ||
58 | /** | 60 | /** |
diff --git a/arch/arm/plat-samsung/irq-uart.c b/arch/arm/plat-samsung/irq-uart.c index 32582c0958e3..0e46588d847b 100644 --- a/arch/arm/plat-samsung/irq-uart.c +++ b/arch/arm/plat-samsung/irq-uart.c | |||
@@ -55,7 +55,7 @@ static void __init s3c_init_uart_irq(struct s3c_uart_irq *uirq) | |||
55 | gc = irq_alloc_generic_chip("s3c-uart", 1, uirq->base_irq, reg_base, | 55 | gc = irq_alloc_generic_chip("s3c-uart", 1, uirq->base_irq, reg_base, |
56 | handle_level_irq); | 56 | handle_level_irq); |
57 | ct = gc->chip_types; | 57 | ct = gc->chip_types; |
58 | ct->chip.irq_ack = irq_gc_ack; | 58 | ct->chip.irq_ack = irq_gc_ack_set_bit; |
59 | ct->chip.irq_mask = irq_gc_mask_set_bit; | 59 | ct->chip.irq_mask = irq_gc_mask_set_bit; |
60 | ct->chip.irq_unmask = irq_gc_mask_clr_bit; | 60 | ct->chip.irq_unmask = irq_gc_mask_clr_bit; |
61 | ct->regs.ack = S3C64XX_UINTP; | 61 | ct->regs.ack = S3C64XX_UINTP; |
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index 33867ec4a234..9d6a8effeda2 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c | |||
@@ -12,6 +12,8 @@ | |||
12 | #include <linux/of.h> | 12 | #include <linux/of.h> |
13 | #include <linux/memblock.h> | 13 | #include <linux/memblock.h> |
14 | #include <linux/vmalloc.h> | 14 | #include <linux/vmalloc.h> |
15 | #include <linux/memory.h> | ||
16 | |||
15 | #include <asm/firmware.h> | 17 | #include <asm/firmware.h> |
16 | #include <asm/machdep.h> | 18 | #include <asm/machdep.h> |
17 | #include <asm/pSeries_reconfig.h> | 19 | #include <asm/pSeries_reconfig.h> |
@@ -20,24 +22,25 @@ | |||
20 | static unsigned long get_memblock_size(void) | 22 | static unsigned long get_memblock_size(void) |
21 | { | 23 | { |
22 | struct device_node *np; | 24 | struct device_node *np; |
23 | unsigned int memblock_size = 0; | 25 | unsigned int memblock_size = MIN_MEMORY_BLOCK_SIZE; |
26 | struct resource r; | ||
24 | 27 | ||
25 | np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); | 28 | np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); |
26 | if (np) { | 29 | if (np) { |
27 | const unsigned long *size; | 30 | const __be64 *size; |
28 | 31 | ||
29 | size = of_get_property(np, "ibm,lmb-size", NULL); | 32 | size = of_get_property(np, "ibm,lmb-size", NULL); |
30 | memblock_size = size ? *size : 0; | 33 | if (size) |
31 | 34 | memblock_size = be64_to_cpup(size); | |
32 | of_node_put(np); | 35 | of_node_put(np); |
33 | } else { | 36 | } else if (machine_is(pseries)) { |
37 | /* This fallback really only applies to pseries */ | ||
34 | unsigned int memzero_size = 0; | 38 | unsigned int memzero_size = 0; |
35 | const unsigned int *regs; | ||
36 | 39 | ||
37 | np = of_find_node_by_path("/memory@0"); | 40 | np = of_find_node_by_path("/memory@0"); |
38 | if (np) { | 41 | if (np) { |
39 | regs = of_get_property(np, "reg", NULL); | 42 | if (!of_address_to_resource(np, 0, &r)) |
40 | memzero_size = regs ? regs[3] : 0; | 43 | memzero_size = resource_size(&r); |
41 | of_node_put(np); | 44 | of_node_put(np); |
42 | } | 45 | } |
43 | 46 | ||
@@ -50,16 +53,21 @@ static unsigned long get_memblock_size(void) | |||
50 | sprintf(buf, "/memory@%x", memzero_size); | 53 | sprintf(buf, "/memory@%x", memzero_size); |
51 | np = of_find_node_by_path(buf); | 54 | np = of_find_node_by_path(buf); |
52 | if (np) { | 55 | if (np) { |
53 | regs = of_get_property(np, "reg", NULL); | 56 | if (!of_address_to_resource(np, 0, &r)) |
54 | memblock_size = regs ? regs[3] : 0; | 57 | memblock_size = resource_size(&r); |
55 | of_node_put(np); | 58 | of_node_put(np); |
56 | } | 59 | } |
57 | } | 60 | } |
58 | } | 61 | } |
59 | |||
60 | return memblock_size; | 62 | return memblock_size; |
61 | } | 63 | } |
62 | 64 | ||
65 | /* WARNING: This is going to override the generic definition whenever | ||
66 | * pseries is built-in regardless of what platform is active at boot | ||
67 | * time. This is fine for now as this is the only "option" and it | ||
68 | * should work everywhere. If not, we'll have to turn this into a | ||
69 | * ppc_md. callback | ||
70 | */ | ||
63 | unsigned long memory_block_size_bytes(void) | 71 | unsigned long memory_block_size_bytes(void) |
64 | { | 72 | { |
65 | return get_memblock_size(); | 73 | return get_memblock_size(); |
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index d865c4aeec55..bbaaa005bf0e 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/poison.h> | 28 | #include <linux/poison.h> |
29 | #include <linux/dma-mapping.h> | 29 | #include <linux/dma-mapping.h> |
30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
31 | #include <linux/memory.h> | ||
31 | #include <linux/memory_hotplug.h> | 32 | #include <linux/memory_hotplug.h> |
32 | #include <linux/nmi.h> | 33 | #include <linux/nmi.h> |
33 | #include <linux/gfp.h> | 34 | #include <linux/gfp.h> |
@@ -895,8 +896,6 @@ const char *arch_vma_name(struct vm_area_struct *vma) | |||
895 | } | 896 | } |
896 | 897 | ||
897 | #ifdef CONFIG_X86_UV | 898 | #ifdef CONFIG_X86_UV |
898 | #define MIN_MEMORY_BLOCK_SIZE (1 << SECTION_SIZE_BITS) | ||
899 | |||
900 | unsigned long memory_block_size_bytes(void) | 899 | unsigned long memory_block_size_bytes(void) |
901 | { | 900 | { |
902 | if (is_uv_system()) { | 901 | if (is_uv_system()) { |
diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 9f9b2359f718..45d7c8fc73bd 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c | |||
@@ -30,7 +30,6 @@ | |||
30 | static DEFINE_MUTEX(mem_sysfs_mutex); | 30 | static DEFINE_MUTEX(mem_sysfs_mutex); |
31 | 31 | ||
32 | #define MEMORY_CLASS_NAME "memory" | 32 | #define MEMORY_CLASS_NAME "memory" |
33 | #define MIN_MEMORY_BLOCK_SIZE (1 << SECTION_SIZE_BITS) | ||
34 | 33 | ||
35 | static int sections_per_block; | 34 | static int sections_per_block; |
36 | 35 | ||
diff --git a/drivers/base/syscore.c b/drivers/base/syscore.c index c126db3cb7d1..e8d11b6630ee 100644 --- a/drivers/base/syscore.c +++ b/drivers/base/syscore.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/syscore_ops.h> | 9 | #include <linux/syscore_ops.h> |
10 | #include <linux/mutex.h> | 10 | #include <linux/mutex.h> |
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/interrupt.h> | ||
12 | 13 | ||
13 | static LIST_HEAD(syscore_ops_list); | 14 | static LIST_HEAD(syscore_ops_list); |
14 | static DEFINE_MUTEX(syscore_ops_lock); | 15 | static DEFINE_MUTEX(syscore_ops_lock); |
@@ -48,6 +49,13 @@ int syscore_suspend(void) | |||
48 | struct syscore_ops *ops; | 49 | struct syscore_ops *ops; |
49 | int ret = 0; | 50 | int ret = 0; |
50 | 51 | ||
52 | pr_debug("Checking wakeup interrupts\n"); | ||
53 | |||
54 | /* Return error code if there are any wakeup interrupts pending. */ | ||
55 | ret = check_wakeup_irqs(); | ||
56 | if (ret) | ||
57 | return ret; | ||
58 | |||
51 | WARN_ONCE(!irqs_disabled(), | 59 | WARN_ONCE(!irqs_disabled(), |
52 | "Interrupts enabled before system core suspend.\n"); | 60 | "Interrupts enabled before system core suspend.\n"); |
53 | 61 | ||
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 4e04e1274388..596d5dd32f41 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c | |||
@@ -759,7 +759,7 @@ static void __exit acpi_cpufreq_exit(void) | |||
759 | 759 | ||
760 | cpufreq_unregister_driver(&acpi_cpufreq_driver); | 760 | cpufreq_unregister_driver(&acpi_cpufreq_driver); |
761 | 761 | ||
762 | free_percpu(acpi_perf_data); | 762 | free_acpi_perf_data(); |
763 | } | 763 | } |
764 | 764 | ||
765 | module_param(acpi_pstate_strict, uint, 0644); | 765 | module_param(acpi_pstate_strict, uint, 0644); |
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 438e6c831170..ebb897329c1e 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
@@ -264,6 +264,7 @@ static char ohci_driver_name[] = KBUILD_MODNAME; | |||
264 | #define PCI_DEVICE_ID_AGERE_FW643 0x5901 | 264 | #define PCI_DEVICE_ID_AGERE_FW643 0x5901 |
265 | #define PCI_DEVICE_ID_JMICRON_JMB38X_FW 0x2380 | 265 | #define PCI_DEVICE_ID_JMICRON_JMB38X_FW 0x2380 |
266 | #define PCI_DEVICE_ID_TI_TSB12LV22 0x8009 | 266 | #define PCI_DEVICE_ID_TI_TSB12LV22 0x8009 |
267 | #define PCI_VENDOR_ID_PINNACLE_SYSTEMS 0x11bd | ||
267 | 268 | ||
268 | #define QUIRK_CYCLE_TIMER 1 | 269 | #define QUIRK_CYCLE_TIMER 1 |
269 | #define QUIRK_RESET_PACKET 2 | 270 | #define QUIRK_RESET_PACKET 2 |
@@ -3190,6 +3191,11 @@ static int __devinit pci_probe(struct pci_dev *dev, | |||
3190 | int i, err; | 3191 | int i, err; |
3191 | size_t size; | 3192 | size_t size; |
3192 | 3193 | ||
3194 | if (dev->vendor == PCI_VENDOR_ID_PINNACLE_SYSTEMS) { | ||
3195 | dev_err(&dev->dev, "Pinnacle MovieBoard is not yet supported\n"); | ||
3196 | return -ENOSYS; | ||
3197 | } | ||
3198 | |||
3193 | ohci = kzalloc(sizeof(*ohci), GFP_KERNEL); | 3199 | ohci = kzalloc(sizeof(*ohci), GFP_KERNEL); |
3194 | if (ohci == NULL) { | 3200 | if (ohci == NULL) { |
3195 | err = -ENOMEM; | 3201 | err = -ENOMEM; |
diff --git a/drivers/gpio/langwell_gpio.c b/drivers/gpio/langwell_gpio.c index bd6571e0097a..644ba1255d3c 100644 --- a/drivers/gpio/langwell_gpio.c +++ b/drivers/gpio/langwell_gpio.c | |||
@@ -223,7 +223,7 @@ static void lnw_irq_handler(unsigned irq, struct irq_desc *desc) | |||
223 | gedr = gpio_reg(&lnw->chip, base, GEDR); | 223 | gedr = gpio_reg(&lnw->chip, base, GEDR); |
224 | pending = readl(gedr); | 224 | pending = readl(gedr); |
225 | while (pending) { | 225 | while (pending) { |
226 | gpio = __ffs(pending) - 1; | 226 | gpio = __ffs(pending); |
227 | mask = BIT(gpio); | 227 | mask = BIT(gpio); |
228 | pending &= ~mask; | 228 | pending &= ~mask; |
229 | /* Clear before handling so we can't lose an edge */ | 229 | /* Clear before handling so we can't lose an edge */ |
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 21058e6ad2b8..82db18506662 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -886,9 +886,6 @@ int drm_mode_group_init(struct drm_device *dev, struct drm_mode_group *group) | |||
886 | total_objects += dev->mode_config.num_connector; | 886 | total_objects += dev->mode_config.num_connector; |
887 | total_objects += dev->mode_config.num_encoder; | 887 | total_objects += dev->mode_config.num_encoder; |
888 | 888 | ||
889 | if (total_objects == 0) | ||
890 | return -EINVAL; | ||
891 | |||
892 | group->id_list = kzalloc(total_objects * sizeof(uint32_t), GFP_KERNEL); | 889 | group->id_list = kzalloc(total_objects * sizeof(uint32_t), GFP_KERNEL); |
893 | if (!group->id_list) | 890 | if (!group->id_list) |
894 | return -ENOMEM; | 891 | return -ENOMEM; |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index e1787022d6c8..296fbd66f0e1 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -1943,7 +1943,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
1943 | if (!dev_priv->mm.gtt) { | 1943 | if (!dev_priv->mm.gtt) { |
1944 | DRM_ERROR("Failed to initialize GTT\n"); | 1944 | DRM_ERROR("Failed to initialize GTT\n"); |
1945 | ret = -ENODEV; | 1945 | ret = -ENODEV; |
1946 | goto out_iomapfree; | 1946 | goto out_rmmap; |
1947 | } | 1947 | } |
1948 | 1948 | ||
1949 | agp_size = dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT; | 1949 | agp_size = dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT; |
@@ -1987,7 +1987,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
1987 | if (dev_priv->wq == NULL) { | 1987 | if (dev_priv->wq == NULL) { |
1988 | DRM_ERROR("Failed to create our workqueue.\n"); | 1988 | DRM_ERROR("Failed to create our workqueue.\n"); |
1989 | ret = -ENOMEM; | 1989 | ret = -ENOMEM; |
1990 | goto out_iomapfree; | 1990 | goto out_mtrrfree; |
1991 | } | 1991 | } |
1992 | 1992 | ||
1993 | /* enable GEM by default */ | 1993 | /* enable GEM by default */ |
@@ -2074,13 +2074,21 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
2074 | return 0; | 2074 | return 0; |
2075 | 2075 | ||
2076 | out_gem_unload: | 2076 | out_gem_unload: |
2077 | if (dev_priv->mm.inactive_shrinker.shrink) | ||
2078 | unregister_shrinker(&dev_priv->mm.inactive_shrinker); | ||
2079 | |||
2077 | if (dev->pdev->msi_enabled) | 2080 | if (dev->pdev->msi_enabled) |
2078 | pci_disable_msi(dev->pdev); | 2081 | pci_disable_msi(dev->pdev); |
2079 | 2082 | ||
2080 | intel_teardown_gmbus(dev); | 2083 | intel_teardown_gmbus(dev); |
2081 | intel_teardown_mchbar(dev); | 2084 | intel_teardown_mchbar(dev); |
2082 | destroy_workqueue(dev_priv->wq); | 2085 | destroy_workqueue(dev_priv->wq); |
2083 | out_iomapfree: | 2086 | out_mtrrfree: |
2087 | if (dev_priv->mm.gtt_mtrr >= 0) { | ||
2088 | mtrr_del(dev_priv->mm.gtt_mtrr, dev->agp->base, | ||
2089 | dev->agp->agp_info.aper_size * 1024 * 1024); | ||
2090 | dev_priv->mm.gtt_mtrr = -1; | ||
2091 | } | ||
2084 | io_mapping_free(dev_priv->mm.gtt_mapping); | 2092 | io_mapping_free(dev_priv->mm.gtt_mapping); |
2085 | out_rmmap: | 2093 | out_rmmap: |
2086 | pci_iounmap(dev->pdev, dev_priv->regs); | 2094 | pci_iounmap(dev->pdev, dev_priv->regs); |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 013d304455b9..eb91e2dd7914 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -52,7 +52,7 @@ module_param_named(powersave, i915_powersave, int, 0600); | |||
52 | unsigned int i915_semaphores = 0; | 52 | unsigned int i915_semaphores = 0; |
53 | module_param_named(semaphores, i915_semaphores, int, 0600); | 53 | module_param_named(semaphores, i915_semaphores, int, 0600); |
54 | 54 | ||
55 | unsigned int i915_enable_rc6 = 1; | 55 | unsigned int i915_enable_rc6 = 0; |
56 | module_param_named(i915_enable_rc6, i915_enable_rc6, int, 0600); | 56 | module_param_named(i915_enable_rc6, i915_enable_rc6, int, 0600); |
57 | 57 | ||
58 | unsigned int i915_enable_fbc = 0; | 58 | unsigned int i915_enable_fbc = 0; |
@@ -577,6 +577,7 @@ int i915_reset(struct drm_device *dev, u8 flags) | |||
577 | if (get_seconds() - dev_priv->last_gpu_reset < 5) { | 577 | if (get_seconds() - dev_priv->last_gpu_reset < 5) { |
578 | DRM_ERROR("GPU hanging too fast, declaring wedged!\n"); | 578 | DRM_ERROR("GPU hanging too fast, declaring wedged!\n"); |
579 | } else switch (INTEL_INFO(dev)->gen) { | 579 | } else switch (INTEL_INFO(dev)->gen) { |
580 | case 7: | ||
580 | case 6: | 581 | case 6: |
581 | ret = gen6_do_reset(dev, flags); | 582 | ret = gen6_do_reset(dev, flags); |
582 | /* If reset with a user forcewake, try to restore */ | 583 | /* If reset with a user forcewake, try to restore */ |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 391b55f1cc74..e2aced6eec4c 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -50,7 +50,6 @@ struct intel_dp { | |||
50 | bool has_audio; | 50 | bool has_audio; |
51 | int force_audio; | 51 | int force_audio; |
52 | uint32_t color_range; | 52 | uint32_t color_range; |
53 | int dpms_mode; | ||
54 | uint8_t link_bw; | 53 | uint8_t link_bw; |
55 | uint8_t lane_count; | 54 | uint8_t lane_count; |
56 | uint8_t dpcd[4]; | 55 | uint8_t dpcd[4]; |
@@ -138,8 +137,8 @@ intel_dp_max_lane_count(struct intel_dp *intel_dp) | |||
138 | { | 137 | { |
139 | int max_lane_count = 4; | 138 | int max_lane_count = 4; |
140 | 139 | ||
141 | if (intel_dp->dpcd[0] >= 0x11) { | 140 | if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11) { |
142 | max_lane_count = intel_dp->dpcd[2] & 0x1f; | 141 | max_lane_count = intel_dp->dpcd[DP_MAX_LANE_COUNT] & 0x1f; |
143 | switch (max_lane_count) { | 142 | switch (max_lane_count) { |
144 | case 1: case 2: case 4: | 143 | case 1: case 2: case 4: |
145 | break; | 144 | break; |
@@ -153,7 +152,7 @@ intel_dp_max_lane_count(struct intel_dp *intel_dp) | |||
153 | static int | 152 | static int |
154 | intel_dp_max_link_bw(struct intel_dp *intel_dp) | 153 | intel_dp_max_link_bw(struct intel_dp *intel_dp) |
155 | { | 154 | { |
156 | int max_link_bw = intel_dp->dpcd[1]; | 155 | int max_link_bw = intel_dp->dpcd[DP_MAX_LINK_RATE]; |
157 | 156 | ||
158 | switch (max_link_bw) { | 157 | switch (max_link_bw) { |
159 | case DP_LINK_BW_1_62: | 158 | case DP_LINK_BW_1_62: |
@@ -774,7 +773,8 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
774 | /* | 773 | /* |
775 | * Check for DPCD version > 1.1 and enhanced framing support | 774 | * Check for DPCD version > 1.1 and enhanced framing support |
776 | */ | 775 | */ |
777 | if (intel_dp->dpcd[0] >= 0x11 && (intel_dp->dpcd[2] & DP_ENHANCED_FRAME_CAP)) { | 776 | if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 && |
777 | (intel_dp->dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP)) { | ||
778 | intel_dp->link_configuration[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN; | 778 | intel_dp->link_configuration[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN; |
779 | intel_dp->DP |= DP_ENHANCED_FRAMING; | 779 | intel_dp->DP |= DP_ENHANCED_FRAMING; |
780 | } | 780 | } |
@@ -942,11 +942,44 @@ static void ironlake_edp_pll_off(struct drm_encoder *encoder) | |||
942 | udelay(200); | 942 | udelay(200); |
943 | } | 943 | } |
944 | 944 | ||
945 | /* If the sink supports it, try to set the power state appropriately */ | ||
946 | static void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode) | ||
947 | { | ||
948 | int ret, i; | ||
949 | |||
950 | /* Should have a valid DPCD by this point */ | ||
951 | if (intel_dp->dpcd[DP_DPCD_REV] < 0x11) | ||
952 | return; | ||
953 | |||
954 | if (mode != DRM_MODE_DPMS_ON) { | ||
955 | ret = intel_dp_aux_native_write_1(intel_dp, DP_SET_POWER, | ||
956 | DP_SET_POWER_D3); | ||
957 | if (ret != 1) | ||
958 | DRM_DEBUG_DRIVER("failed to write sink power state\n"); | ||
959 | } else { | ||
960 | /* | ||
961 | * When turning on, we need to retry for 1ms to give the sink | ||
962 | * time to wake up. | ||
963 | */ | ||
964 | for (i = 0; i < 3; i++) { | ||
965 | ret = intel_dp_aux_native_write_1(intel_dp, | ||
966 | DP_SET_POWER, | ||
967 | DP_SET_POWER_D0); | ||
968 | if (ret == 1) | ||
969 | break; | ||
970 | msleep(1); | ||
971 | } | ||
972 | } | ||
973 | } | ||
974 | |||
945 | static void intel_dp_prepare(struct drm_encoder *encoder) | 975 | static void intel_dp_prepare(struct drm_encoder *encoder) |
946 | { | 976 | { |
947 | struct intel_dp *intel_dp = enc_to_intel_dp(encoder); | 977 | struct intel_dp *intel_dp = enc_to_intel_dp(encoder); |
948 | struct drm_device *dev = encoder->dev; | 978 | struct drm_device *dev = encoder->dev; |
949 | 979 | ||
980 | /* Wake up the sink first */ | ||
981 | intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); | ||
982 | |||
950 | if (is_edp(intel_dp)) { | 983 | if (is_edp(intel_dp)) { |
951 | ironlake_edp_backlight_off(dev); | 984 | ironlake_edp_backlight_off(dev); |
952 | ironlake_edp_panel_off(dev); | 985 | ironlake_edp_panel_off(dev); |
@@ -990,6 +1023,7 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode) | |||
990 | if (mode != DRM_MODE_DPMS_ON) { | 1023 | if (mode != DRM_MODE_DPMS_ON) { |
991 | if (is_edp(intel_dp)) | 1024 | if (is_edp(intel_dp)) |
992 | ironlake_edp_backlight_off(dev); | 1025 | ironlake_edp_backlight_off(dev); |
1026 | intel_dp_sink_dpms(intel_dp, mode); | ||
993 | intel_dp_link_down(intel_dp); | 1027 | intel_dp_link_down(intel_dp); |
994 | if (is_edp(intel_dp)) | 1028 | if (is_edp(intel_dp)) |
995 | ironlake_edp_panel_off(dev); | 1029 | ironlake_edp_panel_off(dev); |
@@ -998,6 +1032,7 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode) | |||
998 | } else { | 1032 | } else { |
999 | if (is_edp(intel_dp)) | 1033 | if (is_edp(intel_dp)) |
1000 | ironlake_edp_panel_vdd_on(intel_dp); | 1034 | ironlake_edp_panel_vdd_on(intel_dp); |
1035 | intel_dp_sink_dpms(intel_dp, mode); | ||
1001 | if (!(dp_reg & DP_PORT_EN)) { | 1036 | if (!(dp_reg & DP_PORT_EN)) { |
1002 | intel_dp_start_link_train(intel_dp); | 1037 | intel_dp_start_link_train(intel_dp); |
1003 | if (is_edp(intel_dp)) { | 1038 | if (is_edp(intel_dp)) { |
@@ -1009,7 +1044,31 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode) | |||
1009 | if (is_edp(intel_dp)) | 1044 | if (is_edp(intel_dp)) |
1010 | ironlake_edp_backlight_on(dev); | 1045 | ironlake_edp_backlight_on(dev); |
1011 | } | 1046 | } |
1012 | intel_dp->dpms_mode = mode; | 1047 | } |
1048 | |||
1049 | /* | ||
1050 | * Native read with retry for link status and receiver capability reads for | ||
1051 | * cases where the sink may still be asleep. | ||
1052 | */ | ||
1053 | static bool | ||
1054 | intel_dp_aux_native_read_retry(struct intel_dp *intel_dp, uint16_t address, | ||
1055 | uint8_t *recv, int recv_bytes) | ||
1056 | { | ||
1057 | int ret, i; | ||
1058 | |||
1059 | /* | ||
1060 | * Sinks are *supposed* to come up within 1ms from an off state, | ||
1061 | * but we're also supposed to retry 3 times per the spec. | ||
1062 | */ | ||
1063 | for (i = 0; i < 3; i++) { | ||
1064 | ret = intel_dp_aux_native_read(intel_dp, address, recv, | ||
1065 | recv_bytes); | ||
1066 | if (ret == recv_bytes) | ||
1067 | return true; | ||
1068 | msleep(1); | ||
1069 | } | ||
1070 | |||
1071 | return false; | ||
1013 | } | 1072 | } |
1014 | 1073 | ||
1015 | /* | 1074 | /* |
@@ -1019,14 +1078,10 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode) | |||
1019 | static bool | 1078 | static bool |
1020 | intel_dp_get_link_status(struct intel_dp *intel_dp) | 1079 | intel_dp_get_link_status(struct intel_dp *intel_dp) |
1021 | { | 1080 | { |
1022 | int ret; | 1081 | return intel_dp_aux_native_read_retry(intel_dp, |
1023 | 1082 | DP_LANE0_1_STATUS, | |
1024 | ret = intel_dp_aux_native_read(intel_dp, | 1083 | intel_dp->link_status, |
1025 | DP_LANE0_1_STATUS, | 1084 | DP_LINK_STATUS_SIZE); |
1026 | intel_dp->link_status, DP_LINK_STATUS_SIZE); | ||
1027 | if (ret != DP_LINK_STATUS_SIZE) | ||
1028 | return false; | ||
1029 | return true; | ||
1030 | } | 1085 | } |
1031 | 1086 | ||
1032 | static uint8_t | 1087 | static uint8_t |
@@ -1515,6 +1570,8 @@ intel_dp_link_down(struct intel_dp *intel_dp) | |||
1515 | static void | 1570 | static void |
1516 | intel_dp_check_link_status(struct intel_dp *intel_dp) | 1571 | intel_dp_check_link_status(struct intel_dp *intel_dp) |
1517 | { | 1572 | { |
1573 | int ret; | ||
1574 | |||
1518 | if (!intel_dp->base.base.crtc) | 1575 | if (!intel_dp->base.base.crtc) |
1519 | return; | 1576 | return; |
1520 | 1577 | ||
@@ -1523,6 +1580,15 @@ intel_dp_check_link_status(struct intel_dp *intel_dp) | |||
1523 | return; | 1580 | return; |
1524 | } | 1581 | } |
1525 | 1582 | ||
1583 | /* Try to read receiver status if the link appears to be up */ | ||
1584 | ret = intel_dp_aux_native_read(intel_dp, | ||
1585 | 0x000, intel_dp->dpcd, | ||
1586 | sizeof (intel_dp->dpcd)); | ||
1587 | if (ret != sizeof(intel_dp->dpcd)) { | ||
1588 | intel_dp_link_down(intel_dp); | ||
1589 | return; | ||
1590 | } | ||
1591 | |||
1526 | if (!intel_channel_eq_ok(intel_dp)) { | 1592 | if (!intel_channel_eq_ok(intel_dp)) { |
1527 | intel_dp_start_link_train(intel_dp); | 1593 | intel_dp_start_link_train(intel_dp); |
1528 | intel_dp_complete_link_train(intel_dp); | 1594 | intel_dp_complete_link_train(intel_dp); |
@@ -1533,6 +1599,7 @@ static enum drm_connector_status | |||
1533 | ironlake_dp_detect(struct intel_dp *intel_dp) | 1599 | ironlake_dp_detect(struct intel_dp *intel_dp) |
1534 | { | 1600 | { |
1535 | enum drm_connector_status status; | 1601 | enum drm_connector_status status; |
1602 | bool ret; | ||
1536 | 1603 | ||
1537 | /* Can't disconnect eDP, but you can close the lid... */ | 1604 | /* Can't disconnect eDP, but you can close the lid... */ |
1538 | if (is_edp(intel_dp)) { | 1605 | if (is_edp(intel_dp)) { |
@@ -1543,13 +1610,11 @@ ironlake_dp_detect(struct intel_dp *intel_dp) | |||
1543 | } | 1610 | } |
1544 | 1611 | ||
1545 | status = connector_status_disconnected; | 1612 | status = connector_status_disconnected; |
1546 | if (intel_dp_aux_native_read(intel_dp, | 1613 | ret = intel_dp_aux_native_read_retry(intel_dp, |
1547 | 0x000, intel_dp->dpcd, | 1614 | 0x000, intel_dp->dpcd, |
1548 | sizeof (intel_dp->dpcd)) | 1615 | sizeof (intel_dp->dpcd)); |
1549 | == sizeof(intel_dp->dpcd)) { | 1616 | if (ret && intel_dp->dpcd[DP_DPCD_REV] != 0) |
1550 | if (intel_dp->dpcd[0] != 0) | 1617 | status = connector_status_connected; |
1551 | status = connector_status_connected; | ||
1552 | } | ||
1553 | DRM_DEBUG_KMS("DPCD: %hx%hx%hx%hx\n", intel_dp->dpcd[0], | 1618 | DRM_DEBUG_KMS("DPCD: %hx%hx%hx%hx\n", intel_dp->dpcd[0], |
1554 | intel_dp->dpcd[1], intel_dp->dpcd[2], intel_dp->dpcd[3]); | 1619 | intel_dp->dpcd[1], intel_dp->dpcd[2], intel_dp->dpcd[3]); |
1555 | return status; | 1620 | return status; |
@@ -1586,7 +1651,7 @@ g4x_dp_detect(struct intel_dp *intel_dp) | |||
1586 | if (intel_dp_aux_native_read(intel_dp, 0x000, intel_dp->dpcd, | 1651 | if (intel_dp_aux_native_read(intel_dp, 0x000, intel_dp->dpcd, |
1587 | sizeof (intel_dp->dpcd)) == sizeof (intel_dp->dpcd)) | 1652 | sizeof (intel_dp->dpcd)) == sizeof (intel_dp->dpcd)) |
1588 | { | 1653 | { |
1589 | if (intel_dp->dpcd[0] != 0) | 1654 | if (intel_dp->dpcd[DP_DPCD_REV] != 0) |
1590 | status = connector_status_connected; | 1655 | status = connector_status_connected; |
1591 | } | 1656 | } |
1592 | 1657 | ||
@@ -1790,8 +1855,7 @@ intel_dp_hot_plug(struct intel_encoder *intel_encoder) | |||
1790 | { | 1855 | { |
1791 | struct intel_dp *intel_dp = container_of(intel_encoder, struct intel_dp, base); | 1856 | struct intel_dp *intel_dp = container_of(intel_encoder, struct intel_dp, base); |
1792 | 1857 | ||
1793 | if (intel_dp->dpms_mode == DRM_MODE_DPMS_ON) | 1858 | intel_dp_check_link_status(intel_dp); |
1794 | intel_dp_check_link_status(intel_dp); | ||
1795 | } | 1859 | } |
1796 | 1860 | ||
1797 | /* Return which DP Port should be selected for Transcoder DP control */ | 1861 | /* Return which DP Port should be selected for Transcoder DP control */ |
@@ -1859,7 +1923,6 @@ intel_dp_init(struct drm_device *dev, int output_reg) | |||
1859 | return; | 1923 | return; |
1860 | 1924 | ||
1861 | intel_dp->output_reg = output_reg; | 1925 | intel_dp->output_reg = output_reg; |
1862 | intel_dp->dpms_mode = -1; | ||
1863 | 1926 | ||
1864 | intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); | 1927 | intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); |
1865 | if (!intel_connector) { | 1928 | if (!intel_connector) { |
@@ -1954,8 +2017,9 @@ intel_dp_init(struct drm_device *dev, int output_reg) | |||
1954 | sizeof(intel_dp->dpcd)); | 2017 | sizeof(intel_dp->dpcd)); |
1955 | ironlake_edp_panel_vdd_off(intel_dp); | 2018 | ironlake_edp_panel_vdd_off(intel_dp); |
1956 | if (ret == sizeof(intel_dp->dpcd)) { | 2019 | if (ret == sizeof(intel_dp->dpcd)) { |
1957 | if (intel_dp->dpcd[0] >= 0x11) | 2020 | if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11) |
1958 | dev_priv->no_aux_handshake = intel_dp->dpcd[3] & | 2021 | dev_priv->no_aux_handshake = |
2022 | intel_dp->dpcd[DP_MAX_DOWNSPREAD] & | ||
1959 | DP_NO_AUX_HANDSHAKE_LINK_TRAINING; | 2023 | DP_NO_AUX_HANDSHAKE_LINK_TRAINING; |
1960 | } else { | 2024 | } else { |
1961 | /* if this fails, presume the device is a ghost */ | 2025 | /* if this fails, presume the device is a ghost */ |
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h index c0e0ee63fbf4..39ac2b634ae5 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.h +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h | |||
@@ -165,7 +165,7 @@ void intel_cleanup_ring_buffer(struct intel_ring_buffer *ring); | |||
165 | int __must_check intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n); | 165 | int __must_check intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n); |
166 | static inline int intel_wait_ring_idle(struct intel_ring_buffer *ring) | 166 | static inline int intel_wait_ring_idle(struct intel_ring_buffer *ring) |
167 | { | 167 | { |
168 | return intel_wait_ring_buffer(ring, ring->space - 8); | 168 | return intel_wait_ring_buffer(ring, ring->size - 8); |
169 | } | 169 | } |
170 | 170 | ||
171 | int __must_check intel_ring_begin(struct intel_ring_buffer *ring, int n); | 171 | int __must_check intel_ring_begin(struct intel_ring_buffer *ring, int n); |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index e8a5ffb0124d..660f96401a05 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -985,17 +985,19 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav | |||
985 | { | 985 | { |
986 | save->vga_control[0] = RREG32(D1VGA_CONTROL); | 986 | save->vga_control[0] = RREG32(D1VGA_CONTROL); |
987 | save->vga_control[1] = RREG32(D2VGA_CONTROL); | 987 | save->vga_control[1] = RREG32(D2VGA_CONTROL); |
988 | save->vga_control[2] = RREG32(EVERGREEN_D3VGA_CONTROL); | ||
989 | save->vga_control[3] = RREG32(EVERGREEN_D4VGA_CONTROL); | ||
990 | save->vga_control[4] = RREG32(EVERGREEN_D5VGA_CONTROL); | ||
991 | save->vga_control[5] = RREG32(EVERGREEN_D6VGA_CONTROL); | ||
992 | save->vga_render_control = RREG32(VGA_RENDER_CONTROL); | 988 | save->vga_render_control = RREG32(VGA_RENDER_CONTROL); |
993 | save->vga_hdp_control = RREG32(VGA_HDP_CONTROL); | 989 | save->vga_hdp_control = RREG32(VGA_HDP_CONTROL); |
994 | save->crtc_control[0] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET); | 990 | save->crtc_control[0] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET); |
995 | save->crtc_control[1] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET); | 991 | save->crtc_control[1] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET); |
996 | if (!(rdev->flags & RADEON_IS_IGP)) { | 992 | if (rdev->num_crtc >= 4) { |
993 | save->vga_control[2] = RREG32(EVERGREEN_D3VGA_CONTROL); | ||
994 | save->vga_control[3] = RREG32(EVERGREEN_D4VGA_CONTROL); | ||
997 | save->crtc_control[2] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET); | 995 | save->crtc_control[2] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET); |
998 | save->crtc_control[3] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET); | 996 | save->crtc_control[3] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET); |
997 | } | ||
998 | if (rdev->num_crtc >= 6) { | ||
999 | save->vga_control[4] = RREG32(EVERGREEN_D5VGA_CONTROL); | ||
1000 | save->vga_control[5] = RREG32(EVERGREEN_D6VGA_CONTROL); | ||
999 | save->crtc_control[4] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET); | 1001 | save->crtc_control[4] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET); |
1000 | save->crtc_control[5] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET); | 1002 | save->crtc_control[5] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET); |
1001 | } | 1003 | } |
@@ -1004,35 +1006,45 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav | |||
1004 | WREG32(VGA_RENDER_CONTROL, 0); | 1006 | WREG32(VGA_RENDER_CONTROL, 0); |
1005 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 1); | 1007 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 1); |
1006 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 1); | 1008 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 1); |
1007 | if (!(rdev->flags & RADEON_IS_IGP)) { | 1009 | if (rdev->num_crtc >= 4) { |
1008 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET, 1); | 1010 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET, 1); |
1009 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET, 1); | 1011 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET, 1); |
1012 | } | ||
1013 | if (rdev->num_crtc >= 6) { | ||
1010 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET, 1); | 1014 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET, 1); |
1011 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET, 1); | 1015 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET, 1); |
1012 | } | 1016 | } |
1013 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, 0); | 1017 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, 0); |
1014 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, 0); | 1018 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, 0); |
1015 | if (!(rdev->flags & RADEON_IS_IGP)) { | 1019 | if (rdev->num_crtc >= 4) { |
1016 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, 0); | 1020 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, 0); |
1017 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, 0); | 1021 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, 0); |
1022 | } | ||
1023 | if (rdev->num_crtc >= 6) { | ||
1018 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, 0); | 1024 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, 0); |
1019 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, 0); | 1025 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, 0); |
1020 | } | 1026 | } |
1021 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 0); | 1027 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 0); |
1022 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 0); | 1028 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 0); |
1023 | if (!(rdev->flags & RADEON_IS_IGP)) { | 1029 | if (rdev->num_crtc >= 4) { |
1024 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET, 0); | 1030 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET, 0); |
1025 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET, 0); | 1031 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET, 0); |
1032 | } | ||
1033 | if (rdev->num_crtc >= 6) { | ||
1026 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET, 0); | 1034 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET, 0); |
1027 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET, 0); | 1035 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET, 0); |
1028 | } | 1036 | } |
1029 | 1037 | ||
1030 | WREG32(D1VGA_CONTROL, 0); | 1038 | WREG32(D1VGA_CONTROL, 0); |
1031 | WREG32(D2VGA_CONTROL, 0); | 1039 | WREG32(D2VGA_CONTROL, 0); |
1032 | WREG32(EVERGREEN_D3VGA_CONTROL, 0); | 1040 | if (rdev->num_crtc >= 4) { |
1033 | WREG32(EVERGREEN_D4VGA_CONTROL, 0); | 1041 | WREG32(EVERGREEN_D3VGA_CONTROL, 0); |
1034 | WREG32(EVERGREEN_D5VGA_CONTROL, 0); | 1042 | WREG32(EVERGREEN_D4VGA_CONTROL, 0); |
1035 | WREG32(EVERGREEN_D6VGA_CONTROL, 0); | 1043 | } |
1044 | if (rdev->num_crtc >= 6) { | ||
1045 | WREG32(EVERGREEN_D5VGA_CONTROL, 0); | ||
1046 | WREG32(EVERGREEN_D6VGA_CONTROL, 0); | ||
1047 | } | ||
1036 | } | 1048 | } |
1037 | 1049 | ||
1038 | void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *save) | 1050 | void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *save) |
@@ -1055,7 +1067,7 @@ void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *s | |||
1055 | WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS + EVERGREEN_CRTC1_REGISTER_OFFSET, | 1067 | WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS + EVERGREEN_CRTC1_REGISTER_OFFSET, |
1056 | (u32)rdev->mc.vram_start); | 1068 | (u32)rdev->mc.vram_start); |
1057 | 1069 | ||
1058 | if (!(rdev->flags & RADEON_IS_IGP)) { | 1070 | if (rdev->num_crtc >= 4) { |
1059 | WREG32(EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS_HIGH + EVERGREEN_CRTC2_REGISTER_OFFSET, | 1071 | WREG32(EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS_HIGH + EVERGREEN_CRTC2_REGISTER_OFFSET, |
1060 | upper_32_bits(rdev->mc.vram_start)); | 1072 | upper_32_bits(rdev->mc.vram_start)); |
1061 | WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS_HIGH + EVERGREEN_CRTC2_REGISTER_OFFSET, | 1073 | WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS_HIGH + EVERGREEN_CRTC2_REGISTER_OFFSET, |
@@ -1073,7 +1085,8 @@ void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *s | |||
1073 | (u32)rdev->mc.vram_start); | 1085 | (u32)rdev->mc.vram_start); |
1074 | WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS + EVERGREEN_CRTC3_REGISTER_OFFSET, | 1086 | WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS + EVERGREEN_CRTC3_REGISTER_OFFSET, |
1075 | (u32)rdev->mc.vram_start); | 1087 | (u32)rdev->mc.vram_start); |
1076 | 1088 | } | |
1089 | if (rdev->num_crtc >= 6) { | ||
1077 | WREG32(EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS_HIGH + EVERGREEN_CRTC4_REGISTER_OFFSET, | 1090 | WREG32(EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS_HIGH + EVERGREEN_CRTC4_REGISTER_OFFSET, |
1078 | upper_32_bits(rdev->mc.vram_start)); | 1091 | upper_32_bits(rdev->mc.vram_start)); |
1079 | WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS_HIGH + EVERGREEN_CRTC4_REGISTER_OFFSET, | 1092 | WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS_HIGH + EVERGREEN_CRTC4_REGISTER_OFFSET, |
@@ -1101,31 +1114,41 @@ void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *s | |||
1101 | /* Restore video state */ | 1114 | /* Restore video state */ |
1102 | WREG32(D1VGA_CONTROL, save->vga_control[0]); | 1115 | WREG32(D1VGA_CONTROL, save->vga_control[0]); |
1103 | WREG32(D2VGA_CONTROL, save->vga_control[1]); | 1116 | WREG32(D2VGA_CONTROL, save->vga_control[1]); |
1104 | WREG32(EVERGREEN_D3VGA_CONTROL, save->vga_control[2]); | 1117 | if (rdev->num_crtc >= 4) { |
1105 | WREG32(EVERGREEN_D4VGA_CONTROL, save->vga_control[3]); | 1118 | WREG32(EVERGREEN_D3VGA_CONTROL, save->vga_control[2]); |
1106 | WREG32(EVERGREEN_D5VGA_CONTROL, save->vga_control[4]); | 1119 | WREG32(EVERGREEN_D4VGA_CONTROL, save->vga_control[3]); |
1107 | WREG32(EVERGREEN_D6VGA_CONTROL, save->vga_control[5]); | 1120 | } |
1121 | if (rdev->num_crtc >= 6) { | ||
1122 | WREG32(EVERGREEN_D5VGA_CONTROL, save->vga_control[4]); | ||
1123 | WREG32(EVERGREEN_D6VGA_CONTROL, save->vga_control[5]); | ||
1124 | } | ||
1108 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 1); | 1125 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 1); |
1109 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 1); | 1126 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 1); |
1110 | if (!(rdev->flags & RADEON_IS_IGP)) { | 1127 | if (rdev->num_crtc >= 4) { |
1111 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET, 1); | 1128 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET, 1); |
1112 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET, 1); | 1129 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET, 1); |
1130 | } | ||
1131 | if (rdev->num_crtc >= 6) { | ||
1113 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET, 1); | 1132 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET, 1); |
1114 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET, 1); | 1133 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET, 1); |
1115 | } | 1134 | } |
1116 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, save->crtc_control[0]); | 1135 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, save->crtc_control[0]); |
1117 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, save->crtc_control[1]); | 1136 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, save->crtc_control[1]); |
1118 | if (!(rdev->flags & RADEON_IS_IGP)) { | 1137 | if (rdev->num_crtc >= 4) { |
1119 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, save->crtc_control[2]); | 1138 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, save->crtc_control[2]); |
1120 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, save->crtc_control[3]); | 1139 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, save->crtc_control[3]); |
1140 | } | ||
1141 | if (rdev->num_crtc >= 6) { | ||
1121 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, save->crtc_control[4]); | 1142 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, save->crtc_control[4]); |
1122 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, save->crtc_control[5]); | 1143 | WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, save->crtc_control[5]); |
1123 | } | 1144 | } |
1124 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 0); | 1145 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 0); |
1125 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 0); | 1146 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 0); |
1126 | if (!(rdev->flags & RADEON_IS_IGP)) { | 1147 | if (rdev->num_crtc >= 4) { |
1127 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET, 0); | 1148 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET, 0); |
1128 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET, 0); | 1149 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET, 0); |
1150 | } | ||
1151 | if (rdev->num_crtc >= 6) { | ||
1129 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET, 0); | 1152 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET, 0); |
1130 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET, 0); | 1153 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET, 0); |
1131 | } | 1154 | } |
@@ -2417,18 +2440,22 @@ void evergreen_disable_interrupt_state(struct radeon_device *rdev) | |||
2417 | WREG32(GRBM_INT_CNTL, 0); | 2440 | WREG32(GRBM_INT_CNTL, 0); |
2418 | WREG32(INT_MASK + EVERGREEN_CRTC0_REGISTER_OFFSET, 0); | 2441 | WREG32(INT_MASK + EVERGREEN_CRTC0_REGISTER_OFFSET, 0); |
2419 | WREG32(INT_MASK + EVERGREEN_CRTC1_REGISTER_OFFSET, 0); | 2442 | WREG32(INT_MASK + EVERGREEN_CRTC1_REGISTER_OFFSET, 0); |
2420 | if (!(rdev->flags & RADEON_IS_IGP)) { | 2443 | if (rdev->num_crtc >= 4) { |
2421 | WREG32(INT_MASK + EVERGREEN_CRTC2_REGISTER_OFFSET, 0); | 2444 | WREG32(INT_MASK + EVERGREEN_CRTC2_REGISTER_OFFSET, 0); |
2422 | WREG32(INT_MASK + EVERGREEN_CRTC3_REGISTER_OFFSET, 0); | 2445 | WREG32(INT_MASK + EVERGREEN_CRTC3_REGISTER_OFFSET, 0); |
2446 | } | ||
2447 | if (rdev->num_crtc >= 6) { | ||
2423 | WREG32(INT_MASK + EVERGREEN_CRTC4_REGISTER_OFFSET, 0); | 2448 | WREG32(INT_MASK + EVERGREEN_CRTC4_REGISTER_OFFSET, 0); |
2424 | WREG32(INT_MASK + EVERGREEN_CRTC5_REGISTER_OFFSET, 0); | 2449 | WREG32(INT_MASK + EVERGREEN_CRTC5_REGISTER_OFFSET, 0); |
2425 | } | 2450 | } |
2426 | 2451 | ||
2427 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, 0); | 2452 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, 0); |
2428 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, 0); | 2453 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, 0); |
2429 | if (!(rdev->flags & RADEON_IS_IGP)) { | 2454 | if (rdev->num_crtc >= 4) { |
2430 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, 0); | 2455 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, 0); |
2431 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, 0); | 2456 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, 0); |
2457 | } | ||
2458 | if (rdev->num_crtc >= 6) { | ||
2432 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, 0); | 2459 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, 0); |
2433 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, 0); | 2460 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, 0); |
2434 | } | 2461 | } |
@@ -2547,19 +2574,25 @@ int evergreen_irq_set(struct radeon_device *rdev) | |||
2547 | 2574 | ||
2548 | WREG32(INT_MASK + EVERGREEN_CRTC0_REGISTER_OFFSET, crtc1); | 2575 | WREG32(INT_MASK + EVERGREEN_CRTC0_REGISTER_OFFSET, crtc1); |
2549 | WREG32(INT_MASK + EVERGREEN_CRTC1_REGISTER_OFFSET, crtc2); | 2576 | WREG32(INT_MASK + EVERGREEN_CRTC1_REGISTER_OFFSET, crtc2); |
2550 | if (!(rdev->flags & RADEON_IS_IGP)) { | 2577 | if (rdev->num_crtc >= 4) { |
2551 | WREG32(INT_MASK + EVERGREEN_CRTC2_REGISTER_OFFSET, crtc3); | 2578 | WREG32(INT_MASK + EVERGREEN_CRTC2_REGISTER_OFFSET, crtc3); |
2552 | WREG32(INT_MASK + EVERGREEN_CRTC3_REGISTER_OFFSET, crtc4); | 2579 | WREG32(INT_MASK + EVERGREEN_CRTC3_REGISTER_OFFSET, crtc4); |
2580 | } | ||
2581 | if (rdev->num_crtc >= 6) { | ||
2553 | WREG32(INT_MASK + EVERGREEN_CRTC4_REGISTER_OFFSET, crtc5); | 2582 | WREG32(INT_MASK + EVERGREEN_CRTC4_REGISTER_OFFSET, crtc5); |
2554 | WREG32(INT_MASK + EVERGREEN_CRTC5_REGISTER_OFFSET, crtc6); | 2583 | WREG32(INT_MASK + EVERGREEN_CRTC5_REGISTER_OFFSET, crtc6); |
2555 | } | 2584 | } |
2556 | 2585 | ||
2557 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, grph1); | 2586 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, grph1); |
2558 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, grph2); | 2587 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, grph2); |
2559 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, grph3); | 2588 | if (rdev->num_crtc >= 4) { |
2560 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, grph4); | 2589 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, grph3); |
2561 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, grph5); | 2590 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, grph4); |
2562 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, grph6); | 2591 | } |
2592 | if (rdev->num_crtc >= 6) { | ||
2593 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, grph5); | ||
2594 | WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, grph6); | ||
2595 | } | ||
2563 | 2596 | ||
2564 | WREG32(DC_HPD1_INT_CONTROL, hpd1); | 2597 | WREG32(DC_HPD1_INT_CONTROL, hpd1); |
2565 | WREG32(DC_HPD2_INT_CONTROL, hpd2); | 2598 | WREG32(DC_HPD2_INT_CONTROL, hpd2); |
@@ -2583,53 +2616,57 @@ static inline void evergreen_irq_ack(struct radeon_device *rdev) | |||
2583 | rdev->irq.stat_regs.evergreen.disp_int_cont5 = RREG32(DISP_INTERRUPT_STATUS_CONTINUE5); | 2616 | rdev->irq.stat_regs.evergreen.disp_int_cont5 = RREG32(DISP_INTERRUPT_STATUS_CONTINUE5); |
2584 | rdev->irq.stat_regs.evergreen.d1grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC0_REGISTER_OFFSET); | 2617 | rdev->irq.stat_regs.evergreen.d1grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC0_REGISTER_OFFSET); |
2585 | rdev->irq.stat_regs.evergreen.d2grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC1_REGISTER_OFFSET); | 2618 | rdev->irq.stat_regs.evergreen.d2grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC1_REGISTER_OFFSET); |
2586 | rdev->irq.stat_regs.evergreen.d3grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET); | 2619 | if (rdev->num_crtc >= 4) { |
2587 | rdev->irq.stat_regs.evergreen.d4grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC3_REGISTER_OFFSET); | 2620 | rdev->irq.stat_regs.evergreen.d3grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET); |
2588 | rdev->irq.stat_regs.evergreen.d5grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET); | 2621 | rdev->irq.stat_regs.evergreen.d4grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC3_REGISTER_OFFSET); |
2589 | rdev->irq.stat_regs.evergreen.d6grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC5_REGISTER_OFFSET); | 2622 | } |
2623 | if (rdev->num_crtc >= 6) { | ||
2624 | rdev->irq.stat_regs.evergreen.d5grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET); | ||
2625 | rdev->irq.stat_regs.evergreen.d6grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC5_REGISTER_OFFSET); | ||
2626 | } | ||
2590 | 2627 | ||
2591 | if (rdev->irq.stat_regs.evergreen.d1grph_int & GRPH_PFLIP_INT_OCCURRED) | 2628 | if (rdev->irq.stat_regs.evergreen.d1grph_int & GRPH_PFLIP_INT_OCCURRED) |
2592 | WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC0_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR); | 2629 | WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC0_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR); |
2593 | if (rdev->irq.stat_regs.evergreen.d2grph_int & GRPH_PFLIP_INT_OCCURRED) | 2630 | if (rdev->irq.stat_regs.evergreen.d2grph_int & GRPH_PFLIP_INT_OCCURRED) |
2594 | WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC1_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR); | 2631 | WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC1_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR); |
2595 | if (rdev->irq.stat_regs.evergreen.d3grph_int & GRPH_PFLIP_INT_OCCURRED) | ||
2596 | WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR); | ||
2597 | if (rdev->irq.stat_regs.evergreen.d4grph_int & GRPH_PFLIP_INT_OCCURRED) | ||
2598 | WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC3_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR); | ||
2599 | if (rdev->irq.stat_regs.evergreen.d5grph_int & GRPH_PFLIP_INT_OCCURRED) | ||
2600 | WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR); | ||
2601 | if (rdev->irq.stat_regs.evergreen.d6grph_int & GRPH_PFLIP_INT_OCCURRED) | ||
2602 | WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC5_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR); | ||
2603 | |||
2604 | if (rdev->irq.stat_regs.evergreen.disp_int & LB_D1_VBLANK_INTERRUPT) | 2632 | if (rdev->irq.stat_regs.evergreen.disp_int & LB_D1_VBLANK_INTERRUPT) |
2605 | WREG32(VBLANK_STATUS + EVERGREEN_CRTC0_REGISTER_OFFSET, VBLANK_ACK); | 2633 | WREG32(VBLANK_STATUS + EVERGREEN_CRTC0_REGISTER_OFFSET, VBLANK_ACK); |
2606 | if (rdev->irq.stat_regs.evergreen.disp_int & LB_D1_VLINE_INTERRUPT) | 2634 | if (rdev->irq.stat_regs.evergreen.disp_int & LB_D1_VLINE_INTERRUPT) |
2607 | WREG32(VLINE_STATUS + EVERGREEN_CRTC0_REGISTER_OFFSET, VLINE_ACK); | 2635 | WREG32(VLINE_STATUS + EVERGREEN_CRTC0_REGISTER_OFFSET, VLINE_ACK); |
2608 | |||
2609 | if (rdev->irq.stat_regs.evergreen.disp_int_cont & LB_D2_VBLANK_INTERRUPT) | 2636 | if (rdev->irq.stat_regs.evergreen.disp_int_cont & LB_D2_VBLANK_INTERRUPT) |
2610 | WREG32(VBLANK_STATUS + EVERGREEN_CRTC1_REGISTER_OFFSET, VBLANK_ACK); | 2637 | WREG32(VBLANK_STATUS + EVERGREEN_CRTC1_REGISTER_OFFSET, VBLANK_ACK); |
2611 | if (rdev->irq.stat_regs.evergreen.disp_int_cont & LB_D2_VLINE_INTERRUPT) | 2638 | if (rdev->irq.stat_regs.evergreen.disp_int_cont & LB_D2_VLINE_INTERRUPT) |
2612 | WREG32(VLINE_STATUS + EVERGREEN_CRTC1_REGISTER_OFFSET, VLINE_ACK); | 2639 | WREG32(VLINE_STATUS + EVERGREEN_CRTC1_REGISTER_OFFSET, VLINE_ACK); |
2613 | 2640 | ||
2614 | if (rdev->irq.stat_regs.evergreen.disp_int_cont2 & LB_D3_VBLANK_INTERRUPT) | 2641 | if (rdev->num_crtc >= 4) { |
2615 | WREG32(VBLANK_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET, VBLANK_ACK); | 2642 | if (rdev->irq.stat_regs.evergreen.d3grph_int & GRPH_PFLIP_INT_OCCURRED) |
2616 | if (rdev->irq.stat_regs.evergreen.disp_int_cont2 & LB_D3_VLINE_INTERRUPT) | 2643 | WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR); |
2617 | WREG32(VLINE_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET, VLINE_ACK); | 2644 | if (rdev->irq.stat_regs.evergreen.d4grph_int & GRPH_PFLIP_INT_OCCURRED) |
2618 | 2645 | WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC3_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR); | |
2619 | if (rdev->irq.stat_regs.evergreen.disp_int_cont3 & LB_D4_VBLANK_INTERRUPT) | 2646 | if (rdev->irq.stat_regs.evergreen.disp_int_cont2 & LB_D3_VBLANK_INTERRUPT) |
2620 | WREG32(VBLANK_STATUS + EVERGREEN_CRTC3_REGISTER_OFFSET, VBLANK_ACK); | 2647 | WREG32(VBLANK_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET, VBLANK_ACK); |
2621 | if (rdev->irq.stat_regs.evergreen.disp_int_cont3 & LB_D4_VLINE_INTERRUPT) | 2648 | if (rdev->irq.stat_regs.evergreen.disp_int_cont2 & LB_D3_VLINE_INTERRUPT) |
2622 | WREG32(VLINE_STATUS + EVERGREEN_CRTC3_REGISTER_OFFSET, VLINE_ACK); | 2649 | WREG32(VLINE_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET, VLINE_ACK); |
2623 | 2650 | if (rdev->irq.stat_regs.evergreen.disp_int_cont3 & LB_D4_VBLANK_INTERRUPT) | |
2624 | if (rdev->irq.stat_regs.evergreen.disp_int_cont4 & LB_D5_VBLANK_INTERRUPT) | 2651 | WREG32(VBLANK_STATUS + EVERGREEN_CRTC3_REGISTER_OFFSET, VBLANK_ACK); |
2625 | WREG32(VBLANK_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET, VBLANK_ACK); | 2652 | if (rdev->irq.stat_regs.evergreen.disp_int_cont3 & LB_D4_VLINE_INTERRUPT) |
2626 | if (rdev->irq.stat_regs.evergreen.disp_int_cont4 & LB_D5_VLINE_INTERRUPT) | 2653 | WREG32(VLINE_STATUS + EVERGREEN_CRTC3_REGISTER_OFFSET, VLINE_ACK); |
2627 | WREG32(VLINE_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET, VLINE_ACK); | 2654 | } |
2628 | 2655 | ||
2629 | if (rdev->irq.stat_regs.evergreen.disp_int_cont5 & LB_D6_VBLANK_INTERRUPT) | 2656 | if (rdev->num_crtc >= 6) { |
2630 | WREG32(VBLANK_STATUS + EVERGREEN_CRTC5_REGISTER_OFFSET, VBLANK_ACK); | 2657 | if (rdev->irq.stat_regs.evergreen.d5grph_int & GRPH_PFLIP_INT_OCCURRED) |
2631 | if (rdev->irq.stat_regs.evergreen.disp_int_cont5 & LB_D6_VLINE_INTERRUPT) | 2658 | WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR); |
2632 | WREG32(VLINE_STATUS + EVERGREEN_CRTC5_REGISTER_OFFSET, VLINE_ACK); | 2659 | if (rdev->irq.stat_regs.evergreen.d6grph_int & GRPH_PFLIP_INT_OCCURRED) |
2660 | WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC5_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR); | ||
2661 | if (rdev->irq.stat_regs.evergreen.disp_int_cont4 & LB_D5_VBLANK_INTERRUPT) | ||
2662 | WREG32(VBLANK_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET, VBLANK_ACK); | ||
2663 | if (rdev->irq.stat_regs.evergreen.disp_int_cont4 & LB_D5_VLINE_INTERRUPT) | ||
2664 | WREG32(VLINE_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET, VLINE_ACK); | ||
2665 | if (rdev->irq.stat_regs.evergreen.disp_int_cont5 & LB_D6_VBLANK_INTERRUPT) | ||
2666 | WREG32(VBLANK_STATUS + EVERGREEN_CRTC5_REGISTER_OFFSET, VBLANK_ACK); | ||
2667 | if (rdev->irq.stat_regs.evergreen.disp_int_cont5 & LB_D6_VLINE_INTERRUPT) | ||
2668 | WREG32(VLINE_STATUS + EVERGREEN_CRTC5_REGISTER_OFFSET, VLINE_ACK); | ||
2669 | } | ||
2633 | 2670 | ||
2634 | if (rdev->irq.stat_regs.evergreen.disp_int & DC_HPD1_INTERRUPT) { | 2671 | if (rdev->irq.stat_regs.evergreen.disp_int & DC_HPD1_INTERRUPT) { |
2635 | tmp = RREG32(DC_HPD1_INT_CONTROL); | 2672 | tmp = RREG32(DC_HPD1_INT_CONTROL); |
@@ -3237,6 +3274,7 @@ void evergreen_fini(struct radeon_device *rdev) | |||
3237 | r700_cp_fini(rdev); | 3274 | r700_cp_fini(rdev); |
3238 | r600_irq_fini(rdev); | 3275 | r600_irq_fini(rdev); |
3239 | radeon_wb_fini(rdev); | 3276 | radeon_wb_fini(rdev); |
3277 | radeon_ib_pool_fini(rdev); | ||
3240 | radeon_irq_kms_fini(rdev); | 3278 | radeon_irq_kms_fini(rdev); |
3241 | evergreen_pcie_gart_fini(rdev); | 3279 | evergreen_pcie_gart_fini(rdev); |
3242 | radeon_gem_fini(rdev); | 3280 | radeon_gem_fini(rdev); |
diff --git a/drivers/gpu/drm/radeon/evergreend.h b/drivers/gpu/drm/radeon/evergreend.h index 1636e3449825..b7b2714f0b32 100644 --- a/drivers/gpu/drm/radeon/evergreend.h +++ b/drivers/gpu/drm/radeon/evergreend.h | |||
@@ -466,7 +466,7 @@ | |||
466 | #define IH_RB_WPTR_ADDR_LO 0x3e14 | 466 | #define IH_RB_WPTR_ADDR_LO 0x3e14 |
467 | #define IH_CNTL 0x3e18 | 467 | #define IH_CNTL 0x3e18 |
468 | # define ENABLE_INTR (1 << 0) | 468 | # define ENABLE_INTR (1 << 0) |
469 | # define IH_MC_SWAP(x) ((x) << 2) | 469 | # define IH_MC_SWAP(x) ((x) << 1) |
470 | # define IH_MC_SWAP_NONE 0 | 470 | # define IH_MC_SWAP_NONE 0 |
471 | # define IH_MC_SWAP_16BIT 1 | 471 | # define IH_MC_SWAP_16BIT 1 |
472 | # define IH_MC_SWAP_32BIT 2 | 472 | # define IH_MC_SWAP_32BIT 2 |
@@ -547,7 +547,7 @@ | |||
547 | # define LB_D5_VBLANK_INTERRUPT (1 << 3) | 547 | # define LB_D5_VBLANK_INTERRUPT (1 << 3) |
548 | # define DC_HPD5_INTERRUPT (1 << 17) | 548 | # define DC_HPD5_INTERRUPT (1 << 17) |
549 | # define DC_HPD5_RX_INTERRUPT (1 << 18) | 549 | # define DC_HPD5_RX_INTERRUPT (1 << 18) |
550 | #define DISP_INTERRUPT_STATUS_CONTINUE5 0x6050 | 550 | #define DISP_INTERRUPT_STATUS_CONTINUE5 0x6150 |
551 | # define LB_D6_VLINE_INTERRUPT (1 << 2) | 551 | # define LB_D6_VLINE_INTERRUPT (1 << 2) |
552 | # define LB_D6_VBLANK_INTERRUPT (1 << 3) | 552 | # define LB_D6_VBLANK_INTERRUPT (1 << 3) |
553 | # define DC_HPD6_INTERRUPT (1 << 17) | 553 | # define DC_HPD6_INTERRUPT (1 << 17) |
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c index 16caafeadf5e..559dbd412906 100644 --- a/drivers/gpu/drm/radeon/ni.c +++ b/drivers/gpu/drm/radeon/ni.c | |||
@@ -1581,6 +1581,7 @@ void cayman_fini(struct radeon_device *rdev) | |||
1581 | cayman_cp_fini(rdev); | 1581 | cayman_cp_fini(rdev); |
1582 | r600_irq_fini(rdev); | 1582 | r600_irq_fini(rdev); |
1583 | radeon_wb_fini(rdev); | 1583 | radeon_wb_fini(rdev); |
1584 | radeon_ib_pool_fini(rdev); | ||
1584 | radeon_irq_kms_fini(rdev); | 1585 | radeon_irq_kms_fini(rdev); |
1585 | cayman_pcie_gart_fini(rdev); | 1586 | cayman_pcie_gart_fini(rdev); |
1586 | radeon_gem_fini(rdev); | 1587 | radeon_gem_fini(rdev); |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index f79d2ccb6755..bc54b26cb32f 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -2628,6 +2628,7 @@ void r600_fini(struct radeon_device *rdev) | |||
2628 | r600_cp_fini(rdev); | 2628 | r600_cp_fini(rdev); |
2629 | r600_irq_fini(rdev); | 2629 | r600_irq_fini(rdev); |
2630 | radeon_wb_fini(rdev); | 2630 | radeon_wb_fini(rdev); |
2631 | radeon_ib_pool_fini(rdev); | ||
2631 | radeon_irq_kms_fini(rdev); | 2632 | radeon_irq_kms_fini(rdev); |
2632 | r600_pcie_gart_fini(rdev); | 2633 | r600_pcie_gart_fini(rdev); |
2633 | radeon_agp_fini(rdev); | 2634 | radeon_agp_fini(rdev); |
diff --git a/drivers/gpu/drm/radeon/r600d.h b/drivers/gpu/drm/radeon/r600d.h index f140a0d5cb54..0245ae6c204e 100644 --- a/drivers/gpu/drm/radeon/r600d.h +++ b/drivers/gpu/drm/radeon/r600d.h | |||
@@ -536,7 +536,7 @@ | |||
536 | #define IH_RB_WPTR_ADDR_LO 0x3e14 | 536 | #define IH_RB_WPTR_ADDR_LO 0x3e14 |
537 | #define IH_CNTL 0x3e18 | 537 | #define IH_CNTL 0x3e18 |
538 | # define ENABLE_INTR (1 << 0) | 538 | # define ENABLE_INTR (1 << 0) |
539 | # define IH_MC_SWAP(x) ((x) << 2) | 539 | # define IH_MC_SWAP(x) ((x) << 1) |
540 | # define IH_MC_SWAP_NONE 0 | 540 | # define IH_MC_SWAP_NONE 0 |
541 | # define IH_MC_SWAP_16BIT 1 | 541 | # define IH_MC_SWAP_16BIT 1 |
542 | # define IH_MC_SWAP_32BIT 2 | 542 | # define IH_MC_SWAP_32BIT 2 |
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index 8bb347d23ca6..4de51891aa6d 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
@@ -1368,6 +1368,7 @@ void rv770_fini(struct radeon_device *rdev) | |||
1368 | r700_cp_fini(rdev); | 1368 | r700_cp_fini(rdev); |
1369 | r600_irq_fini(rdev); | 1369 | r600_irq_fini(rdev); |
1370 | radeon_wb_fini(rdev); | 1370 | radeon_wb_fini(rdev); |
1371 | radeon_ib_pool_fini(rdev); | ||
1371 | radeon_irq_kms_fini(rdev); | 1372 | radeon_irq_kms_fini(rdev); |
1372 | rv770_pcie_gart_fini(rdev); | 1373 | rv770_pcie_gart_fini(rdev); |
1373 | rv770_vram_scratch_fini(rdev); | 1374 | rv770_vram_scratch_fini(rdev); |
diff --git a/drivers/hwmon/lm95241.c b/drivers/hwmon/lm95241.c index 1a6dfb6df1e7..d3b464b74ced 100644 --- a/drivers/hwmon/lm95241.c +++ b/drivers/hwmon/lm95241.c | |||
@@ -98,11 +98,16 @@ struct lm95241_data { | |||
98 | }; | 98 | }; |
99 | 99 | ||
100 | /* Conversions */ | 100 | /* Conversions */ |
101 | static int TempFromReg(u8 val_h, u8 val_l) | 101 | static int temp_from_reg_signed(u8 val_h, u8 val_l) |
102 | { | 102 | { |
103 | if (val_h & 0x80) | 103 | s16 val_hl = (val_h << 8) | val_l; |
104 | return val_h - 0x100; | 104 | return val_hl * 1000 / 256; |
105 | return val_h * 1000 + val_l * 1000 / 256; | 105 | } |
106 | |||
107 | static int temp_from_reg_unsigned(u8 val_h, u8 val_l) | ||
108 | { | ||
109 | u16 val_hl = (val_h << 8) | val_l; | ||
110 | return val_hl * 1000 / 256; | ||
106 | } | 111 | } |
107 | 112 | ||
108 | static struct lm95241_data *lm95241_update_device(struct device *dev) | 113 | static struct lm95241_data *lm95241_update_device(struct device *dev) |
@@ -135,10 +140,13 @@ static ssize_t show_input(struct device *dev, struct device_attribute *attr, | |||
135 | char *buf) | 140 | char *buf) |
136 | { | 141 | { |
137 | struct lm95241_data *data = lm95241_update_device(dev); | 142 | struct lm95241_data *data = lm95241_update_device(dev); |
143 | int index = to_sensor_dev_attr(attr)->index; | ||
138 | 144 | ||
139 | return snprintf(buf, PAGE_SIZE - 1, "%d\n", | 145 | return snprintf(buf, PAGE_SIZE - 1, "%d\n", |
140 | TempFromReg(data->temp[to_sensor_dev_attr(attr)->index], | 146 | index == 0 || (data->config & (1 << (index / 2))) ? |
141 | data->temp[to_sensor_dev_attr(attr)->index + 1])); | 147 | temp_from_reg_signed(data->temp[index], data->temp[index + 1]) : |
148 | temp_from_reg_unsigned(data->temp[index], | ||
149 | data->temp[index + 1])); | ||
142 | } | 150 | } |
143 | 151 | ||
144 | static ssize_t show_type(struct device *dev, struct device_attribute *attr, | 152 | static ssize_t show_type(struct device *dev, struct device_attribute *attr, |
@@ -339,7 +347,7 @@ static int lm95241_detect(struct i2c_client *new_client, | |||
339 | if ((i2c_smbus_read_byte_data(new_client, LM95241_REG_R_MAN_ID) | 347 | if ((i2c_smbus_read_byte_data(new_client, LM95241_REG_R_MAN_ID) |
340 | == MANUFACTURER_ID) | 348 | == MANUFACTURER_ID) |
341 | && (i2c_smbus_read_byte_data(new_client, LM95241_REG_R_CHIP_ID) | 349 | && (i2c_smbus_read_byte_data(new_client, LM95241_REG_R_CHIP_ID) |
342 | >= DEFAULT_REVISION)) { | 350 | == DEFAULT_REVISION)) { |
343 | name = DEVNAME; | 351 | name = DEVNAME; |
344 | } else { | 352 | } else { |
345 | dev_dbg(&adapter->dev, "LM95241 detection failed at 0x%02x\n", | 353 | dev_dbg(&adapter->dev, "LM95241 detection failed at 0x%02x\n", |
diff --git a/drivers/hwmon/pmbus.c b/drivers/hwmon/pmbus.c index 931d940923ae..9b1f0c37ef77 100644 --- a/drivers/hwmon/pmbus.c +++ b/drivers/hwmon/pmbus.c | |||
@@ -59,16 +59,17 @@ static void pmbus_find_sensor_groups(struct i2c_client *client, | |||
59 | if (pmbus_check_byte_register(client, 0, PMBUS_STATUS_FAN_34)) | 59 | if (pmbus_check_byte_register(client, 0, PMBUS_STATUS_FAN_34)) |
60 | info->func[0] |= PMBUS_HAVE_STATUS_FAN34; | 60 | info->func[0] |= PMBUS_HAVE_STATUS_FAN34; |
61 | } | 61 | } |
62 | if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_1)) { | 62 | if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_1)) |
63 | info->func[0] |= PMBUS_HAVE_TEMP; | 63 | info->func[0] |= PMBUS_HAVE_TEMP; |
64 | if (pmbus_check_byte_register(client, 0, | ||
65 | PMBUS_STATUS_TEMPERATURE)) | ||
66 | info->func[0] |= PMBUS_HAVE_STATUS_TEMP; | ||
67 | } | ||
68 | if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_2)) | 64 | if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_2)) |
69 | info->func[0] |= PMBUS_HAVE_TEMP2; | 65 | info->func[0] |= PMBUS_HAVE_TEMP2; |
70 | if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_3)) | 66 | if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_3)) |
71 | info->func[0] |= PMBUS_HAVE_TEMP3; | 67 | info->func[0] |= PMBUS_HAVE_TEMP3; |
68 | if (info->func[0] & (PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP2 | ||
69 | | PMBUS_HAVE_TEMP3) | ||
70 | && pmbus_check_byte_register(client, 0, | ||
71 | PMBUS_STATUS_TEMPERATURE)) | ||
72 | info->func[0] |= PMBUS_HAVE_STATUS_TEMP; | ||
72 | 73 | ||
73 | /* Sensors detected on all pages */ | 74 | /* Sensors detected on all pages */ |
74 | for (page = 0; page < info->pages; page++) { | 75 | for (page = 0; page < info->pages; page++) { |
diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c index 52b545a795f2..cbc98aea5b09 100644 --- a/drivers/i2c/busses/i2c-bfin-twi.c +++ b/drivers/i2c/busses/i2c-bfin-twi.c | |||
@@ -193,7 +193,13 @@ static void bfin_twi_handle_interrupt(struct bfin_twi_iface *iface, | |||
193 | return; | 193 | return; |
194 | } | 194 | } |
195 | if (twi_int_status & MCOMP) { | 195 | if (twi_int_status & MCOMP) { |
196 | if (iface->cur_mode == TWI_I2C_MODE_COMBINED) { | 196 | if ((read_MASTER_CTL(iface) & MEN) == 0 && |
197 | (iface->cur_mode == TWI_I2C_MODE_REPEAT || | ||
198 | iface->cur_mode == TWI_I2C_MODE_COMBINED)) { | ||
199 | iface->result = -1; | ||
200 | write_INT_MASK(iface, 0); | ||
201 | write_MASTER_CTL(iface, 0); | ||
202 | } else if (iface->cur_mode == TWI_I2C_MODE_COMBINED) { | ||
197 | if (iface->readNum == 0) { | 203 | if (iface->readNum == 0) { |
198 | /* set the read number to 1 and ask for manual | 204 | /* set the read number to 1 and ask for manual |
199 | * stop in block combine mode | 205 | * stop in block combine mode |
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 6c00c107ebf3..f84a63c6dd97 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c | |||
@@ -248,12 +248,12 @@ static inline int is_msgend(struct s3c24xx_i2c *i2c) | |||
248 | return i2c->msg_ptr >= i2c->msg->len; | 248 | return i2c->msg_ptr >= i2c->msg->len; |
249 | } | 249 | } |
250 | 250 | ||
251 | /* i2s_s3c_irq_nextbyte | 251 | /* i2c_s3c_irq_nextbyte |
252 | * | 252 | * |
253 | * process an interrupt and work out what to do | 253 | * process an interrupt and work out what to do |
254 | */ | 254 | */ |
255 | 255 | ||
256 | static int i2s_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat) | 256 | static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat) |
257 | { | 257 | { |
258 | unsigned long tmp; | 258 | unsigned long tmp; |
259 | unsigned char byte; | 259 | unsigned char byte; |
@@ -264,7 +264,6 @@ static int i2s_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat) | |||
264 | case STATE_IDLE: | 264 | case STATE_IDLE: |
265 | dev_err(i2c->dev, "%s: called in STATE_IDLE\n", __func__); | 265 | dev_err(i2c->dev, "%s: called in STATE_IDLE\n", __func__); |
266 | goto out; | 266 | goto out; |
267 | break; | ||
268 | 267 | ||
269 | case STATE_STOP: | 268 | case STATE_STOP: |
270 | dev_err(i2c->dev, "%s: called in STATE_STOP\n", __func__); | 269 | dev_err(i2c->dev, "%s: called in STATE_STOP\n", __func__); |
@@ -444,7 +443,7 @@ static irqreturn_t s3c24xx_i2c_irq(int irqno, void *dev_id) | |||
444 | /* pretty much this leaves us with the fact that we've | 443 | /* pretty much this leaves us with the fact that we've |
445 | * transmitted or received whatever byte we last sent */ | 444 | * transmitted or received whatever byte we last sent */ |
446 | 445 | ||
447 | i2s_s3c_irq_nextbyte(i2c, status); | 446 | i2c_s3c_irq_nextbyte(i2c, status); |
448 | 447 | ||
449 | out: | 448 | out: |
450 | return IRQ_HANDLED; | 449 | return IRQ_HANDLED; |
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 4d9319665e32..fb3b4f8f8152 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c | |||
@@ -40,8 +40,10 @@ | |||
40 | #define I2C_CNFG_NEW_MASTER_FSM (1<<11) | 40 | #define I2C_CNFG_NEW_MASTER_FSM (1<<11) |
41 | #define I2C_STATUS 0x01C | 41 | #define I2C_STATUS 0x01C |
42 | #define I2C_SL_CNFG 0x020 | 42 | #define I2C_SL_CNFG 0x020 |
43 | #define I2C_SL_CNFG_NACK (1<<1) | ||
43 | #define I2C_SL_CNFG_NEWSL (1<<2) | 44 | #define I2C_SL_CNFG_NEWSL (1<<2) |
44 | #define I2C_SL_ADDR1 0x02c | 45 | #define I2C_SL_ADDR1 0x02c |
46 | #define I2C_SL_ADDR2 0x030 | ||
45 | #define I2C_TX_FIFO 0x050 | 47 | #define I2C_TX_FIFO 0x050 |
46 | #define I2C_RX_FIFO 0x054 | 48 | #define I2C_RX_FIFO 0x054 |
47 | #define I2C_PACKET_TRANSFER_STATUS 0x058 | 49 | #define I2C_PACKET_TRANSFER_STATUS 0x058 |
@@ -337,7 +339,11 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev) | |||
337 | 339 | ||
338 | if (!i2c_dev->is_dvc) { | 340 | if (!i2c_dev->is_dvc) { |
339 | u32 sl_cfg = i2c_readl(i2c_dev, I2C_SL_CNFG); | 341 | u32 sl_cfg = i2c_readl(i2c_dev, I2C_SL_CNFG); |
340 | i2c_writel(i2c_dev, sl_cfg | I2C_SL_CNFG_NEWSL, I2C_SL_CNFG); | 342 | sl_cfg |= I2C_SL_CNFG_NACK | I2C_SL_CNFG_NEWSL; |
343 | i2c_writel(i2c_dev, sl_cfg, I2C_SL_CNFG); | ||
344 | i2c_writel(i2c_dev, 0xfc, I2C_SL_ADDR1); | ||
345 | i2c_writel(i2c_dev, 0x00, I2C_SL_ADDR2); | ||
346 | |||
341 | } | 347 | } |
342 | 348 | ||
343 | val = 7 << I2C_FIFO_CONTROL_TX_TRIG_SHIFT | | 349 | val = 7 << I2C_FIFO_CONTROL_TX_TRIG_SHIFT | |
diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c index d8d3a1e910a1..a2c874623e35 100644 --- a/drivers/leds/leds-pca9532.c +++ b/drivers/leds/leds-pca9532.c | |||
@@ -88,7 +88,7 @@ static const struct pca9532_chip_info pca9532_chip_info_tbl[] = { | |||
88 | 88 | ||
89 | static struct i2c_driver pca9532_driver = { | 89 | static struct i2c_driver pca9532_driver = { |
90 | .driver = { | 90 | .driver = { |
91 | .name = "pca953x", | 91 | .name = "leds-pca953x", |
92 | }, | 92 | }, |
93 | .probe = pca9532_probe, | 93 | .probe = pca9532_probe, |
94 | .remove = pca9532_remove, | 94 | .remove = pca9532_remove, |
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index a97cf2750bd9..834a48394bce 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c | |||
@@ -3474,7 +3474,7 @@ static int radio_s_tuner(struct file *file, void *priv, | |||
3474 | if (0 != t->index) | 3474 | if (0 != t->index) |
3475 | return -EINVAL; | 3475 | return -EINVAL; |
3476 | 3476 | ||
3477 | bttv_call_all(btv, tuner, g_tuner, t); | 3477 | bttv_call_all(btv, tuner, s_tuner, t); |
3478 | return 0; | 3478 | return 0; |
3479 | } | 3479 | } |
3480 | 3480 | ||
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c index 1933d4d11bf2..e80134f52ef5 100644 --- a/drivers/media/video/cx18/cx18-ioctl.c +++ b/drivers/media/video/cx18/cx18-ioctl.c | |||
@@ -695,14 +695,10 @@ static int cx18_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt) | |||
695 | 695 | ||
696 | cx18_call_all(cx, tuner, g_tuner, vt); | 696 | cx18_call_all(cx, tuner, g_tuner, vt); |
697 | 697 | ||
698 | if (test_bit(CX18_F_I_RADIO_USER, &cx->i_flags)) { | 698 | if (vt->type == V4L2_TUNER_RADIO) |
699 | strlcpy(vt->name, "cx18 Radio Tuner", sizeof(vt->name)); | 699 | strlcpy(vt->name, "cx18 Radio Tuner", sizeof(vt->name)); |
700 | vt->type = V4L2_TUNER_RADIO; | 700 | else |
701 | } else { | ||
702 | strlcpy(vt->name, "cx18 TV Tuner", sizeof(vt->name)); | 701 | strlcpy(vt->name, "cx18 TV Tuner", sizeof(vt->name)); |
703 | vt->type = V4L2_TUNER_ANALOG_TV; | ||
704 | } | ||
705 | |||
706 | return 0; | 702 | return 0; |
707 | } | 703 | } |
708 | 704 | ||
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c index f9e347dae739..120c7d8e0895 100644 --- a/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/drivers/media/video/ivtv/ivtv-ioctl.c | |||
@@ -1184,14 +1184,10 @@ static int ivtv_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt) | |||
1184 | 1184 | ||
1185 | ivtv_call_all(itv, tuner, g_tuner, vt); | 1185 | ivtv_call_all(itv, tuner, g_tuner, vt); |
1186 | 1186 | ||
1187 | if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags)) { | 1187 | if (vt->type == V4L2_TUNER_RADIO) |
1188 | strlcpy(vt->name, "ivtv Radio Tuner", sizeof(vt->name)); | 1188 | strlcpy(vt->name, "ivtv Radio Tuner", sizeof(vt->name)); |
1189 | vt->type = V4L2_TUNER_RADIO; | 1189 | else |
1190 | } else { | ||
1191 | strlcpy(vt->name, "ivtv TV Tuner", sizeof(vt->name)); | 1190 | strlcpy(vt->name, "ivtv TV Tuner", sizeof(vt->name)); |
1192 | vt->type = V4L2_TUNER_ANALOG_TV; | ||
1193 | } | ||
1194 | |||
1195 | return 0; | 1191 | return 0; |
1196 | } | 1192 | } |
1197 | 1193 | ||
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c index de5d481b0328..c43c81f5f978 100644 --- a/drivers/media/video/msp3400-driver.c +++ b/drivers/media/video/msp3400-driver.c | |||
@@ -480,12 +480,14 @@ static int msp_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) | |||
480 | struct msp_state *state = to_state(sd); | 480 | struct msp_state *state = to_state(sd); |
481 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 481 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
482 | 482 | ||
483 | if (state->radio) | 483 | if (vt->type != V4L2_TUNER_ANALOG_TV) |
484 | return 0; | 484 | return 0; |
485 | if (state->opmode == OPMODE_AUTOSELECT) | 485 | if (!state->radio) { |
486 | msp_detect_stereo(client); | 486 | if (state->opmode == OPMODE_AUTOSELECT) |
487 | vt->audmode = state->audmode; | 487 | msp_detect_stereo(client); |
488 | vt->rxsubchans = state->rxsubchans; | 488 | vt->rxsubchans = state->rxsubchans; |
489 | } | ||
490 | vt->audmode = state->audmode; | ||
489 | vt->capability |= V4L2_TUNER_CAP_STEREO | | 491 | vt->capability |= V4L2_TUNER_CAP_STEREO | |
490 | V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2; | 492 | V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2; |
491 | return 0; | 493 | return 0; |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 9d0dd08f57f8..e98d38212791 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -3046,6 +3046,8 @@ static void pvr2_subdev_update(struct pvr2_hdw *hdw) | |||
3046 | if (hdw->input_dirty || hdw->audiomode_dirty || hdw->force_dirty) { | 3046 | if (hdw->input_dirty || hdw->audiomode_dirty || hdw->force_dirty) { |
3047 | struct v4l2_tuner vt; | 3047 | struct v4l2_tuner vt; |
3048 | memset(&vt, 0, sizeof(vt)); | 3048 | memset(&vt, 0, sizeof(vt)); |
3049 | vt.type = (hdw->input_val == PVR2_CVAL_INPUT_RADIO) ? | ||
3050 | V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; | ||
3049 | vt.audmode = hdw->audiomode_val; | 3051 | vt.audmode = hdw->audiomode_val; |
3050 | v4l2_device_call_all(&hdw->v4l2_dev, 0, tuner, s_tuner, &vt); | 3052 | v4l2_device_call_all(&hdw->v4l2_dev, 0, tuner, s_tuner, &vt); |
3051 | } | 3053 | } |
@@ -5171,6 +5173,8 @@ void pvr2_hdw_status_poll(struct pvr2_hdw *hdw) | |||
5171 | { | 5173 | { |
5172 | struct v4l2_tuner *vtp = &hdw->tuner_signal_info; | 5174 | struct v4l2_tuner *vtp = &hdw->tuner_signal_info; |
5173 | memset(vtp, 0, sizeof(*vtp)); | 5175 | memset(vtp, 0, sizeof(*vtp)); |
5176 | vtp->type = (hdw->input_val == PVR2_CVAL_INPUT_RADIO) ? | ||
5177 | V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; | ||
5174 | hdw->tuner_signal_stale = 0; | 5178 | hdw->tuner_signal_stale = 0; |
5175 | /* Note: There apparently is no replacement for VIDIOC_CROPCAP | 5179 | /* Note: There apparently is no replacement for VIDIOC_CROPCAP |
5176 | using v4l2-subdev - therefore we can't support that AT ALL right | 5180 | using v4l2-subdev - therefore we can't support that AT ALL right |
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 9363ed91a4cb..cfa9f7efe93d 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -724,19 +724,15 @@ static inline int check_mode(struct tuner *t, enum v4l2_tuner_type mode) | |||
724 | } | 724 | } |
725 | 725 | ||
726 | /** | 726 | /** |
727 | * set_mode_freq - Switch tuner to other mode. | 727 | * set_mode - Switch tuner to other mode. |
728 | * @client: struct i2c_client pointer | ||
729 | * @t: a pointer to the module's internal struct_tuner | 728 | * @t: a pointer to the module's internal struct_tuner |
730 | * @mode: enum v4l2_type (radio or TV) | 729 | * @mode: enum v4l2_type (radio or TV) |
731 | * @freq: frequency to set (0 means to use the previous one) | ||
732 | * | 730 | * |
733 | * If tuner doesn't support the needed mode (radio or TV), prints a | 731 | * If tuner doesn't support the needed mode (radio or TV), prints a |
734 | * debug message and returns -EINVAL, changing its state to standby. | 732 | * debug message and returns -EINVAL, changing its state to standby. |
735 | * Otherwise, changes the state and sets frequency to the last value, if | 733 | * Otherwise, changes the mode and returns 0. |
736 | * the tuner can sleep or if it supports both Radio and TV. | ||
737 | */ | 734 | */ |
738 | static int set_mode_freq(struct i2c_client *client, struct tuner *t, | 735 | static int set_mode(struct tuner *t, enum v4l2_tuner_type mode) |
739 | enum v4l2_tuner_type mode, unsigned int freq) | ||
740 | { | 736 | { |
741 | struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; | 737 | struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; |
742 | 738 | ||
@@ -752,17 +748,27 @@ static int set_mode_freq(struct i2c_client *client, struct tuner *t, | |||
752 | t->mode = mode; | 748 | t->mode = mode; |
753 | tuner_dbg("Changing to mode %d\n", mode); | 749 | tuner_dbg("Changing to mode %d\n", mode); |
754 | } | 750 | } |
751 | return 0; | ||
752 | } | ||
753 | |||
754 | /** | ||
755 | * set_freq - Set the tuner to the desired frequency. | ||
756 | * @t: a pointer to the module's internal struct_tuner | ||
757 | * @freq: frequency to set (0 means to use the current frequency) | ||
758 | */ | ||
759 | static void set_freq(struct tuner *t, unsigned int freq) | ||
760 | { | ||
761 | struct i2c_client *client = v4l2_get_subdevdata(&t->sd); | ||
762 | |||
755 | if (t->mode == V4L2_TUNER_RADIO) { | 763 | if (t->mode == V4L2_TUNER_RADIO) { |
756 | if (freq) | 764 | if (!freq) |
757 | t->radio_freq = freq; | 765 | freq = t->radio_freq; |
758 | set_radio_freq(client, t->radio_freq); | 766 | set_radio_freq(client, freq); |
759 | } else { | 767 | } else { |
760 | if (freq) | 768 | if (!freq) |
761 | t->tv_freq = freq; | 769 | freq = t->tv_freq; |
762 | set_tv_freq(client, t->tv_freq); | 770 | set_tv_freq(client, freq); |
763 | } | 771 | } |
764 | |||
765 | return 0; | ||
766 | } | 772 | } |
767 | 773 | ||
768 | /* | 774 | /* |
@@ -817,7 +823,8 @@ static void set_tv_freq(struct i2c_client *c, unsigned int freq) | |||
817 | /** | 823 | /** |
818 | * tuner_fixup_std - force a given video standard variant | 824 | * tuner_fixup_std - force a given video standard variant |
819 | * | 825 | * |
820 | * @t: tuner internal struct | 826 | * @t: tuner internal struct |
827 | * @std: TV standard | ||
821 | * | 828 | * |
822 | * A few devices or drivers have problem to detect some standard variations. | 829 | * A few devices or drivers have problem to detect some standard variations. |
823 | * On other operational systems, the drivers generally have a per-country | 830 | * On other operational systems, the drivers generally have a per-country |
@@ -827,57 +834,39 @@ static void set_tv_freq(struct i2c_client *c, unsigned int freq) | |||
827 | * to distinguish all video standard variations, a modprobe parameter can | 834 | * to distinguish all video standard variations, a modprobe parameter can |
828 | * be used to force a video standard match. | 835 | * be used to force a video standard match. |
829 | */ | 836 | */ |
830 | static int tuner_fixup_std(struct tuner *t) | 837 | static v4l2_std_id tuner_fixup_std(struct tuner *t, v4l2_std_id std) |
831 | { | 838 | { |
832 | if ((t->std & V4L2_STD_PAL) == V4L2_STD_PAL) { | 839 | if (pal[0] != '-' && (std & V4L2_STD_PAL) == V4L2_STD_PAL) { |
833 | switch (pal[0]) { | 840 | switch (pal[0]) { |
834 | case '6': | 841 | case '6': |
835 | tuner_dbg("insmod fixup: PAL => PAL-60\n"); | 842 | return V4L2_STD_PAL_60; |
836 | t->std = V4L2_STD_PAL_60; | ||
837 | break; | ||
838 | case 'b': | 843 | case 'b': |
839 | case 'B': | 844 | case 'B': |
840 | case 'g': | 845 | case 'g': |
841 | case 'G': | 846 | case 'G': |
842 | tuner_dbg("insmod fixup: PAL => PAL-BG\n"); | 847 | return V4L2_STD_PAL_BG; |
843 | t->std = V4L2_STD_PAL_BG; | ||
844 | break; | ||
845 | case 'i': | 848 | case 'i': |
846 | case 'I': | 849 | case 'I': |
847 | tuner_dbg("insmod fixup: PAL => PAL-I\n"); | 850 | return V4L2_STD_PAL_I; |
848 | t->std = V4L2_STD_PAL_I; | ||
849 | break; | ||
850 | case 'd': | 851 | case 'd': |
851 | case 'D': | 852 | case 'D': |
852 | case 'k': | 853 | case 'k': |
853 | case 'K': | 854 | case 'K': |
854 | tuner_dbg("insmod fixup: PAL => PAL-DK\n"); | 855 | return V4L2_STD_PAL_DK; |
855 | t->std = V4L2_STD_PAL_DK; | ||
856 | break; | ||
857 | case 'M': | 856 | case 'M': |
858 | case 'm': | 857 | case 'm': |
859 | tuner_dbg("insmod fixup: PAL => PAL-M\n"); | 858 | return V4L2_STD_PAL_M; |
860 | t->std = V4L2_STD_PAL_M; | ||
861 | break; | ||
862 | case 'N': | 859 | case 'N': |
863 | case 'n': | 860 | case 'n': |
864 | if (pal[1] == 'c' || pal[1] == 'C') { | 861 | if (pal[1] == 'c' || pal[1] == 'C') |
865 | tuner_dbg("insmod fixup: PAL => PAL-Nc\n"); | 862 | return V4L2_STD_PAL_Nc; |
866 | t->std = V4L2_STD_PAL_Nc; | 863 | return V4L2_STD_PAL_N; |
867 | } else { | ||
868 | tuner_dbg("insmod fixup: PAL => PAL-N\n"); | ||
869 | t->std = V4L2_STD_PAL_N; | ||
870 | } | ||
871 | break; | ||
872 | case '-': | ||
873 | /* default parameter, do nothing */ | ||
874 | break; | ||
875 | default: | 864 | default: |
876 | tuner_warn("pal= argument not recognised\n"); | 865 | tuner_warn("pal= argument not recognised\n"); |
877 | break; | 866 | break; |
878 | } | 867 | } |
879 | } | 868 | } |
880 | if ((t->std & V4L2_STD_SECAM) == V4L2_STD_SECAM) { | 869 | if (secam[0] != '-' && (std & V4L2_STD_SECAM) == V4L2_STD_SECAM) { |
881 | switch (secam[0]) { | 870 | switch (secam[0]) { |
882 | case 'b': | 871 | case 'b': |
883 | case 'B': | 872 | case 'B': |
@@ -885,63 +874,42 @@ static int tuner_fixup_std(struct tuner *t) | |||
885 | case 'G': | 874 | case 'G': |
886 | case 'h': | 875 | case 'h': |
887 | case 'H': | 876 | case 'H': |
888 | tuner_dbg("insmod fixup: SECAM => SECAM-BGH\n"); | 877 | return V4L2_STD_SECAM_B | |
889 | t->std = V4L2_STD_SECAM_B | | 878 | V4L2_STD_SECAM_G | |
890 | V4L2_STD_SECAM_G | | 879 | V4L2_STD_SECAM_H; |
891 | V4L2_STD_SECAM_H; | ||
892 | break; | ||
893 | case 'd': | 880 | case 'd': |
894 | case 'D': | 881 | case 'D': |
895 | case 'k': | 882 | case 'k': |
896 | case 'K': | 883 | case 'K': |
897 | tuner_dbg("insmod fixup: SECAM => SECAM-DK\n"); | 884 | return V4L2_STD_SECAM_DK; |
898 | t->std = V4L2_STD_SECAM_DK; | ||
899 | break; | ||
900 | case 'l': | 885 | case 'l': |
901 | case 'L': | 886 | case 'L': |
902 | if ((secam[1] == 'C') || (secam[1] == 'c')) { | 887 | if ((secam[1] == 'C') || (secam[1] == 'c')) |
903 | tuner_dbg("insmod fixup: SECAM => SECAM-L'\n"); | 888 | return V4L2_STD_SECAM_LC; |
904 | t->std = V4L2_STD_SECAM_LC; | 889 | return V4L2_STD_SECAM_L; |
905 | } else { | ||
906 | tuner_dbg("insmod fixup: SECAM => SECAM-L\n"); | ||
907 | t->std = V4L2_STD_SECAM_L; | ||
908 | } | ||
909 | break; | ||
910 | case '-': | ||
911 | /* default parameter, do nothing */ | ||
912 | break; | ||
913 | default: | 890 | default: |
914 | tuner_warn("secam= argument not recognised\n"); | 891 | tuner_warn("secam= argument not recognised\n"); |
915 | break; | 892 | break; |
916 | } | 893 | } |
917 | } | 894 | } |
918 | 895 | ||
919 | if ((t->std & V4L2_STD_NTSC) == V4L2_STD_NTSC) { | 896 | if (ntsc[0] != '-' && (std & V4L2_STD_NTSC) == V4L2_STD_NTSC) { |
920 | switch (ntsc[0]) { | 897 | switch (ntsc[0]) { |
921 | case 'm': | 898 | case 'm': |
922 | case 'M': | 899 | case 'M': |
923 | tuner_dbg("insmod fixup: NTSC => NTSC-M\n"); | 900 | return V4L2_STD_NTSC_M; |
924 | t->std = V4L2_STD_NTSC_M; | ||
925 | break; | ||
926 | case 'j': | 901 | case 'j': |
927 | case 'J': | 902 | case 'J': |
928 | tuner_dbg("insmod fixup: NTSC => NTSC_M_JP\n"); | 903 | return V4L2_STD_NTSC_M_JP; |
929 | t->std = V4L2_STD_NTSC_M_JP; | ||
930 | break; | ||
931 | case 'k': | 904 | case 'k': |
932 | case 'K': | 905 | case 'K': |
933 | tuner_dbg("insmod fixup: NTSC => NTSC_M_KR\n"); | 906 | return V4L2_STD_NTSC_M_KR; |
934 | t->std = V4L2_STD_NTSC_M_KR; | ||
935 | break; | ||
936 | case '-': | ||
937 | /* default parameter, do nothing */ | ||
938 | break; | ||
939 | default: | 907 | default: |
940 | tuner_info("ntsc= argument not recognised\n"); | 908 | tuner_info("ntsc= argument not recognised\n"); |
941 | break; | 909 | break; |
942 | } | 910 | } |
943 | } | 911 | } |
944 | return 0; | 912 | return std; |
945 | } | 913 | } |
946 | 914 | ||
947 | /* | 915 | /* |
@@ -1058,10 +1026,9 @@ static void tuner_status(struct dvb_frontend *fe) | |||
1058 | static int tuner_s_radio(struct v4l2_subdev *sd) | 1026 | static int tuner_s_radio(struct v4l2_subdev *sd) |
1059 | { | 1027 | { |
1060 | struct tuner *t = to_tuner(sd); | 1028 | struct tuner *t = to_tuner(sd); |
1061 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
1062 | 1029 | ||
1063 | if (set_mode_freq(client, t, V4L2_TUNER_RADIO, 0) == -EINVAL) | 1030 | if (set_mode(t, V4L2_TUNER_RADIO) == 0) |
1064 | return 0; | 1031 | set_freq(t, 0); |
1065 | return 0; | 1032 | return 0; |
1066 | } | 1033 | } |
1067 | 1034 | ||
@@ -1072,16 +1039,20 @@ static int tuner_s_radio(struct v4l2_subdev *sd) | |||
1072 | /** | 1039 | /** |
1073 | * tuner_s_power - controls the power state of the tuner | 1040 | * tuner_s_power - controls the power state of the tuner |
1074 | * @sd: pointer to struct v4l2_subdev | 1041 | * @sd: pointer to struct v4l2_subdev |
1075 | * @on: a zero value puts the tuner to sleep | 1042 | * @on: a zero value puts the tuner to sleep, non-zero wakes it up |
1076 | */ | 1043 | */ |
1077 | static int tuner_s_power(struct v4l2_subdev *sd, int on) | 1044 | static int tuner_s_power(struct v4l2_subdev *sd, int on) |
1078 | { | 1045 | { |
1079 | struct tuner *t = to_tuner(sd); | 1046 | struct tuner *t = to_tuner(sd); |
1080 | struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; | 1047 | struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; |
1081 | 1048 | ||
1082 | /* FIXME: Why this function don't wake the tuner if on != 0 ? */ | 1049 | if (on) { |
1083 | if (on) | 1050 | if (t->standby && set_mode(t, t->mode) == 0) { |
1051 | tuner_dbg("Waking up tuner\n"); | ||
1052 | set_freq(t, 0); | ||
1053 | } | ||
1084 | return 0; | 1054 | return 0; |
1055 | } | ||
1085 | 1056 | ||
1086 | tuner_dbg("Putting tuner to sleep\n"); | 1057 | tuner_dbg("Putting tuner to sleep\n"); |
1087 | t->standby = true; | 1058 | t->standby = true; |
@@ -1093,28 +1064,36 @@ static int tuner_s_power(struct v4l2_subdev *sd, int on) | |||
1093 | static int tuner_s_std(struct v4l2_subdev *sd, v4l2_std_id std) | 1064 | static int tuner_s_std(struct v4l2_subdev *sd, v4l2_std_id std) |
1094 | { | 1065 | { |
1095 | struct tuner *t = to_tuner(sd); | 1066 | struct tuner *t = to_tuner(sd); |
1096 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
1097 | 1067 | ||
1098 | if (set_mode_freq(client, t, V4L2_TUNER_ANALOG_TV, 0) == -EINVAL) | 1068 | if (set_mode(t, V4L2_TUNER_ANALOG_TV)) |
1099 | return 0; | 1069 | return 0; |
1100 | 1070 | ||
1101 | t->std = std; | 1071 | t->std = tuner_fixup_std(t, std); |
1102 | tuner_fixup_std(t); | 1072 | if (t->std != std) |
1103 | 1073 | tuner_dbg("Fixup standard %llx to %llx\n", std, t->std); | |
1074 | set_freq(t, 0); | ||
1104 | return 0; | 1075 | return 0; |
1105 | } | 1076 | } |
1106 | 1077 | ||
1107 | static int tuner_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f) | 1078 | static int tuner_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f) |
1108 | { | 1079 | { |
1109 | struct tuner *t = to_tuner(sd); | 1080 | struct tuner *t = to_tuner(sd); |
1110 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
1111 | |||
1112 | if (set_mode_freq(client, t, f->type, f->frequency) == -EINVAL) | ||
1113 | return 0; | ||
1114 | 1081 | ||
1082 | if (set_mode(t, f->type) == 0) | ||
1083 | set_freq(t, f->frequency); | ||
1115 | return 0; | 1084 | return 0; |
1116 | } | 1085 | } |
1117 | 1086 | ||
1087 | /** | ||
1088 | * tuner_g_frequency - Get the tuned frequency for the tuner | ||
1089 | * @sd: pointer to struct v4l2_subdev | ||
1090 | * @f: pointer to struct v4l2_frequency | ||
1091 | * | ||
1092 | * At return, the structure f will be filled with tuner frequency | ||
1093 | * if the tuner matches the f->type. | ||
1094 | * Note: f->type should be initialized before calling it. | ||
1095 | * This is done by either video_ioctl2 or by the bridge driver. | ||
1096 | */ | ||
1118 | static int tuner_g_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f) | 1097 | static int tuner_g_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f) |
1119 | { | 1098 | { |
1120 | struct tuner *t = to_tuner(sd); | 1099 | struct tuner *t = to_tuner(sd); |
@@ -1122,8 +1101,7 @@ static int tuner_g_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f) | |||
1122 | 1101 | ||
1123 | if (check_mode(t, f->type) == -EINVAL) | 1102 | if (check_mode(t, f->type) == -EINVAL) |
1124 | return 0; | 1103 | return 0; |
1125 | f->type = t->mode; | 1104 | if (f->type == t->mode && fe_tuner_ops->get_frequency && !t->standby) { |
1126 | if (fe_tuner_ops->get_frequency && !t->standby) { | ||
1127 | u32 abs_freq; | 1105 | u32 abs_freq; |
1128 | 1106 | ||
1129 | fe_tuner_ops->get_frequency(&t->fe, &abs_freq); | 1107 | fe_tuner_ops->get_frequency(&t->fe, &abs_freq); |
@@ -1131,12 +1109,22 @@ static int tuner_g_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f) | |||
1131 | DIV_ROUND_CLOSEST(abs_freq * 2, 125) : | 1109 | DIV_ROUND_CLOSEST(abs_freq * 2, 125) : |
1132 | DIV_ROUND_CLOSEST(abs_freq, 62500); | 1110 | DIV_ROUND_CLOSEST(abs_freq, 62500); |
1133 | } else { | 1111 | } else { |
1134 | f->frequency = (V4L2_TUNER_RADIO == t->mode) ? | 1112 | f->frequency = (V4L2_TUNER_RADIO == f->type) ? |
1135 | t->radio_freq : t->tv_freq; | 1113 | t->radio_freq : t->tv_freq; |
1136 | } | 1114 | } |
1137 | return 0; | 1115 | return 0; |
1138 | } | 1116 | } |
1139 | 1117 | ||
1118 | /** | ||
1119 | * tuner_g_tuner - Fill in tuner information | ||
1120 | * @sd: pointer to struct v4l2_subdev | ||
1121 | * @vt: pointer to struct v4l2_tuner | ||
1122 | * | ||
1123 | * At return, the structure vt will be filled with tuner information | ||
1124 | * if the tuner matches vt->type. | ||
1125 | * Note: vt->type should be initialized before calling it. | ||
1126 | * This is done by either video_ioctl2 or by the bridge driver. | ||
1127 | */ | ||
1140 | static int tuner_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) | 1128 | static int tuner_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) |
1141 | { | 1129 | { |
1142 | struct tuner *t = to_tuner(sd); | 1130 | struct tuner *t = to_tuner(sd); |
@@ -1145,48 +1133,58 @@ static int tuner_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) | |||
1145 | 1133 | ||
1146 | if (check_mode(t, vt->type) == -EINVAL) | 1134 | if (check_mode(t, vt->type) == -EINVAL) |
1147 | return 0; | 1135 | return 0; |
1148 | vt->type = t->mode; | 1136 | if (vt->type == t->mode && analog_ops->get_afc) |
1149 | if (analog_ops->get_afc) | ||
1150 | vt->afc = analog_ops->get_afc(&t->fe); | 1137 | vt->afc = analog_ops->get_afc(&t->fe); |
1151 | if (t->mode == V4L2_TUNER_ANALOG_TV) | 1138 | if (vt->type == V4L2_TUNER_ANALOG_TV) |
1152 | vt->capability |= V4L2_TUNER_CAP_NORM; | 1139 | vt->capability |= V4L2_TUNER_CAP_NORM; |
1153 | if (t->mode != V4L2_TUNER_RADIO) { | 1140 | if (vt->type != V4L2_TUNER_RADIO) { |
1154 | vt->rangelow = tv_range[0] * 16; | 1141 | vt->rangelow = tv_range[0] * 16; |
1155 | vt->rangehigh = tv_range[1] * 16; | 1142 | vt->rangehigh = tv_range[1] * 16; |
1156 | return 0; | 1143 | return 0; |
1157 | } | 1144 | } |
1158 | 1145 | ||
1159 | /* radio mode */ | 1146 | /* radio mode */ |
1160 | vt->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; | 1147 | if (vt->type == t->mode) { |
1161 | if (fe_tuner_ops->get_status) { | 1148 | vt->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; |
1162 | u32 tuner_status; | 1149 | if (fe_tuner_ops->get_status) { |
1163 | 1150 | u32 tuner_status; | |
1164 | fe_tuner_ops->get_status(&t->fe, &tuner_status); | 1151 | |
1165 | vt->rxsubchans = | 1152 | fe_tuner_ops->get_status(&t->fe, &tuner_status); |
1166 | (tuner_status & TUNER_STATUS_STEREO) ? | 1153 | vt->rxsubchans = |
1167 | V4L2_TUNER_SUB_STEREO : | 1154 | (tuner_status & TUNER_STATUS_STEREO) ? |
1168 | V4L2_TUNER_SUB_MONO; | 1155 | V4L2_TUNER_SUB_STEREO : |
1156 | V4L2_TUNER_SUB_MONO; | ||
1157 | } | ||
1158 | if (analog_ops->has_signal) | ||
1159 | vt->signal = analog_ops->has_signal(&t->fe); | ||
1160 | vt->audmode = t->audmode; | ||
1169 | } | 1161 | } |
1170 | if (analog_ops->has_signal) | ||
1171 | vt->signal = analog_ops->has_signal(&t->fe); | ||
1172 | vt->capability |= V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; | 1162 | vt->capability |= V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; |
1173 | vt->audmode = t->audmode; | ||
1174 | vt->rangelow = radio_range[0] * 16000; | 1163 | vt->rangelow = radio_range[0] * 16000; |
1175 | vt->rangehigh = radio_range[1] * 16000; | 1164 | vt->rangehigh = radio_range[1] * 16000; |
1176 | 1165 | ||
1177 | return 0; | 1166 | return 0; |
1178 | } | 1167 | } |
1179 | 1168 | ||
1169 | /** | ||
1170 | * tuner_s_tuner - Set the tuner's audio mode | ||
1171 | * @sd: pointer to struct v4l2_subdev | ||
1172 | * @vt: pointer to struct v4l2_tuner | ||
1173 | * | ||
1174 | * Sets the audio mode if the tuner matches vt->type. | ||
1175 | * Note: vt->type should be initialized before calling it. | ||
1176 | * This is done by either video_ioctl2 or by the bridge driver. | ||
1177 | */ | ||
1180 | static int tuner_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) | 1178 | static int tuner_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) |
1181 | { | 1179 | { |
1182 | struct tuner *t = to_tuner(sd); | 1180 | struct tuner *t = to_tuner(sd); |
1183 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
1184 | 1181 | ||
1185 | if (set_mode_freq(client, t, vt->type, 0) == -EINVAL) | 1182 | if (set_mode(t, vt->type)) |
1186 | return 0; | 1183 | return 0; |
1187 | 1184 | ||
1188 | if (t->mode == V4L2_TUNER_RADIO) | 1185 | if (t->mode == V4L2_TUNER_RADIO) |
1189 | t->audmode = vt->audmode; | 1186 | t->audmode = vt->audmode; |
1187 | set_freq(t, 0); | ||
1190 | 1188 | ||
1191 | return 0; | 1189 | return 0; |
1192 | } | 1190 | } |
@@ -1221,7 +1219,8 @@ static int tuner_resume(struct i2c_client *c) | |||
1221 | tuner_dbg("resume\n"); | 1219 | tuner_dbg("resume\n"); |
1222 | 1220 | ||
1223 | if (!t->standby) | 1221 | if (!t->standby) |
1224 | set_mode_freq(c, t, t->type, 0); | 1222 | if (set_mode(t, t->mode) == 0) |
1223 | set_freq(t, 0); | ||
1225 | 1224 | ||
1226 | return 0; | 1225 | return 0; |
1227 | } | 1226 | } |
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index 506edcc2ddeb..69e8c6ffcc49 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c | |||
@@ -1822,6 +1822,8 @@ static long __video_do_ioctl(struct file *file, | |||
1822 | if (!ops->vidioc_g_tuner) | 1822 | if (!ops->vidioc_g_tuner) |
1823 | break; | 1823 | break; |
1824 | 1824 | ||
1825 | p->type = (vfd->vfl_type == VFL_TYPE_RADIO) ? | ||
1826 | V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; | ||
1825 | ret = ops->vidioc_g_tuner(file, fh, p); | 1827 | ret = ops->vidioc_g_tuner(file, fh, p); |
1826 | if (!ret) | 1828 | if (!ret) |
1827 | dbgarg(cmd, "index=%d, name=%s, type=%d, " | 1829 | dbgarg(cmd, "index=%d, name=%s, type=%d, " |
@@ -1840,6 +1842,8 @@ static long __video_do_ioctl(struct file *file, | |||
1840 | 1842 | ||
1841 | if (!ops->vidioc_s_tuner) | 1843 | if (!ops->vidioc_s_tuner) |
1842 | break; | 1844 | break; |
1845 | p->type = (vfd->vfl_type == VFL_TYPE_RADIO) ? | ||
1846 | V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; | ||
1843 | dbgarg(cmd, "index=%d, name=%s, type=%d, " | 1847 | dbgarg(cmd, "index=%d, name=%s, type=%d, " |
1844 | "capability=0x%x, rangelow=%d, " | 1848 | "capability=0x%x, rangelow=%d, " |
1845 | "rangehigh=%d, signal=%d, afc=%d, " | 1849 | "rangehigh=%d, signal=%d, afc=%d, " |
@@ -1858,6 +1862,8 @@ static long __video_do_ioctl(struct file *file, | |||
1858 | if (!ops->vidioc_g_frequency) | 1862 | if (!ops->vidioc_g_frequency) |
1859 | break; | 1863 | break; |
1860 | 1864 | ||
1865 | p->type = (vfd->vfl_type == VFL_TYPE_RADIO) ? | ||
1866 | V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; | ||
1861 | ret = ops->vidioc_g_frequency(file, fh, p); | 1867 | ret = ops->vidioc_g_frequency(file, fh, p); |
1862 | if (!ret) | 1868 | if (!ret) |
1863 | dbgarg(cmd, "tuner=%d, type=%d, frequency=%d\n", | 1869 | dbgarg(cmd, "tuner=%d, type=%d, frequency=%d\n", |
@@ -1940,13 +1946,19 @@ static long __video_do_ioctl(struct file *file, | |||
1940 | case VIDIOC_S_HW_FREQ_SEEK: | 1946 | case VIDIOC_S_HW_FREQ_SEEK: |
1941 | { | 1947 | { |
1942 | struct v4l2_hw_freq_seek *p = arg; | 1948 | struct v4l2_hw_freq_seek *p = arg; |
1949 | enum v4l2_tuner_type type; | ||
1943 | 1950 | ||
1944 | if (!ops->vidioc_s_hw_freq_seek) | 1951 | if (!ops->vidioc_s_hw_freq_seek) |
1945 | break; | 1952 | break; |
1953 | type = (vfd->vfl_type == VFL_TYPE_RADIO) ? | ||
1954 | V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; | ||
1946 | dbgarg(cmd, | 1955 | dbgarg(cmd, |
1947 | "tuner=%d, type=%d, seek_upward=%d, wrap_around=%d\n", | 1956 | "tuner=%u, type=%u, seek_upward=%u, wrap_around=%u, spacing=%u\n", |
1948 | p->tuner, p->type, p->seek_upward, p->wrap_around); | 1957 | p->tuner, p->type, p->seek_upward, p->wrap_around, p->spacing); |
1949 | ret = ops->vidioc_s_hw_freq_seek(file, fh, p); | 1958 | if (p->type != type) |
1959 | ret = -EINVAL; | ||
1960 | else | ||
1961 | ret = ops->vidioc_s_hw_freq_seek(file, fh, p); | ||
1950 | break; | 1962 | break; |
1951 | } | 1963 | } |
1952 | case VIDIOC_ENUM_FRAMESIZES: | 1964 | case VIDIOC_ENUM_FRAMESIZES: |
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c index c27fd1fc3b86..c71ae09430c5 100644 --- a/drivers/mfd/asic3.c +++ b/drivers/mfd/asic3.c | |||
@@ -619,6 +619,7 @@ static void asic3_clk_disable(struct asic3 *asic, struct asic3_clk *clk) | |||
619 | /* MFD cells (SPI, PWM, LED, DS1WM, MMC) */ | 619 | /* MFD cells (SPI, PWM, LED, DS1WM, MMC) */ |
620 | static struct ds1wm_driver_data ds1wm_pdata = { | 620 | static struct ds1wm_driver_data ds1wm_pdata = { |
621 | .active_high = 1, | 621 | .active_high = 1, |
622 | .reset_recover_delay = 1, | ||
622 | }; | 623 | }; |
623 | 624 | ||
624 | static struct resource ds1wm_resources[] = { | 625 | static struct resource ds1wm_resources[] = { |
diff --git a/drivers/mfd/htc-pasic3.c b/drivers/mfd/htc-pasic3.c index 2808bd125d13..04c7093d6499 100644 --- a/drivers/mfd/htc-pasic3.c +++ b/drivers/mfd/htc-pasic3.c | |||
@@ -99,6 +99,7 @@ static int ds1wm_disable(struct platform_device *pdev) | |||
99 | 99 | ||
100 | static struct ds1wm_driver_data ds1wm_pdata = { | 100 | static struct ds1wm_driver_data ds1wm_pdata = { |
101 | .active_high = 0, | 101 | .active_high = 0, |
102 | .reset_recover_delay = 1, | ||
102 | }; | 103 | }; |
103 | 104 | ||
104 | static struct resource ds1wm_resources[] __initdata = { | 105 | static struct resource ds1wm_resources[] __initdata = { |
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 7721de942c69..fe140724a02e 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -582,6 +582,8 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data, | |||
582 | data->error = -EILSEQ; | 582 | data->error = -EILSEQ; |
583 | } else if (status & MCI_DATATIMEOUT) { | 583 | } else if (status & MCI_DATATIMEOUT) { |
584 | data->error = -ETIMEDOUT; | 584 | data->error = -ETIMEDOUT; |
585 | } else if (status & MCI_STARTBITERR) { | ||
586 | data->error = -ECOMM; | ||
585 | } else if (status & MCI_TXUNDERRUN) { | 587 | } else if (status & MCI_TXUNDERRUN) { |
586 | data->error = -EIO; | 588 | data->error = -EIO; |
587 | } else if (status & MCI_RXOVERRUN) { | 589 | } else if (status & MCI_RXOVERRUN) { |
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index bb32e21c09db..2164e8c6476c 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h | |||
@@ -86,6 +86,7 @@ | |||
86 | #define MCI_CMDRESPEND (1 << 6) | 86 | #define MCI_CMDRESPEND (1 << 6) |
87 | #define MCI_CMDSENT (1 << 7) | 87 | #define MCI_CMDSENT (1 << 7) |
88 | #define MCI_DATAEND (1 << 8) | 88 | #define MCI_DATAEND (1 << 8) |
89 | #define MCI_STARTBITERR (1 << 9) | ||
89 | #define MCI_DATABLOCKEND (1 << 10) | 90 | #define MCI_DATABLOCKEND (1 << 10) |
90 | #define MCI_CMDACTIVE (1 << 11) | 91 | #define MCI_CMDACTIVE (1 << 11) |
91 | #define MCI_TXACTIVE (1 << 12) | 92 | #define MCI_TXACTIVE (1 << 12) |
@@ -112,6 +113,7 @@ | |||
112 | #define MCI_CMDRESPENDCLR (1 << 6) | 113 | #define MCI_CMDRESPENDCLR (1 << 6) |
113 | #define MCI_CMDSENTCLR (1 << 7) | 114 | #define MCI_CMDSENTCLR (1 << 7) |
114 | #define MCI_DATAENDCLR (1 << 8) | 115 | #define MCI_DATAENDCLR (1 << 8) |
116 | #define MCI_STARTBITERRCLR (1 << 9) | ||
115 | #define MCI_DATABLOCKENDCLR (1 << 10) | 117 | #define MCI_DATABLOCKENDCLR (1 << 10) |
116 | /* Extended status bits for the ST Micro variants */ | 118 | /* Extended status bits for the ST Micro variants */ |
117 | #define MCI_ST_SDIOITC (1 << 22) | 119 | #define MCI_ST_SDIOITC (1 << 22) |
@@ -127,6 +129,7 @@ | |||
127 | #define MCI_CMDRESPENDMASK (1 << 6) | 129 | #define MCI_CMDRESPENDMASK (1 << 6) |
128 | #define MCI_CMDSENTMASK (1 << 7) | 130 | #define MCI_CMDSENTMASK (1 << 7) |
129 | #define MCI_DATAENDMASK (1 << 8) | 131 | #define MCI_DATAENDMASK (1 << 8) |
132 | #define MCI_STARTBITERRMASK (1 << 9) | ||
130 | #define MCI_DATABLOCKENDMASK (1 << 10) | 133 | #define MCI_DATABLOCKENDMASK (1 << 10) |
131 | #define MCI_CMDACTIVEMASK (1 << 11) | 134 | #define MCI_CMDACTIVEMASK (1 << 11) |
132 | #define MCI_TXACTIVEMASK (1 << 12) | 135 | #define MCI_TXACTIVEMASK (1 << 12) |
@@ -150,7 +153,7 @@ | |||
150 | #define MCI_IRQENABLE \ | 153 | #define MCI_IRQENABLE \ |
151 | (MCI_CMDCRCFAILMASK|MCI_DATACRCFAILMASK|MCI_CMDTIMEOUTMASK| \ | 154 | (MCI_CMDCRCFAILMASK|MCI_DATACRCFAILMASK|MCI_CMDTIMEOUTMASK| \ |
152 | MCI_DATATIMEOUTMASK|MCI_TXUNDERRUNMASK|MCI_RXOVERRUNMASK| \ | 155 | MCI_DATATIMEOUTMASK|MCI_TXUNDERRUNMASK|MCI_RXOVERRUNMASK| \ |
153 | MCI_CMDRESPENDMASK|MCI_CMDSENTMASK) | 156 | MCI_CMDRESPENDMASK|MCI_CMDSENTMASK|MCI_STARTBITERRMASK) |
154 | 157 | ||
155 | /* These interrupts are directed to IRQ1 when two IRQ lines are available */ | 158 | /* These interrupts are directed to IRQ1 when two IRQ lines are available */ |
156 | #define MCI_IRQ1MASK \ | 159 | #define MCI_IRQ1MASK \ |
diff --git a/drivers/net/wireless/ath/ath5k/desc.c b/drivers/net/wireless/ath/ath5k/desc.c index 62172d585723..f82383b3ed30 100644 --- a/drivers/net/wireless/ath/ath5k/desc.c +++ b/drivers/net/wireless/ath/ath5k/desc.c | |||
@@ -107,10 +107,13 @@ ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | |||
107 | case AR5K_PKT_TYPE_BEACON: | 107 | case AR5K_PKT_TYPE_BEACON: |
108 | case AR5K_PKT_TYPE_PROBE_RESP: | 108 | case AR5K_PKT_TYPE_PROBE_RESP: |
109 | frame_type = AR5K_AR5210_TX_DESC_FRAME_TYPE_NO_DELAY; | 109 | frame_type = AR5K_AR5210_TX_DESC_FRAME_TYPE_NO_DELAY; |
110 | break; | ||
110 | case AR5K_PKT_TYPE_PIFS: | 111 | case AR5K_PKT_TYPE_PIFS: |
111 | frame_type = AR5K_AR5210_TX_DESC_FRAME_TYPE_PIFS; | 112 | frame_type = AR5K_AR5210_TX_DESC_FRAME_TYPE_PIFS; |
113 | break; | ||
112 | default: | 114 | default: |
113 | frame_type = type; | 115 | frame_type = type; |
116 | break; | ||
114 | } | 117 | } |
115 | 118 | ||
116 | tx_ctl->tx_control_0 |= | 119 | tx_ctl->tx_control_0 |= |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 2c5b9b991279..692671b11667 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -3483,6 +3483,8 @@ static int __init pci_setup(char *str) | |||
3483 | pci_no_msi(); | 3483 | pci_no_msi(); |
3484 | } else if (!strcmp(str, "noaer")) { | 3484 | } else if (!strcmp(str, "noaer")) { |
3485 | pci_no_aer(); | 3485 | pci_no_aer(); |
3486 | } else if (!strncmp(str, "realloc", 7)) { | ||
3487 | pci_realloc(); | ||
3486 | } else if (!strcmp(str, "nodomains")) { | 3488 | } else if (!strcmp(str, "nodomains")) { |
3487 | pci_no_domains(); | 3489 | pci_no_domains(); |
3488 | } else if (!strncmp(str, "cbiosize=", 9)) { | 3490 | } else if (!strncmp(str, "cbiosize=", 9)) { |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 731e20265ace..3a39bf1f1e2c 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
@@ -146,6 +146,8 @@ static inline void pci_no_msi(void) { } | |||
146 | static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } | 146 | static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } |
147 | #endif | 147 | #endif |
148 | 148 | ||
149 | extern void pci_realloc(void); | ||
150 | |||
149 | static inline int pci_no_d1d2(struct pci_dev *dev) | 151 | static inline int pci_no_d1d2(struct pci_dev *dev) |
150 | { | 152 | { |
151 | unsigned int parent_dstates = 0; | 153 | unsigned int parent_dstates = 0; |
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 1e9e5a5b8c81..9995842e45b5 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -47,6 +47,13 @@ struct resource_list_x { | |||
47 | (head)->next = NULL; \ | 47 | (head)->next = NULL; \ |
48 | } while (0) | 48 | } while (0) |
49 | 49 | ||
50 | int pci_realloc_enable = 0; | ||
51 | #define pci_realloc_enabled() pci_realloc_enable | ||
52 | void pci_realloc(void) | ||
53 | { | ||
54 | pci_realloc_enable = 1; | ||
55 | } | ||
56 | |||
50 | /** | 57 | /** |
51 | * add_to_list() - add a new resource tracker to the list | 58 | * add_to_list() - add a new resource tracker to the list |
52 | * @head: Head of the list | 59 | * @head: Head of the list |
@@ -1025,6 +1032,7 @@ static int __init pci_get_max_depth(void) | |||
1025 | return depth; | 1032 | return depth; |
1026 | } | 1033 | } |
1027 | 1034 | ||
1035 | |||
1028 | /* | 1036 | /* |
1029 | * first try will not touch pci bridge res | 1037 | * first try will not touch pci bridge res |
1030 | * second and later try will clear small leaf bridge res | 1038 | * second and later try will clear small leaf bridge res |
@@ -1068,6 +1076,13 @@ again: | |||
1068 | /* any device complain? */ | 1076 | /* any device complain? */ |
1069 | if (!head.next) | 1077 | if (!head.next) |
1070 | goto enable_and_dump; | 1078 | goto enable_and_dump; |
1079 | |||
1080 | /* don't realloc if asked to do so */ | ||
1081 | if (!pci_realloc_enabled()) { | ||
1082 | free_list(resource_list_x, &head); | ||
1083 | goto enable_and_dump; | ||
1084 | } | ||
1085 | |||
1071 | failed_type = 0; | 1086 | failed_type = 0; |
1072 | for (list = head.next; list;) { | 1087 | for (list = head.next; list;) { |
1073 | failed_type |= list->flags; | 1088 | failed_type |= list->flags; |
diff --git a/drivers/pcmcia/pxa2xx_vpac270.c b/drivers/pcmcia/pxa2xx_vpac270.c index 712baab3c83d..e956f659089a 100644 --- a/drivers/pcmcia/pxa2xx_vpac270.c +++ b/drivers/pcmcia/pxa2xx_vpac270.c | |||
@@ -76,10 +76,10 @@ static int vpac270_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | |||
76 | static void vpac270_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) | 76 | static void vpac270_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) |
77 | { | 77 | { |
78 | if (skt->nr == 0) | 78 | if (skt->nr == 0) |
79 | gpio_request_array(vpac270_pcmcia_gpios, | 79 | gpio_free_array(vpac270_pcmcia_gpios, |
80 | ARRAY_SIZE(vpac270_pcmcia_gpios)); | 80 | ARRAY_SIZE(vpac270_pcmcia_gpios)); |
81 | else | 81 | else |
82 | gpio_request_array(vpac270_cf_gpios, | 82 | gpio_free_array(vpac270_cf_gpios, |
83 | ARRAY_SIZE(vpac270_cf_gpios)); | 83 | ARRAY_SIZE(vpac270_cf_gpios)); |
84 | } | 84 | } |
85 | 85 | ||
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index 005417bd429e..e1c4938b301b 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c | |||
@@ -1156,9 +1156,9 @@ static acpi_status wmid3_set_device_status(u32 value, u16 device) | |||
1156 | struct wmid3_gds_input_param params = { | 1156 | struct wmid3_gds_input_param params = { |
1157 | .function_num = 0x1, | 1157 | .function_num = 0x1, |
1158 | .hotkey_number = 0x01, | 1158 | .hotkey_number = 0x01, |
1159 | .devices = ACER_WMID3_GDS_WIRELESS & | 1159 | .devices = ACER_WMID3_GDS_WIRELESS | |
1160 | ACER_WMID3_GDS_THREEG & | 1160 | ACER_WMID3_GDS_THREEG | |
1161 | ACER_WMID3_GDS_WIMAX & | 1161 | ACER_WMID3_GDS_WIMAX | |
1162 | ACER_WMID3_GDS_BLUETOOTH, | 1162 | ACER_WMID3_GDS_BLUETOOTH, |
1163 | }; | 1163 | }; |
1164 | struct acpi_buffer input = { | 1164 | struct acpi_buffer input = { |
@@ -1445,6 +1445,8 @@ static void acer_wmi_notify(u32 value, void *context) | |||
1445 | union acpi_object *obj; | 1445 | union acpi_object *obj; |
1446 | struct event_return_value return_value; | 1446 | struct event_return_value return_value; |
1447 | acpi_status status; | 1447 | acpi_status status; |
1448 | u16 device_state; | ||
1449 | const struct key_entry *key; | ||
1448 | 1450 | ||
1449 | status = wmi_get_event_data(value, &response); | 1451 | status = wmi_get_event_data(value, &response); |
1450 | if (status != AE_OK) { | 1452 | if (status != AE_OK) { |
@@ -1472,23 +1474,32 @@ static void acer_wmi_notify(u32 value, void *context) | |||
1472 | 1474 | ||
1473 | switch (return_value.function) { | 1475 | switch (return_value.function) { |
1474 | case WMID_HOTKEY_EVENT: | 1476 | case WMID_HOTKEY_EVENT: |
1475 | if (return_value.device_state) { | 1477 | device_state = return_value.device_state; |
1476 | u16 device_state = return_value.device_state; | 1478 | pr_debug("device state: 0x%x\n", device_state); |
1477 | pr_debug("device state: 0x%x\n", device_state); | 1479 | |
1478 | if (has_cap(ACER_CAP_WIRELESS)) | 1480 | key = sparse_keymap_entry_from_scancode(acer_wmi_input_dev, |
1479 | rfkill_set_sw_state(wireless_rfkill, | 1481 | return_value.key_num); |
1480 | !(device_state & ACER_WMID3_GDS_WIRELESS)); | 1482 | if (!key) { |
1481 | if (has_cap(ACER_CAP_BLUETOOTH)) | ||
1482 | rfkill_set_sw_state(bluetooth_rfkill, | ||
1483 | !(device_state & ACER_WMID3_GDS_BLUETOOTH)); | ||
1484 | if (has_cap(ACER_CAP_THREEG)) | ||
1485 | rfkill_set_sw_state(threeg_rfkill, | ||
1486 | !(device_state & ACER_WMID3_GDS_THREEG)); | ||
1487 | } | ||
1488 | if (!sparse_keymap_report_event(acer_wmi_input_dev, | ||
1489 | return_value.key_num, 1, true)) | ||
1490 | pr_warn("Unknown key number - 0x%x\n", | 1483 | pr_warn("Unknown key number - 0x%x\n", |
1491 | return_value.key_num); | 1484 | return_value.key_num); |
1485 | } else { | ||
1486 | switch (key->keycode) { | ||
1487 | case KEY_WLAN: | ||
1488 | case KEY_BLUETOOTH: | ||
1489 | if (has_cap(ACER_CAP_WIRELESS)) | ||
1490 | rfkill_set_sw_state(wireless_rfkill, | ||
1491 | !(device_state & ACER_WMID3_GDS_WIRELESS)); | ||
1492 | if (has_cap(ACER_CAP_THREEG)) | ||
1493 | rfkill_set_sw_state(threeg_rfkill, | ||
1494 | !(device_state & ACER_WMID3_GDS_THREEG)); | ||
1495 | if (has_cap(ACER_CAP_BLUETOOTH)) | ||
1496 | rfkill_set_sw_state(bluetooth_rfkill, | ||
1497 | !(device_state & ACER_WMID3_GDS_BLUETOOTH)); | ||
1498 | break; | ||
1499 | } | ||
1500 | sparse_keymap_report_entry(acer_wmi_input_dev, key, | ||
1501 | 1, true); | ||
1502 | } | ||
1492 | break; | 1503 | break; |
1493 | default: | 1504 | default: |
1494 | pr_warn("Unknown function number - %d - %d\n", | 1505 | pr_warn("Unknown function number - %d - %d\n", |
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 00460cb9587b..3c7857c71a23 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c | |||
@@ -1025,6 +1025,7 @@ static int asus_wmi_backlight_init(struct asus_wmi *asus) | |||
1025 | return power; | 1025 | return power; |
1026 | 1026 | ||
1027 | memset(&props, 0, sizeof(struct backlight_properties)); | 1027 | memset(&props, 0, sizeof(struct backlight_properties)); |
1028 | props.type = BACKLIGHT_PLATFORM; | ||
1028 | props.max_brightness = max; | 1029 | props.max_brightness = max; |
1029 | bd = backlight_device_register(asus->driver->name, | 1030 | bd = backlight_device_register(asus->driver->name, |
1030 | &asus->platform_device->dev, asus, | 1031 | &asus->platform_device->dev, asus, |
diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c index 3f204fde1b02..8877b836d27c 100644 --- a/drivers/platform/x86/compal-laptop.c +++ b/drivers/platform/x86/compal-laptop.c | |||
@@ -1030,8 +1030,10 @@ static int __devinit compal_probe(struct platform_device *pdev) | |||
1030 | initialize_fan_control_data(data); | 1030 | initialize_fan_control_data(data); |
1031 | 1031 | ||
1032 | err = sysfs_create_group(&pdev->dev.kobj, &compal_attribute_group); | 1032 | err = sysfs_create_group(&pdev->dev.kobj, &compal_attribute_group); |
1033 | if (err) | 1033 | if (err) { |
1034 | kfree(data); | ||
1034 | return err; | 1035 | return err; |
1036 | } | ||
1035 | 1037 | ||
1036 | data->hwmon_dev = hwmon_device_register(&pdev->dev); | 1038 | data->hwmon_dev = hwmon_device_register(&pdev->dev); |
1037 | if (IS_ERR(data->hwmon_dev)) { | 1039 | if (IS_ERR(data->hwmon_dev)) { |
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c index d3841de6a8cf..e39ab1d3ed87 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c | |||
@@ -292,12 +292,9 @@ static int dell_rfkill_set(void *data, bool blocked) | |||
292 | dell_send_request(buffer, 17, 11); | 292 | dell_send_request(buffer, 17, 11); |
293 | 293 | ||
294 | /* If the hardware switch controls this radio, and the hardware | 294 | /* If the hardware switch controls this radio, and the hardware |
295 | switch is disabled, don't allow changing the software state. | 295 | switch is disabled, don't allow changing the software state */ |
296 | If the hardware switch is reported as not supported, always | ||
297 | fire the SMI to toggle the killswitch. */ | ||
298 | if ((hwswitch_state & BIT(hwswitch_bit)) && | 296 | if ((hwswitch_state & BIT(hwswitch_bit)) && |
299 | !(buffer->output[1] & BIT(16)) && | 297 | !(buffer->output[1] & BIT(16))) { |
300 | (buffer->output[1] & BIT(0))) { | ||
301 | ret = -EINVAL; | 298 | ret = -EINVAL; |
302 | goto out; | 299 | goto out; |
303 | } | 300 | } |
@@ -403,23 +400,6 @@ static const struct file_operations dell_debugfs_fops = { | |||
403 | 400 | ||
404 | static void dell_update_rfkill(struct work_struct *ignored) | 401 | static void dell_update_rfkill(struct work_struct *ignored) |
405 | { | 402 | { |
406 | int status; | ||
407 | |||
408 | get_buffer(); | ||
409 | dell_send_request(buffer, 17, 11); | ||
410 | status = buffer->output[1]; | ||
411 | release_buffer(); | ||
412 | |||
413 | /* if hardware rfkill is not supported, set it explicitly */ | ||
414 | if (!(status & BIT(0))) { | ||
415 | if (wifi_rfkill) | ||
416 | dell_rfkill_set((void *)1, !((status & BIT(17)) >> 17)); | ||
417 | if (bluetooth_rfkill) | ||
418 | dell_rfkill_set((void *)2, !((status & BIT(18)) >> 18)); | ||
419 | if (wwan_rfkill) | ||
420 | dell_rfkill_set((void *)3, !((status & BIT(19)) >> 19)); | ||
421 | } | ||
422 | |||
423 | if (wifi_rfkill) | 403 | if (wifi_rfkill) |
424 | dell_rfkill_query(wifi_rfkill, (void *)1); | 404 | dell_rfkill_query(wifi_rfkill, (void *)1); |
425 | if (bluetooth_rfkill) | 405 | if (bluetooth_rfkill) |
@@ -560,11 +540,11 @@ static int dell_get_intensity(struct backlight_device *bd) | |||
560 | else | 540 | else |
561 | dell_send_request(buffer, 0, 1); | 541 | dell_send_request(buffer, 0, 1); |
562 | 542 | ||
543 | ret = buffer->output[1]; | ||
544 | |||
563 | out: | 545 | out: |
564 | release_buffer(); | 546 | release_buffer(); |
565 | if (ret) | 547 | return ret; |
566 | return ret; | ||
567 | return buffer->output[1]; | ||
568 | } | 548 | } |
569 | 549 | ||
570 | static const struct backlight_ops dell_ops = { | 550 | static const struct backlight_ops dell_ops = { |
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index f94017bcdd6e..e2faa3cbb792 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c | |||
@@ -207,6 +207,7 @@ static int hp_wmi_perform_query(int query, int write, void *buffer, | |||
207 | }; | 207 | }; |
208 | struct acpi_buffer input = { sizeof(struct bios_args), &args }; | 208 | struct acpi_buffer input = { sizeof(struct bios_args), &args }; |
209 | struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL }; | 209 | struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL }; |
210 | u32 rc; | ||
210 | 211 | ||
211 | if (WARN_ON(insize > sizeof(args.data))) | 212 | if (WARN_ON(insize > sizeof(args.data))) |
212 | return -EINVAL; | 213 | return -EINVAL; |
@@ -224,13 +225,13 @@ static int hp_wmi_perform_query(int query, int write, void *buffer, | |||
224 | } | 225 | } |
225 | 226 | ||
226 | bios_return = (struct bios_return *)obj->buffer.pointer; | 227 | bios_return = (struct bios_return *)obj->buffer.pointer; |
228 | rc = bios_return->return_code; | ||
227 | 229 | ||
228 | if (bios_return->return_code) { | 230 | if (rc) { |
229 | if (bios_return->return_code != HPWMI_RET_UNKNOWN_CMDTYPE) | 231 | if (rc != HPWMI_RET_UNKNOWN_CMDTYPE) |
230 | pr_warn("query 0x%x returned error 0x%x\n", | 232 | pr_warn("query 0x%x returned error 0x%x\n", query, rc); |
231 | query, bios_return->return_code); | ||
232 | kfree(obj); | 233 | kfree(obj); |
233 | return bios_return->return_code; | 234 | return rc; |
234 | } | 235 | } |
235 | 236 | ||
236 | if (!outsize) { | 237 | if (!outsize) { |
diff --git a/drivers/platform/x86/intel_oaktrail.c b/drivers/platform/x86/intel_oaktrail.c index e936364a609d..7f88c7923fc6 100644 --- a/drivers/platform/x86/intel_oaktrail.c +++ b/drivers/platform/x86/intel_oaktrail.c | |||
@@ -250,6 +250,7 @@ static int oaktrail_backlight_init(void) | |||
250 | struct backlight_properties props; | 250 | struct backlight_properties props; |
251 | 251 | ||
252 | memset(&props, 0, sizeof(struct backlight_properties)); | 252 | memset(&props, 0, sizeof(struct backlight_properties)); |
253 | props.type = BACKLIGHT_PLATFORM; | ||
253 | props.max_brightness = OT_EC_BL_BRIGHTNESS_MAX; | 254 | props.max_brightness = OT_EC_BL_BRIGHTNESS_MAX; |
254 | bd = backlight_device_register(DRIVER_NAME, | 255 | bd = backlight_device_register(DRIVER_NAME, |
255 | &oaktrail_device->dev, NULL, | 256 | &oaktrail_device->dev, NULL, |
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 77f6e707a2a9..26c5b117df22 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -184,6 +184,10 @@ enum tpacpi_hkey_event_t { | |||
184 | 184 | ||
185 | /* Misc bay events */ | 185 | /* Misc bay events */ |
186 | TP_HKEY_EV_OPTDRV_EJ = 0x3006, /* opt. drive tray ejected */ | 186 | TP_HKEY_EV_OPTDRV_EJ = 0x3006, /* opt. drive tray ejected */ |
187 | TP_HKEY_EV_HOTPLUG_DOCK = 0x4010, /* docked into hotplug dock | ||
188 | or port replicator */ | ||
189 | TP_HKEY_EV_HOTPLUG_UNDOCK = 0x4011, /* undocked from hotplug | ||
190 | dock or port replicator */ | ||
187 | 191 | ||
188 | /* User-interface events */ | 192 | /* User-interface events */ |
189 | TP_HKEY_EV_LID_CLOSE = 0x5001, /* laptop lid closed */ | 193 | TP_HKEY_EV_LID_CLOSE = 0x5001, /* laptop lid closed */ |
@@ -194,6 +198,10 @@ enum tpacpi_hkey_event_t { | |||
194 | TP_HKEY_EV_PEN_REMOVED = 0x500c, /* tablet pen removed */ | 198 | TP_HKEY_EV_PEN_REMOVED = 0x500c, /* tablet pen removed */ |
195 | TP_HKEY_EV_BRGHT_CHANGED = 0x5010, /* backlight control event */ | 199 | TP_HKEY_EV_BRGHT_CHANGED = 0x5010, /* backlight control event */ |
196 | 200 | ||
201 | /* Key-related user-interface events */ | ||
202 | TP_HKEY_EV_KEY_NUMLOCK = 0x6000, /* NumLock key pressed */ | ||
203 | TP_HKEY_EV_KEY_FN = 0x6005, /* Fn key pressed? E420 */ | ||
204 | |||
197 | /* Thermal events */ | 205 | /* Thermal events */ |
198 | TP_HKEY_EV_ALARM_BAT_HOT = 0x6011, /* battery too hot */ | 206 | TP_HKEY_EV_ALARM_BAT_HOT = 0x6011, /* battery too hot */ |
199 | TP_HKEY_EV_ALARM_BAT_XHOT = 0x6012, /* battery critically hot */ | 207 | TP_HKEY_EV_ALARM_BAT_XHOT = 0x6012, /* battery critically hot */ |
@@ -201,6 +209,10 @@ enum tpacpi_hkey_event_t { | |||
201 | TP_HKEY_EV_ALARM_SENSOR_XHOT = 0x6022, /* sensor critically hot */ | 209 | TP_HKEY_EV_ALARM_SENSOR_XHOT = 0x6022, /* sensor critically hot */ |
202 | TP_HKEY_EV_THM_TABLE_CHANGED = 0x6030, /* thermal table changed */ | 210 | TP_HKEY_EV_THM_TABLE_CHANGED = 0x6030, /* thermal table changed */ |
203 | 211 | ||
212 | TP_HKEY_EV_UNK_6040 = 0x6040, /* Related to AC change? | ||
213 | some sort of APM hint, | ||
214 | W520 */ | ||
215 | |||
204 | /* Misc */ | 216 | /* Misc */ |
205 | TP_HKEY_EV_RFKILL_CHANGED = 0x7000, /* rfkill switch changed */ | 217 | TP_HKEY_EV_RFKILL_CHANGED = 0x7000, /* rfkill switch changed */ |
206 | }; | 218 | }; |
@@ -3513,6 +3525,34 @@ static bool hotkey_notify_wakeup(const u32 hkey, | |||
3513 | return true; | 3525 | return true; |
3514 | } | 3526 | } |
3515 | 3527 | ||
3528 | static bool hotkey_notify_dockevent(const u32 hkey, | ||
3529 | bool *send_acpi_ev, | ||
3530 | bool *ignore_acpi_ev) | ||
3531 | { | ||
3532 | /* 0x4000-0x4FFF: dock-related events */ | ||
3533 | *send_acpi_ev = true; | ||
3534 | *ignore_acpi_ev = false; | ||
3535 | |||
3536 | switch (hkey) { | ||
3537 | case TP_HKEY_EV_UNDOCK_ACK: | ||
3538 | /* ACPI undock operation completed after wakeup */ | ||
3539 | hotkey_autosleep_ack = 1; | ||
3540 | pr_info("undocked\n"); | ||
3541 | hotkey_wakeup_hotunplug_complete_notify_change(); | ||
3542 | return true; | ||
3543 | |||
3544 | case TP_HKEY_EV_HOTPLUG_DOCK: /* docked to port replicator */ | ||
3545 | pr_info("docked into hotplug port replicator\n"); | ||
3546 | return true; | ||
3547 | case TP_HKEY_EV_HOTPLUG_UNDOCK: /* undocked from port replicator */ | ||
3548 | pr_info("undocked from hotplug port replicator\n"); | ||
3549 | return true; | ||
3550 | |||
3551 | default: | ||
3552 | return false; | ||
3553 | } | ||
3554 | } | ||
3555 | |||
3516 | static bool hotkey_notify_usrevent(const u32 hkey, | 3556 | static bool hotkey_notify_usrevent(const u32 hkey, |
3517 | bool *send_acpi_ev, | 3557 | bool *send_acpi_ev, |
3518 | bool *ignore_acpi_ev) | 3558 | bool *ignore_acpi_ev) |
@@ -3547,13 +3587,13 @@ static bool hotkey_notify_usrevent(const u32 hkey, | |||
3547 | 3587 | ||
3548 | static void thermal_dump_all_sensors(void); | 3588 | static void thermal_dump_all_sensors(void); |
3549 | 3589 | ||
3550 | static bool hotkey_notify_thermal(const u32 hkey, | 3590 | static bool hotkey_notify_6xxx(const u32 hkey, |
3551 | bool *send_acpi_ev, | 3591 | bool *send_acpi_ev, |
3552 | bool *ignore_acpi_ev) | 3592 | bool *ignore_acpi_ev) |
3553 | { | 3593 | { |
3554 | bool known = true; | 3594 | bool known = true; |
3555 | 3595 | ||
3556 | /* 0x6000-0x6FFF: thermal alarms */ | 3596 | /* 0x6000-0x6FFF: thermal alarms/notices and keyboard events */ |
3557 | *send_acpi_ev = true; | 3597 | *send_acpi_ev = true; |
3558 | *ignore_acpi_ev = false; | 3598 | *ignore_acpi_ev = false; |
3559 | 3599 | ||
@@ -3582,8 +3622,17 @@ static bool hotkey_notify_thermal(const u32 hkey, | |||
3582 | "a sensor reports something is extremely hot!\n"); | 3622 | "a sensor reports something is extremely hot!\n"); |
3583 | /* recommended action: immediate sleep/hibernate */ | 3623 | /* recommended action: immediate sleep/hibernate */ |
3584 | break; | 3624 | break; |
3625 | |||
3626 | case TP_HKEY_EV_KEY_NUMLOCK: | ||
3627 | case TP_HKEY_EV_KEY_FN: | ||
3628 | /* key press events, we just ignore them as long as the EC | ||
3629 | * is still reporting them in the normal keyboard stream */ | ||
3630 | *send_acpi_ev = false; | ||
3631 | *ignore_acpi_ev = true; | ||
3632 | return true; | ||
3633 | |||
3585 | default: | 3634 | default: |
3586 | pr_alert("THERMAL ALERT: unknown thermal alarm received\n"); | 3635 | pr_warn("unknown possible thermal alarm or keyboard event received\n"); |
3587 | known = false; | 3636 | known = false; |
3588 | } | 3637 | } |
3589 | 3638 | ||
@@ -3652,15 +3701,9 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) | |||
3652 | } | 3701 | } |
3653 | break; | 3702 | break; |
3654 | case 4: | 3703 | case 4: |
3655 | /* 0x4000-0x4FFF: dock-related wakeups */ | 3704 | /* 0x4000-0x4FFF: dock-related events */ |
3656 | if (hkey == TP_HKEY_EV_UNDOCK_ACK) { | 3705 | known_ev = hotkey_notify_dockevent(hkey, &send_acpi_ev, |
3657 | hotkey_autosleep_ack = 1; | 3706 | &ignore_acpi_ev); |
3658 | pr_info("undocked\n"); | ||
3659 | hotkey_wakeup_hotunplug_complete_notify_change(); | ||
3660 | known_ev = true; | ||
3661 | } else { | ||
3662 | known_ev = false; | ||
3663 | } | ||
3664 | break; | 3707 | break; |
3665 | case 5: | 3708 | case 5: |
3666 | /* 0x5000-0x5FFF: human interface helpers */ | 3709 | /* 0x5000-0x5FFF: human interface helpers */ |
@@ -3668,8 +3711,9 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) | |||
3668 | &ignore_acpi_ev); | 3711 | &ignore_acpi_ev); |
3669 | break; | 3712 | break; |
3670 | case 6: | 3713 | case 6: |
3671 | /* 0x6000-0x6FFF: thermal alarms */ | 3714 | /* 0x6000-0x6FFF: thermal alarms/notices and |
3672 | known_ev = hotkey_notify_thermal(hkey, &send_acpi_ev, | 3715 | * keyboard events */ |
3716 | known_ev = hotkey_notify_6xxx(hkey, &send_acpi_ev, | ||
3673 | &ignore_acpi_ev); | 3717 | &ignore_acpi_ev); |
3674 | break; | 3718 | break; |
3675 | case 7: | 3719 | case 7: |
diff --git a/drivers/regulator/db8500-prcmu.c b/drivers/regulator/db8500-prcmu.c index e5f7b8fe51f4..2bb8f451cc06 100644 --- a/drivers/regulator/db8500-prcmu.c +++ b/drivers/regulator/db8500-prcmu.c | |||
@@ -266,7 +266,7 @@ static struct regulator_ops db8500_regulator_switch_ops = { | |||
266 | * Regulator information | 266 | * Regulator information |
267 | */ | 267 | */ |
268 | static struct db8500_regulator_info | 268 | static struct db8500_regulator_info |
269 | db8500_regulator_info[DB8500_NUM_REGULATORS] = { | 269 | db8500_regulator_info[DB8500_NUM_REGULATORS] = { |
270 | [DB8500_REGULATOR_VAPE] = { | 270 | [DB8500_REGULATOR_VAPE] = { |
271 | .desc = { | 271 | .desc = { |
272 | .name = "db8500-vape", | 272 | .name = "db8500-vape", |
@@ -492,11 +492,9 @@ static int __devinit db8500_regulator_probe(struct platform_device *pdev) | |||
492 | info->desc.name, err); | 492 | info->desc.name, err); |
493 | 493 | ||
494 | /* if failing, unregister all earlier regulators */ | 494 | /* if failing, unregister all earlier regulators */ |
495 | i--; | 495 | while (--i >= 0) { |
496 | while (i >= 0) { | ||
497 | info = &db8500_regulator_info[i]; | 496 | info = &db8500_regulator_info[i]; |
498 | regulator_unregister(info->rdev); | 497 | regulator_unregister(info->rdev); |
499 | i--; | ||
500 | } | 498 | } |
501 | return err; | 499 | return err; |
502 | } | 500 | } |
@@ -536,13 +534,7 @@ static struct platform_driver db8500_regulator_driver = { | |||
536 | 534 | ||
537 | static int __init db8500_regulator_init(void) | 535 | static int __init db8500_regulator_init(void) |
538 | { | 536 | { |
539 | int ret; | 537 | return platform_driver_register(&db8500_regulator_driver); |
540 | |||
541 | ret = platform_driver_register(&db8500_regulator_driver); | ||
542 | if (ret < 0) | ||
543 | return -ENODEV; | ||
544 | |||
545 | return 0; | ||
546 | } | 538 | } |
547 | 539 | ||
548 | static void __exit db8500_regulator_exit(void) | 540 | static void __exit db8500_regulator_exit(void) |
diff --git a/drivers/regulator/max8952.c b/drivers/regulator/max8952.c index daff7fd0e95c..486ed8141fcd 100644 --- a/drivers/regulator/max8952.c +++ b/drivers/regulator/max8952.c | |||
@@ -139,7 +139,7 @@ static int max8952_set_voltage(struct regulator_dev *rdev, | |||
139 | s8 vid = -1, i; | 139 | s8 vid = -1, i; |
140 | 140 | ||
141 | if (!gpio_is_valid(max8952->pdata->gpio_vid0) || | 141 | if (!gpio_is_valid(max8952->pdata->gpio_vid0) || |
142 | !gpio_is_valid(max8952->pdata->gpio_vid0)) { | 142 | !gpio_is_valid(max8952->pdata->gpio_vid1)) { |
143 | /* DVS not supported */ | 143 | /* DVS not supported */ |
144 | return -EPERM; | 144 | return -EPERM; |
145 | } | 145 | } |
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index 10d5a1d9768e..ad6628ca94f4 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c | |||
@@ -39,25 +39,28 @@ struct max8997_data { | |||
39 | struct regulator_dev **rdev; | 39 | struct regulator_dev **rdev; |
40 | int ramp_delay; /* in mV/us */ | 40 | int ramp_delay; /* in mV/us */ |
41 | 41 | ||
42 | bool buck1_gpiodvs; | ||
43 | bool buck2_gpiodvs; | ||
44 | bool buck5_gpiodvs; | ||
42 | u8 buck1_vol[8]; | 45 | u8 buck1_vol[8]; |
43 | u8 buck2_vol[8]; | 46 | u8 buck2_vol[8]; |
44 | u8 buck5_vol[8]; | 47 | u8 buck5_vol[8]; |
48 | int buck125_gpios[3]; | ||
45 | int buck125_gpioindex; | 49 | int buck125_gpioindex; |
50 | bool ignore_gpiodvs_side_effect; | ||
46 | 51 | ||
47 | u8 saved_states[MAX8997_REG_MAX]; | 52 | u8 saved_states[MAX8997_REG_MAX]; |
48 | }; | 53 | }; |
49 | 54 | ||
50 | static inline void max8997_set_gpio(struct max8997_data *max8997) | 55 | static inline void max8997_set_gpio(struct max8997_data *max8997) |
51 | { | 56 | { |
52 | struct max8997_platform_data *pdata = | ||
53 | dev_get_platdata(max8997->iodev->dev); | ||
54 | int set3 = (max8997->buck125_gpioindex) & 0x1; | 57 | int set3 = (max8997->buck125_gpioindex) & 0x1; |
55 | int set2 = ((max8997->buck125_gpioindex) >> 1) & 0x1; | 58 | int set2 = ((max8997->buck125_gpioindex) >> 1) & 0x1; |
56 | int set1 = ((max8997->buck125_gpioindex) >> 2) & 0x1; | 59 | int set1 = ((max8997->buck125_gpioindex) >> 2) & 0x1; |
57 | 60 | ||
58 | gpio_set_value(pdata->buck125_gpios[0], set1); | 61 | gpio_set_value(max8997->buck125_gpios[0], set1); |
59 | gpio_set_value(pdata->buck125_gpios[1], set2); | 62 | gpio_set_value(max8997->buck125_gpios[1], set2); |
60 | gpio_set_value(pdata->buck125_gpios[2], set3); | 63 | gpio_set_value(max8997->buck125_gpios[2], set3); |
61 | } | 64 | } |
62 | 65 | ||
63 | struct voltage_map_desc { | 66 | struct voltage_map_desc { |
@@ -380,8 +383,6 @@ static int max8997_get_voltage_register(struct regulator_dev *rdev, | |||
380 | static int max8997_get_voltage(struct regulator_dev *rdev) | 383 | static int max8997_get_voltage(struct regulator_dev *rdev) |
381 | { | 384 | { |
382 | struct max8997_data *max8997 = rdev_get_drvdata(rdev); | 385 | struct max8997_data *max8997 = rdev_get_drvdata(rdev); |
383 | struct max8997_platform_data *pdata = | ||
384 | dev_get_platdata(max8997->iodev->dev); | ||
385 | struct i2c_client *i2c = max8997->iodev->i2c; | 386 | struct i2c_client *i2c = max8997->iodev->i2c; |
386 | int reg, shift, mask, ret; | 387 | int reg, shift, mask, ret; |
387 | int rid = max8997_get_rid(rdev); | 388 | int rid = max8997_get_rid(rdev); |
@@ -391,9 +392,9 @@ static int max8997_get_voltage(struct regulator_dev *rdev) | |||
391 | if (ret) | 392 | if (ret) |
392 | return ret; | 393 | return ret; |
393 | 394 | ||
394 | if ((rid == MAX8997_BUCK1 && pdata->buck1_gpiodvs) || | 395 | if ((rid == MAX8997_BUCK1 && max8997->buck1_gpiodvs) || |
395 | (rid == MAX8997_BUCK2 && pdata->buck2_gpiodvs) || | 396 | (rid == MAX8997_BUCK2 && max8997->buck2_gpiodvs) || |
396 | (rid == MAX8997_BUCK5 && pdata->buck5_gpiodvs)) | 397 | (rid == MAX8997_BUCK5 && max8997->buck5_gpiodvs)) |
397 | reg += max8997->buck125_gpioindex; | 398 | reg += max8997->buck125_gpioindex; |
398 | 399 | ||
399 | ret = max8997_read_reg(i2c, reg, &val); | 400 | ret = max8997_read_reg(i2c, reg, &val); |
@@ -543,7 +544,8 @@ static int max8997_set_voltage_ldobuck(struct regulator_dev *rdev, | |||
543 | rid == MAX8997_BUCK4 || rid == MAX8997_BUCK5) { | 544 | rid == MAX8997_BUCK4 || rid == MAX8997_BUCK5) { |
544 | /* If the voltage is increasing */ | 545 | /* If the voltage is increasing */ |
545 | if (org < i) | 546 | if (org < i) |
546 | udelay(desc->step * (i - org) / max8997->ramp_delay); | 547 | udelay(DIV_ROUND_UP(desc->step * (i - org), |
548 | max8997->ramp_delay)); | ||
547 | } | 549 | } |
548 | 550 | ||
549 | return ret; | 551 | return ret; |
@@ -561,8 +563,6 @@ static int max8997_assess_side_effect(struct regulator_dev *rdev, | |||
561 | u8 new_val, int *best) | 563 | u8 new_val, int *best) |
562 | { | 564 | { |
563 | struct max8997_data *max8997 = rdev_get_drvdata(rdev); | 565 | struct max8997_data *max8997 = rdev_get_drvdata(rdev); |
564 | struct max8997_platform_data *pdata = | ||
565 | dev_get_platdata(max8997->iodev->dev); | ||
566 | int rid = max8997_get_rid(rdev); | 566 | int rid = max8997_get_rid(rdev); |
567 | u8 *buckx_val[3]; | 567 | u8 *buckx_val[3]; |
568 | bool buckx_gpiodvs[3]; | 568 | bool buckx_gpiodvs[3]; |
@@ -589,9 +589,9 @@ static int max8997_assess_side_effect(struct regulator_dev *rdev, | |||
589 | buckx_val[0] = max8997->buck1_vol; | 589 | buckx_val[0] = max8997->buck1_vol; |
590 | buckx_val[1] = max8997->buck2_vol; | 590 | buckx_val[1] = max8997->buck2_vol; |
591 | buckx_val[2] = max8997->buck5_vol; | 591 | buckx_val[2] = max8997->buck5_vol; |
592 | buckx_gpiodvs[0] = pdata->buck1_gpiodvs; | 592 | buckx_gpiodvs[0] = max8997->buck1_gpiodvs; |
593 | buckx_gpiodvs[1] = pdata->buck2_gpiodvs; | 593 | buckx_gpiodvs[1] = max8997->buck2_gpiodvs; |
594 | buckx_gpiodvs[2] = pdata->buck5_gpiodvs; | 594 | buckx_gpiodvs[2] = max8997->buck5_gpiodvs; |
595 | 595 | ||
596 | for (i = 0; i < 8; i++) { | 596 | for (i = 0; i < 8; i++) { |
597 | int others; | 597 | int others; |
@@ -640,8 +640,6 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev, | |||
640 | int min_uV, int max_uV, unsigned *selector) | 640 | int min_uV, int max_uV, unsigned *selector) |
641 | { | 641 | { |
642 | struct max8997_data *max8997 = rdev_get_drvdata(rdev); | 642 | struct max8997_data *max8997 = rdev_get_drvdata(rdev); |
643 | struct max8997_platform_data *pdata = | ||
644 | dev_get_platdata(max8997->iodev->dev); | ||
645 | int rid = max8997_get_rid(rdev); | 643 | int rid = max8997_get_rid(rdev); |
646 | const struct voltage_map_desc *desc; | 644 | const struct voltage_map_desc *desc; |
647 | int new_val, new_idx, damage, tmp_val, tmp_idx, tmp_dmg; | 645 | int new_val, new_idx, damage, tmp_val, tmp_idx, tmp_dmg; |
@@ -653,15 +651,15 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev, | |||
653 | 651 | ||
654 | switch (rid) { | 652 | switch (rid) { |
655 | case MAX8997_BUCK1: | 653 | case MAX8997_BUCK1: |
656 | if (pdata->buck1_gpiodvs) | 654 | if (max8997->buck1_gpiodvs) |
657 | gpio_dvs_mode = true; | 655 | gpio_dvs_mode = true; |
658 | break; | 656 | break; |
659 | case MAX8997_BUCK2: | 657 | case MAX8997_BUCK2: |
660 | if (pdata->buck2_gpiodvs) | 658 | if (max8997->buck2_gpiodvs) |
661 | gpio_dvs_mode = true; | 659 | gpio_dvs_mode = true; |
662 | break; | 660 | break; |
663 | case MAX8997_BUCK5: | 661 | case MAX8997_BUCK5: |
664 | if (pdata->buck5_gpiodvs) | 662 | if (max8997->buck5_gpiodvs) |
665 | gpio_dvs_mode = true; | 663 | gpio_dvs_mode = true; |
666 | break; | 664 | break; |
667 | } | 665 | } |
@@ -695,7 +693,7 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev, | |||
695 | new_idx = tmp_idx; | 693 | new_idx = tmp_idx; |
696 | new_val = tmp_val; | 694 | new_val = tmp_val; |
697 | 695 | ||
698 | if (pdata->ignore_gpiodvs_side_effect == false) | 696 | if (max8997->ignore_gpiodvs_side_effect == false) |
699 | return -EINVAL; | 697 | return -EINVAL; |
700 | 698 | ||
701 | dev_warn(&rdev->dev, "MAX8997 GPIO-DVS Side Effect Warning: GPIO SET:" | 699 | dev_warn(&rdev->dev, "MAX8997 GPIO-DVS Side Effect Warning: GPIO SET:" |
@@ -993,6 +991,11 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev) | |||
993 | i2c = max8997->iodev->i2c; | 991 | i2c = max8997->iodev->i2c; |
994 | 992 | ||
995 | max8997->buck125_gpioindex = pdata->buck125_default_idx; | 993 | max8997->buck125_gpioindex = pdata->buck125_default_idx; |
994 | max8997->buck1_gpiodvs = pdata->buck1_gpiodvs; | ||
995 | max8997->buck2_gpiodvs = pdata->buck2_gpiodvs; | ||
996 | max8997->buck5_gpiodvs = pdata->buck5_gpiodvs; | ||
997 | memcpy(max8997->buck125_gpios, pdata->buck125_gpios, sizeof(int) * 3); | ||
998 | max8997->ignore_gpiodvs_side_effect = pdata->ignore_gpiodvs_side_effect; | ||
996 | 999 | ||
997 | for (i = 0; i < 8; i++) { | 1000 | for (i = 0; i < 8; i++) { |
998 | max8997->buck1_vol[i] = ret = | 1001 | max8997->buck1_vol[i] = ret = |
@@ -1124,6 +1127,10 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev) | |||
1124 | 0x3f); | 1127 | 0x3f); |
1125 | } | 1128 | } |
1126 | 1129 | ||
1130 | /* Misc Settings */ | ||
1131 | max8997->ramp_delay = 10; /* set 10mV/us, which is the default */ | ||
1132 | max8997_write_reg(i2c, MAX8997_REG_BUCKRAMP, (0xf << 4) | 0x9); | ||
1133 | |||
1127 | for (i = 0; i < pdata->num_regulators; i++) { | 1134 | for (i = 0; i < pdata->num_regulators; i++) { |
1128 | const struct voltage_map_desc *desc; | 1135 | const struct voltage_map_desc *desc; |
1129 | int id = pdata->regulators[i].id; | 1136 | int id = pdata->regulators[i].id; |
@@ -1148,10 +1155,6 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev) | |||
1148 | } | 1155 | } |
1149 | } | 1156 | } |
1150 | 1157 | ||
1151 | /* Misc Settings */ | ||
1152 | max8997->ramp_delay = 10; /* set 10mV/us, which is the default */ | ||
1153 | max8997_write_reg(i2c, MAX8997_REG_BUCKRAMP, (0xf << 4) | 0x9); | ||
1154 | |||
1155 | return 0; | 1158 | return 0; |
1156 | err: | 1159 | err: |
1157 | for (i = 0; i < max8997->num_regulators; i++) | 1160 | for (i = 0; i < max8997->num_regulators; i++) |
diff --git a/drivers/spi/spi_s3c64xx.c b/drivers/spi/spi_s3c64xx.c index 795828b90f45..8945e201e42e 100644 --- a/drivers/spi/spi_s3c64xx.c +++ b/drivers/spi/spi_s3c64xx.c | |||
@@ -116,9 +116,7 @@ | |||
116 | (((i)->fifo_lvl_mask + 1))) \ | 116 | (((i)->fifo_lvl_mask + 1))) \ |
117 | ? 1 : 0) | 117 | ? 1 : 0) |
118 | 118 | ||
119 | #define S3C64XX_SPI_ST_TX_DONE(v, i) ((((v) >> (i)->rx_lvl_offset) & \ | 119 | #define S3C64XX_SPI_ST_TX_DONE(v, i) (((v) & (1 << (i)->tx_st_done)) ? 1 : 0) |
120 | (((i)->fifo_lvl_mask + 1) << 1)) \ | ||
121 | ? 1 : 0) | ||
122 | #define TX_FIFO_LVL(v, i) (((v) >> 6) & (i)->fifo_lvl_mask) | 120 | #define TX_FIFO_LVL(v, i) (((v) >> 6) & (i)->fifo_lvl_mask) |
123 | #define RX_FIFO_LVL(v, i) (((v) >> (i)->rx_lvl_offset) & (i)->fifo_lvl_mask) | 121 | #define RX_FIFO_LVL(v, i) (((v) >> (i)->rx_lvl_offset) & (i)->fifo_lvl_mask) |
124 | 122 | ||
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index e0719b4ee189..0b5ec234c787 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -1147,6 +1147,14 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0) | |||
1147 | * any drivers bound to them (a key side effect) | 1147 | * any drivers bound to them (a key side effect) |
1148 | */ | 1148 | */ |
1149 | if (dev->actconfig) { | 1149 | if (dev->actconfig) { |
1150 | /* | ||
1151 | * FIXME: In order to avoid self-deadlock involving the | ||
1152 | * bandwidth_mutex, we have to mark all the interfaces | ||
1153 | * before unregistering any of them. | ||
1154 | */ | ||
1155 | for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) | ||
1156 | dev->actconfig->interface[i]->unregistering = 1; | ||
1157 | |||
1150 | for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) { | 1158 | for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) { |
1151 | struct usb_interface *interface; | 1159 | struct usb_interface *interface; |
1152 | 1160 | ||
@@ -1156,7 +1164,6 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0) | |||
1156 | continue; | 1164 | continue; |
1157 | dev_dbg(&dev->dev, "unregistering interface %s\n", | 1165 | dev_dbg(&dev->dev, "unregistering interface %s\n", |
1158 | dev_name(&interface->dev)); | 1166 | dev_name(&interface->dev)); |
1159 | interface->unregistering = 1; | ||
1160 | remove_intf_ep_devs(interface); | 1167 | remove_intf_ep_devs(interface); |
1161 | device_del(&interface->dev); | 1168 | device_del(&interface->dev); |
1162 | } | 1169 | } |
diff --git a/drivers/w1/masters/ds1wm.c b/drivers/w1/masters/ds1wm.c index ad57593d224a..a0c8965c1a79 100644 --- a/drivers/w1/masters/ds1wm.c +++ b/drivers/w1/masters/ds1wm.c | |||
@@ -109,6 +109,7 @@ struct ds1wm_data { | |||
109 | /* byte to write that makes all intr disabled, */ | 109 | /* byte to write that makes all intr disabled, */ |
110 | /* considering active_state (IAS) (optimization) */ | 110 | /* considering active_state (IAS) (optimization) */ |
111 | u8 int_en_reg_none; | 111 | u8 int_en_reg_none; |
112 | unsigned int reset_recover_delay; /* see ds1wm.h */ | ||
112 | }; | 113 | }; |
113 | 114 | ||
114 | static inline void ds1wm_write_register(struct ds1wm_data *ds1wm_data, u32 reg, | 115 | static inline void ds1wm_write_register(struct ds1wm_data *ds1wm_data, u32 reg, |
@@ -187,6 +188,9 @@ static int ds1wm_reset(struct ds1wm_data *ds1wm_data) | |||
187 | return 1; | 188 | return 1; |
188 | } | 189 | } |
189 | 190 | ||
191 | if (ds1wm_data->reset_recover_delay) | ||
192 | msleep(ds1wm_data->reset_recover_delay); | ||
193 | |||
190 | return 0; | 194 | return 0; |
191 | } | 195 | } |
192 | 196 | ||
@@ -490,6 +494,7 @@ static int ds1wm_probe(struct platform_device *pdev) | |||
490 | } | 494 | } |
491 | ds1wm_data->irq = res->start; | 495 | ds1wm_data->irq = res->start; |
492 | ds1wm_data->int_en_reg_none = (plat->active_high ? DS1WM_INTEN_IAS : 0); | 496 | ds1wm_data->int_en_reg_none = (plat->active_high ? DS1WM_INTEN_IAS : 0); |
497 | ds1wm_data->reset_recover_delay = plat->reset_recover_delay; | ||
493 | 498 | ||
494 | if (res->flags & IORESOURCE_IRQ_HIGHEDGE) | 499 | if (res->flags & IORESOURCE_IRQ_HIGHEDGE) |
495 | irq_set_irq_type(ds1wm_data->irq, IRQ_TYPE_EDGE_RISING); | 500 | irq_set_irq_type(ds1wm_data->irq, IRQ_TYPE_EDGE_RISING); |
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index f30ac05dbda7..3b859a3e6a0e 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -1335,6 +1335,11 @@ struct btrfs_ioctl_defrag_range_args { | |||
1335 | */ | 1335 | */ |
1336 | #define BTRFS_STRING_ITEM_KEY 253 | 1336 | #define BTRFS_STRING_ITEM_KEY 253 |
1337 | 1337 | ||
1338 | /* | ||
1339 | * Flags for mount options. | ||
1340 | * | ||
1341 | * Note: don't forget to add new options to btrfs_show_options() | ||
1342 | */ | ||
1338 | #define BTRFS_MOUNT_NODATASUM (1 << 0) | 1343 | #define BTRFS_MOUNT_NODATASUM (1 << 0) |
1339 | #define BTRFS_MOUNT_NODATACOW (1 << 1) | 1344 | #define BTRFS_MOUNT_NODATACOW (1 << 1) |
1340 | #define BTRFS_MOUNT_NOBARRIER (1 << 2) | 1345 | #define BTRFS_MOUNT_NOBARRIER (1 << 2) |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index d340f63d8f07..3601f0aebddf 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -2678,12 +2678,14 @@ noinline int btrfs_update_inode(struct btrfs_trans_handle *trans, | |||
2678 | int ret; | 2678 | int ret; |
2679 | 2679 | ||
2680 | /* | 2680 | /* |
2681 | * If root is tree root, it means this inode is used to | 2681 | * If the inode is a free space inode, we can deadlock during commit |
2682 | * store free space information. And these inodes are updated | 2682 | * if we put it into the delayed code. |
2683 | * when committing the transaction, so they needn't delaye to | 2683 | * |
2684 | * be updated, or deadlock will occured. | 2684 | * The data relocation inode should also be directly updated |
2685 | * without delay | ||
2685 | */ | 2686 | */ |
2686 | if (!is_free_space_inode(root, inode)) { | 2687 | if (!is_free_space_inode(root, inode) |
2688 | && root->root_key.objectid != BTRFS_DATA_RELOC_TREE_OBJECTID) { | ||
2687 | ret = btrfs_delayed_update_inode(trans, root, inode); | 2689 | ret = btrfs_delayed_update_inode(trans, root, inode); |
2688 | if (!ret) | 2690 | if (!ret) |
2689 | btrfs_set_inode_last_trans(trans, inode); | 2691 | btrfs_set_inode_last_trans(trans, inode); |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 0bb4ebbb71b7..15634d4648d7 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -723,6 +723,12 @@ static int btrfs_show_options(struct seq_file *seq, struct vfsmount *vfs) | |||
723 | seq_puts(seq, ",clear_cache"); | 723 | seq_puts(seq, ",clear_cache"); |
724 | if (btrfs_test_opt(root, USER_SUBVOL_RM_ALLOWED)) | 724 | if (btrfs_test_opt(root, USER_SUBVOL_RM_ALLOWED)) |
725 | seq_puts(seq, ",user_subvol_rm_allowed"); | 725 | seq_puts(seq, ",user_subvol_rm_allowed"); |
726 | if (btrfs_test_opt(root, ENOSPC_DEBUG)) | ||
727 | seq_puts(seq, ",enospc_debug"); | ||
728 | if (btrfs_test_opt(root, AUTO_DEFRAG)) | ||
729 | seq_puts(seq, ",autodefrag"); | ||
730 | if (btrfs_test_opt(root, INODE_MAP_CACHE)) | ||
731 | seq_puts(seq, ",inode_cache"); | ||
726 | return 0; | 732 | return 0; |
727 | } | 733 | } |
728 | 734 | ||
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 1efa56e18f9b..19450bc53632 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -2098,7 +2098,8 @@ int btrfs_balance(struct btrfs_root *dev_root) | |||
2098 | chunk_root->root_key.objectid, | 2098 | chunk_root->root_key.objectid, |
2099 | found_key.objectid, | 2099 | found_key.objectid, |
2100 | found_key.offset); | 2100 | found_key.offset); |
2101 | BUG_ON(ret && ret != -ENOSPC); | 2101 | if (ret && ret != -ENOSPC) |
2102 | goto error; | ||
2102 | key.offset = found_key.offset - 1; | 2103 | key.offset = found_key.offset - 1; |
2103 | } | 2104 | } |
2104 | ret = 0; | 2105 | ret = 0; |
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 35f9154615fa..3e2989976297 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -649,9 +649,9 @@ cifs_do_mount(struct file_system_type *fs_type, | |||
649 | 649 | ||
650 | cFYI(1, "Devname: %s flags: %d ", dev_name, flags); | 650 | cFYI(1, "Devname: %s flags: %d ", dev_name, flags); |
651 | 651 | ||
652 | rc = cifs_setup_volume_info(&volume_info, (char *)data, dev_name); | 652 | volume_info = cifs_get_volume_info((char *)data, dev_name); |
653 | if (rc) | 653 | if (IS_ERR(volume_info)) |
654 | return ERR_PTR(rc); | 654 | return ERR_CAST(volume_info); |
655 | 655 | ||
656 | cifs_sb = kzalloc(sizeof(struct cifs_sb_info), GFP_KERNEL); | 656 | cifs_sb = kzalloc(sizeof(struct cifs_sb_info), GFP_KERNEL); |
657 | if (cifs_sb == NULL) { | 657 | if (cifs_sb == NULL) { |
@@ -713,7 +713,7 @@ cifs_do_mount(struct file_system_type *fs_type, | |||
713 | out_super: | 713 | out_super: |
714 | deactivate_locked_super(sb); | 714 | deactivate_locked_super(sb); |
715 | out: | 715 | out: |
716 | cifs_cleanup_volume_info(&volume_info); | 716 | cifs_cleanup_volume_info(volume_info); |
717 | return root; | 717 | return root; |
718 | 718 | ||
719 | out_mountdata: | 719 | out_mountdata: |
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index 257f312ede42..8df28e925e5b 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h | |||
@@ -154,9 +154,9 @@ extern int set_cifs_acl(struct cifs_ntsd *, __u32, struct inode *, | |||
154 | extern void cifs_setup_cifs_sb(struct smb_vol *pvolume_info, | 154 | extern void cifs_setup_cifs_sb(struct smb_vol *pvolume_info, |
155 | struct cifs_sb_info *cifs_sb); | 155 | struct cifs_sb_info *cifs_sb); |
156 | extern int cifs_match_super(struct super_block *, void *); | 156 | extern int cifs_match_super(struct super_block *, void *); |
157 | extern void cifs_cleanup_volume_info(struct smb_vol **pvolume_info); | 157 | extern void cifs_cleanup_volume_info(struct smb_vol *pvolume_info); |
158 | extern int cifs_setup_volume_info(struct smb_vol **pvolume_info, | 158 | extern struct smb_vol *cifs_get_volume_info(char *mount_data, |
159 | char *mount_data, const char *devname); | 159 | const char *devname); |
160 | extern int cifs_mount(struct cifs_sb_info *, struct smb_vol *); | 160 | extern int cifs_mount(struct cifs_sb_info *, struct smb_vol *); |
161 | extern void cifs_umount(struct cifs_sb_info *); | 161 | extern void cifs_umount(struct cifs_sb_info *); |
162 | extern void cifs_dfs_release_automount_timer(void); | 162 | extern void cifs_dfs_release_automount_timer(void); |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index c8cb83ef6f6f..dbd669cc5bc7 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -65,6 +65,8 @@ static int ip_connect(struct TCP_Server_Info *server); | |||
65 | static int generic_ip_connect(struct TCP_Server_Info *server); | 65 | static int generic_ip_connect(struct TCP_Server_Info *server); |
66 | static void tlink_rb_insert(struct rb_root *root, struct tcon_link *new_tlink); | 66 | static void tlink_rb_insert(struct rb_root *root, struct tcon_link *new_tlink); |
67 | static void cifs_prune_tlinks(struct work_struct *work); | 67 | static void cifs_prune_tlinks(struct work_struct *work); |
68 | static int cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data, | ||
69 | const char *devname); | ||
68 | 70 | ||
69 | /* | 71 | /* |
70 | * cifs tcp session reconnection | 72 | * cifs tcp session reconnection |
@@ -2240,8 +2242,8 @@ cifs_match_super(struct super_block *sb, void *data) | |||
2240 | 2242 | ||
2241 | rc = compare_mount_options(sb, mnt_data); | 2243 | rc = compare_mount_options(sb, mnt_data); |
2242 | out: | 2244 | out: |
2243 | cifs_put_tlink(tlink); | ||
2244 | spin_unlock(&cifs_tcp_ses_lock); | 2245 | spin_unlock(&cifs_tcp_ses_lock); |
2246 | cifs_put_tlink(tlink); | ||
2245 | return rc; | 2247 | return rc; |
2246 | } | 2248 | } |
2247 | 2249 | ||
@@ -2830,15 +2832,9 @@ is_path_accessible(int xid, struct cifs_tcon *tcon, | |||
2830 | return rc; | 2832 | return rc; |
2831 | } | 2833 | } |
2832 | 2834 | ||
2833 | void | 2835 | static void |
2834 | cifs_cleanup_volume_info(struct smb_vol **pvolume_info) | 2836 | cleanup_volume_info_contents(struct smb_vol *volume_info) |
2835 | { | 2837 | { |
2836 | struct smb_vol *volume_info; | ||
2837 | |||
2838 | if (!pvolume_info || !*pvolume_info) | ||
2839 | return; | ||
2840 | |||
2841 | volume_info = *pvolume_info; | ||
2842 | kfree(volume_info->username); | 2838 | kfree(volume_info->username); |
2843 | kzfree(volume_info->password); | 2839 | kzfree(volume_info->password); |
2844 | kfree(volume_info->UNC); | 2840 | kfree(volume_info->UNC); |
@@ -2846,28 +2842,44 @@ cifs_cleanup_volume_info(struct smb_vol **pvolume_info) | |||
2846 | kfree(volume_info->domainname); | 2842 | kfree(volume_info->domainname); |
2847 | kfree(volume_info->iocharset); | 2843 | kfree(volume_info->iocharset); |
2848 | kfree(volume_info->prepath); | 2844 | kfree(volume_info->prepath); |
2845 | } | ||
2846 | |||
2847 | void | ||
2848 | cifs_cleanup_volume_info(struct smb_vol *volume_info) | ||
2849 | { | ||
2850 | if (!volume_info) | ||
2851 | return; | ||
2852 | cleanup_volume_info_contents(volume_info); | ||
2849 | kfree(volume_info); | 2853 | kfree(volume_info); |
2850 | *pvolume_info = NULL; | ||
2851 | return; | ||
2852 | } | 2854 | } |
2853 | 2855 | ||
2856 | |||
2854 | #ifdef CONFIG_CIFS_DFS_UPCALL | 2857 | #ifdef CONFIG_CIFS_DFS_UPCALL |
2855 | /* build_path_to_root returns full path to root when | 2858 | /* build_path_to_root returns full path to root when |
2856 | * we do not have an exiting connection (tcon) */ | 2859 | * we do not have an exiting connection (tcon) */ |
2857 | static char * | 2860 | static char * |
2858 | build_unc_path_to_root(const struct smb_vol *volume_info, | 2861 | build_unc_path_to_root(const struct smb_vol *vol, |
2859 | const struct cifs_sb_info *cifs_sb) | 2862 | const struct cifs_sb_info *cifs_sb) |
2860 | { | 2863 | { |
2861 | char *full_path; | 2864 | char *full_path, *pos; |
2865 | unsigned int pplen = vol->prepath ? strlen(vol->prepath) : 0; | ||
2866 | unsigned int unc_len = strnlen(vol->UNC, MAX_TREE_SIZE + 1); | ||
2862 | 2867 | ||
2863 | int unc_len = strnlen(volume_info->UNC, MAX_TREE_SIZE + 1); | 2868 | full_path = kmalloc(unc_len + pplen + 1, GFP_KERNEL); |
2864 | full_path = kmalloc(unc_len + 1, GFP_KERNEL); | ||
2865 | if (full_path == NULL) | 2869 | if (full_path == NULL) |
2866 | return ERR_PTR(-ENOMEM); | 2870 | return ERR_PTR(-ENOMEM); |
2867 | 2871 | ||
2868 | strncpy(full_path, volume_info->UNC, unc_len); | 2872 | strncpy(full_path, vol->UNC, unc_len); |
2869 | full_path[unc_len] = 0; /* add trailing null */ | 2873 | pos = full_path + unc_len; |
2874 | |||
2875 | if (pplen) { | ||
2876 | strncpy(pos, vol->prepath, pplen); | ||
2877 | pos += pplen; | ||
2878 | } | ||
2879 | |||
2880 | *pos = '\0'; /* add trailing null */ | ||
2870 | convert_delimiter(full_path, CIFS_DIR_SEP(cifs_sb)); | 2881 | convert_delimiter(full_path, CIFS_DIR_SEP(cifs_sb)); |
2882 | cFYI(1, "%s: full_path=%s", __func__, full_path); | ||
2871 | return full_path; | 2883 | return full_path; |
2872 | } | 2884 | } |
2873 | 2885 | ||
@@ -2910,15 +2922,18 @@ expand_dfs_referral(int xid, struct cifs_ses *pSesInfo, | |||
2910 | &fake_devname); | 2922 | &fake_devname); |
2911 | 2923 | ||
2912 | free_dfs_info_array(referrals, num_referrals); | 2924 | free_dfs_info_array(referrals, num_referrals); |
2913 | kfree(fake_devname); | ||
2914 | |||
2915 | if (cifs_sb->mountdata != NULL) | ||
2916 | kfree(cifs_sb->mountdata); | ||
2917 | 2925 | ||
2918 | if (IS_ERR(mdata)) { | 2926 | if (IS_ERR(mdata)) { |
2919 | rc = PTR_ERR(mdata); | 2927 | rc = PTR_ERR(mdata); |
2920 | mdata = NULL; | 2928 | mdata = NULL; |
2929 | } else { | ||
2930 | cleanup_volume_info_contents(volume_info); | ||
2931 | memset(volume_info, '\0', sizeof(*volume_info)); | ||
2932 | rc = cifs_setup_volume_info(volume_info, mdata, | ||
2933 | fake_devname); | ||
2921 | } | 2934 | } |
2935 | kfree(fake_devname); | ||
2936 | kfree(cifs_sb->mountdata); | ||
2922 | cifs_sb->mountdata = mdata; | 2937 | cifs_sb->mountdata = mdata; |
2923 | } | 2938 | } |
2924 | kfree(full_path); | 2939 | kfree(full_path); |
@@ -2926,33 +2941,20 @@ expand_dfs_referral(int xid, struct cifs_ses *pSesInfo, | |||
2926 | } | 2941 | } |
2927 | #endif | 2942 | #endif |
2928 | 2943 | ||
2929 | int cifs_setup_volume_info(struct smb_vol **pvolume_info, char *mount_data, | 2944 | static int |
2930 | const char *devname) | 2945 | cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data, |
2946 | const char *devname) | ||
2931 | { | 2947 | { |
2932 | struct smb_vol *volume_info; | ||
2933 | int rc = 0; | 2948 | int rc = 0; |
2934 | 2949 | ||
2935 | *pvolume_info = NULL; | 2950 | if (cifs_parse_mount_options(mount_data, devname, volume_info)) |
2936 | 2951 | return -EINVAL; | |
2937 | volume_info = kzalloc(sizeof(struct smb_vol), GFP_KERNEL); | ||
2938 | if (!volume_info) { | ||
2939 | rc = -ENOMEM; | ||
2940 | goto out; | ||
2941 | } | ||
2942 | |||
2943 | if (cifs_parse_mount_options(mount_data, devname, | ||
2944 | volume_info)) { | ||
2945 | rc = -EINVAL; | ||
2946 | goto out; | ||
2947 | } | ||
2948 | 2952 | ||
2949 | if (volume_info->nullauth) { | 2953 | if (volume_info->nullauth) { |
2950 | cFYI(1, "null user"); | 2954 | cFYI(1, "null user"); |
2951 | volume_info->username = kzalloc(1, GFP_KERNEL); | 2955 | volume_info->username = kzalloc(1, GFP_KERNEL); |
2952 | if (volume_info->username == NULL) { | 2956 | if (volume_info->username == NULL) |
2953 | rc = -ENOMEM; | 2957 | return -ENOMEM; |
2954 | goto out; | ||
2955 | } | ||
2956 | } else if (volume_info->username) { | 2958 | } else if (volume_info->username) { |
2957 | /* BB fixme parse for domain name here */ | 2959 | /* BB fixme parse for domain name here */ |
2958 | cFYI(1, "Username: %s", volume_info->username); | 2960 | cFYI(1, "Username: %s", volume_info->username); |
@@ -2960,8 +2962,7 @@ int cifs_setup_volume_info(struct smb_vol **pvolume_info, char *mount_data, | |||
2960 | cifserror("No username specified"); | 2962 | cifserror("No username specified"); |
2961 | /* In userspace mount helper we can get user name from alternate | 2963 | /* In userspace mount helper we can get user name from alternate |
2962 | locations such as env variables and files on disk */ | 2964 | locations such as env variables and files on disk */ |
2963 | rc = -EINVAL; | 2965 | return -EINVAL; |
2964 | goto out; | ||
2965 | } | 2966 | } |
2966 | 2967 | ||
2967 | /* this is needed for ASCII cp to Unicode converts */ | 2968 | /* this is needed for ASCII cp to Unicode converts */ |
@@ -2973,18 +2974,32 @@ int cifs_setup_volume_info(struct smb_vol **pvolume_info, char *mount_data, | |||
2973 | if (volume_info->local_nls == NULL) { | 2974 | if (volume_info->local_nls == NULL) { |
2974 | cERROR(1, "CIFS mount error: iocharset %s not found", | 2975 | cERROR(1, "CIFS mount error: iocharset %s not found", |
2975 | volume_info->iocharset); | 2976 | volume_info->iocharset); |
2976 | rc = -ELIBACC; | 2977 | return -ELIBACC; |
2977 | goto out; | ||
2978 | } | 2978 | } |
2979 | } | 2979 | } |
2980 | 2980 | ||
2981 | *pvolume_info = volume_info; | ||
2982 | return rc; | ||
2983 | out: | ||
2984 | cifs_cleanup_volume_info(&volume_info); | ||
2985 | return rc; | 2981 | return rc; |
2986 | } | 2982 | } |
2987 | 2983 | ||
2984 | struct smb_vol * | ||
2985 | cifs_get_volume_info(char *mount_data, const char *devname) | ||
2986 | { | ||
2987 | int rc; | ||
2988 | struct smb_vol *volume_info; | ||
2989 | |||
2990 | volume_info = kzalloc(sizeof(struct smb_vol), GFP_KERNEL); | ||
2991 | if (!volume_info) | ||
2992 | return ERR_PTR(-ENOMEM); | ||
2993 | |||
2994 | rc = cifs_setup_volume_info(volume_info, mount_data, devname); | ||
2995 | if (rc) { | ||
2996 | cifs_cleanup_volume_info(volume_info); | ||
2997 | volume_info = ERR_PTR(rc); | ||
2998 | } | ||
2999 | |||
3000 | return volume_info; | ||
3001 | } | ||
3002 | |||
2988 | int | 3003 | int |
2989 | cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info) | 3004 | cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info) |
2990 | { | 3005 | { |
@@ -2997,6 +3012,7 @@ cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info) | |||
2997 | struct tcon_link *tlink; | 3012 | struct tcon_link *tlink; |
2998 | #ifdef CONFIG_CIFS_DFS_UPCALL | 3013 | #ifdef CONFIG_CIFS_DFS_UPCALL |
2999 | int referral_walks_count = 0; | 3014 | int referral_walks_count = 0; |
3015 | #endif | ||
3000 | 3016 | ||
3001 | rc = bdi_setup_and_register(&cifs_sb->bdi, "cifs", BDI_CAP_MAP_COPY); | 3017 | rc = bdi_setup_and_register(&cifs_sb->bdi, "cifs", BDI_CAP_MAP_COPY); |
3002 | if (rc) | 3018 | if (rc) |
@@ -3004,6 +3020,7 @@ cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info) | |||
3004 | 3020 | ||
3005 | cifs_sb->bdi.ra_pages = default_backing_dev_info.ra_pages; | 3021 | cifs_sb->bdi.ra_pages = default_backing_dev_info.ra_pages; |
3006 | 3022 | ||
3023 | #ifdef CONFIG_CIFS_DFS_UPCALL | ||
3007 | try_mount_again: | 3024 | try_mount_again: |
3008 | /* cleanup activities if we're chasing a referral */ | 3025 | /* cleanup activities if we're chasing a referral */ |
3009 | if (referral_walks_count) { | 3026 | if (referral_walks_count) { |
@@ -3012,7 +3029,6 @@ try_mount_again: | |||
3012 | else if (pSesInfo) | 3029 | else if (pSesInfo) |
3013 | cifs_put_smb_ses(pSesInfo); | 3030 | cifs_put_smb_ses(pSesInfo); |
3014 | 3031 | ||
3015 | cifs_cleanup_volume_info(&volume_info); | ||
3016 | FreeXid(xid); | 3032 | FreeXid(xid); |
3017 | } | 3033 | } |
3018 | #endif | 3034 | #endif |
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 09983a3344a5..b1e88d56069c 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c | |||
@@ -681,15 +681,15 @@ xfs_inode_item_unlock( | |||
681 | * where the cluster buffer may be unpinned before the inode is inserted into | 681 | * where the cluster buffer may be unpinned before the inode is inserted into |
682 | * the AIL during transaction committed processing. If the buffer is unpinned | 682 | * the AIL during transaction committed processing. If the buffer is unpinned |
683 | * before the inode item has been committed and inserted, then it is possible | 683 | * before the inode item has been committed and inserted, then it is possible |
684 | * for the buffer to be written and IO completions before the inode is inserted | 684 | * for the buffer to be written and IO completes before the inode is inserted |
685 | * into the AIL. In that case, we'd be inserting a clean, stale inode into the | 685 | * into the AIL. In that case, we'd be inserting a clean, stale inode into the |
686 | * AIL which will never get removed. It will, however, get reclaimed which | 686 | * AIL which will never get removed. It will, however, get reclaimed which |
687 | * triggers an assert in xfs_inode_free() complaining about freein an inode | 687 | * triggers an assert in xfs_inode_free() complaining about freein an inode |
688 | * still in the AIL. | 688 | * still in the AIL. |
689 | * | 689 | * |
690 | * To avoid this, return a lower LSN than the one passed in so that the | 690 | * To avoid this, just unpin the inode directly and return a LSN of -1 so the |
691 | * transaction committed code will not move the inode forward in the AIL but | 691 | * transaction committed code knows that it does not need to do any further |
692 | * will still unpin it properly. | 692 | * processing on the item. |
693 | */ | 693 | */ |
694 | STATIC xfs_lsn_t | 694 | STATIC xfs_lsn_t |
695 | xfs_inode_item_committed( | 695 | xfs_inode_item_committed( |
@@ -699,8 +699,10 @@ xfs_inode_item_committed( | |||
699 | struct xfs_inode_log_item *iip = INODE_ITEM(lip); | 699 | struct xfs_inode_log_item *iip = INODE_ITEM(lip); |
700 | struct xfs_inode *ip = iip->ili_inode; | 700 | struct xfs_inode *ip = iip->ili_inode; |
701 | 701 | ||
702 | if (xfs_iflags_test(ip, XFS_ISTALE)) | 702 | if (xfs_iflags_test(ip, XFS_ISTALE)) { |
703 | return lsn - 1; | 703 | xfs_inode_item_unpin(lip, 0); |
704 | return -1; | ||
705 | } | ||
704 | return lsn; | 706 | return lsn; |
705 | } | 707 | } |
706 | 708 | ||
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index 7c7bc2b786bd..c83f63b33aae 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c | |||
@@ -1361,7 +1361,7 @@ xfs_trans_item_committed( | |||
1361 | lip->li_flags |= XFS_LI_ABORTED; | 1361 | lip->li_flags |= XFS_LI_ABORTED; |
1362 | item_lsn = IOP_COMMITTED(lip, commit_lsn); | 1362 | item_lsn = IOP_COMMITTED(lip, commit_lsn); |
1363 | 1363 | ||
1364 | /* If the committed routine returns -1, item has been freed. */ | 1364 | /* item_lsn of -1 means the item needs no further processing */ |
1365 | if (XFS_LSN_CMP(item_lsn, (xfs_lsn_t)-1) == 0) | 1365 | if (XFS_LSN_CMP(item_lsn, (xfs_lsn_t)-1) == 0) |
1366 | return; | 1366 | return; |
1367 | 1367 | ||
@@ -1474,7 +1474,7 @@ xfs_trans_committed_bulk( | |||
1474 | lip->li_flags |= XFS_LI_ABORTED; | 1474 | lip->li_flags |= XFS_LI_ABORTED; |
1475 | item_lsn = IOP_COMMITTED(lip, commit_lsn); | 1475 | item_lsn = IOP_COMMITTED(lip, commit_lsn); |
1476 | 1476 | ||
1477 | /* item_lsn of -1 means the item was freed */ | 1477 | /* item_lsn of -1 means the item needs no further processing */ |
1478 | if (XFS_LSN_CMP(item_lsn, (xfs_lsn_t)-1) == 0) | 1478 | if (XFS_LSN_CMP(item_lsn, (xfs_lsn_t)-1) == 0) |
1479 | continue; | 1479 | continue; |
1480 | 1480 | ||
diff --git a/include/linux/irq.h b/include/linux/irq.h index 8b4538446636..baa397eb9c33 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -676,7 +676,8 @@ void irq_gc_mask_disable_reg(struct irq_data *d); | |||
676 | void irq_gc_mask_set_bit(struct irq_data *d); | 676 | void irq_gc_mask_set_bit(struct irq_data *d); |
677 | void irq_gc_mask_clr_bit(struct irq_data *d); | 677 | void irq_gc_mask_clr_bit(struct irq_data *d); |
678 | void irq_gc_unmask_enable_reg(struct irq_data *d); | 678 | void irq_gc_unmask_enable_reg(struct irq_data *d); |
679 | void irq_gc_ack(struct irq_data *d); | 679 | void irq_gc_ack_set_bit(struct irq_data *d); |
680 | void irq_gc_ack_clr_bit(struct irq_data *d); | ||
680 | void irq_gc_mask_disable_reg_and_ack(struct irq_data *d); | 681 | void irq_gc_mask_disable_reg_and_ack(struct irq_data *d); |
681 | void irq_gc_eoi(struct irq_data *d); | 682 | void irq_gc_eoi(struct irq_data *d); |
682 | int irq_gc_set_wake(struct irq_data *d, unsigned int on); | 683 | int irq_gc_set_wake(struct irq_data *d, unsigned int on); |
diff --git a/include/linux/memory.h b/include/linux/memory.h index e1e3b2b84f85..935699b30b7c 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <linux/compiler.h> | 20 | #include <linux/compiler.h> |
21 | #include <linux/mutex.h> | 21 | #include <linux/mutex.h> |
22 | 22 | ||
23 | #define MIN_MEMORY_BLOCK_SIZE (1 << SECTION_SIZE_BITS) | ||
24 | |||
23 | struct memory_block { | 25 | struct memory_block { |
24 | unsigned long start_section_nr; | 26 | unsigned long start_section_nr; |
25 | unsigned long end_section_nr; | 27 | unsigned long end_section_nr; |
diff --git a/include/linux/mfd/ds1wm.h b/include/linux/mfd/ds1wm.h index be469a357cbb..38a372a0e285 100644 --- a/include/linux/mfd/ds1wm.h +++ b/include/linux/mfd/ds1wm.h | |||
@@ -3,4 +3,11 @@ | |||
3 | struct ds1wm_driver_data { | 3 | struct ds1wm_driver_data { |
4 | int active_high; | 4 | int active_high; |
5 | int clock_rate; | 5 | int clock_rate; |
6 | /* in milliseconds, the amount of time to */ | ||
7 | /* sleep following a reset pulse. Zero */ | ||
8 | /* should work if your bus devices recover*/ | ||
9 | /* time respects the 1-wire spec since the*/ | ||
10 | /* ds1wm implements the precise timings of*/ | ||
11 | /* a reset pulse/presence detect sequence.*/ | ||
12 | unsigned int reset_recover_delay; | ||
6 | }; | 13 | }; |
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 1562c4ff3a65..2884e3e69cb1 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -173,16 +173,20 @@ struct v4l2_subdev_core_ops { | |||
173 | struct v4l2_event_subscription *sub); | 173 | struct v4l2_event_subscription *sub); |
174 | }; | 174 | }; |
175 | 175 | ||
176 | /* s_mode: switch the tuner to a specific tuner mode. Replacement of s_radio. | 176 | /* s_radio: v4l device was opened in radio mode. |
177 | 177 | ||
178 | s_radio: v4l device was opened in Radio mode, to be replaced by s_mode. | 178 | g_frequency: freq->type must be filled in. Normally done by video_ioctl2 |
179 | or the bridge driver. | ||
180 | |||
181 | g_tuner: | ||
182 | s_tuner: vt->type must be filled in. Normally done by video_ioctl2 or the | ||
183 | bridge driver. | ||
179 | 184 | ||
180 | s_type_addr: sets tuner type and its I2C addr. | 185 | s_type_addr: sets tuner type and its I2C addr. |
181 | 186 | ||
182 | s_config: sets tda9887 specific stuff, like port1, port2 and qss | 187 | s_config: sets tda9887 specific stuff, like port1, port2 and qss |
183 | */ | 188 | */ |
184 | struct v4l2_subdev_tuner_ops { | 189 | struct v4l2_subdev_tuner_ops { |
185 | int (*s_mode)(struct v4l2_subdev *sd, enum v4l2_tuner_type); | ||
186 | int (*s_radio)(struct v4l2_subdev *sd); | 190 | int (*s_radio)(struct v4l2_subdev *sd); |
187 | int (*s_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq); | 191 | int (*s_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq); |
188 | int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq); | 192 | int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq); |
diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c index 31a9db711906..3a2cab407b93 100644 --- a/kernel/irq/generic-chip.c +++ b/kernel/irq/generic-chip.c | |||
@@ -101,10 +101,10 @@ void irq_gc_unmask_enable_reg(struct irq_data *d) | |||
101 | } | 101 | } |
102 | 102 | ||
103 | /** | 103 | /** |
104 | * irq_gc_ack - Ack pending interrupt | 104 | * irq_gc_ack_set_bit - Ack pending interrupt via setting bit |
105 | * @d: irq_data | 105 | * @d: irq_data |
106 | */ | 106 | */ |
107 | void irq_gc_ack(struct irq_data *d) | 107 | void irq_gc_ack_set_bit(struct irq_data *d) |
108 | { | 108 | { |
109 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | 109 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); |
110 | u32 mask = 1 << (d->irq - gc->irq_base); | 110 | u32 mask = 1 << (d->irq - gc->irq_base); |
@@ -115,6 +115,20 @@ void irq_gc_ack(struct irq_data *d) | |||
115 | } | 115 | } |
116 | 116 | ||
117 | /** | 117 | /** |
118 | * irq_gc_ack_clr_bit - Ack pending interrupt via clearing bit | ||
119 | * @d: irq_data | ||
120 | */ | ||
121 | void irq_gc_ack_clr_bit(struct irq_data *d) | ||
122 | { | ||
123 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | ||
124 | u32 mask = ~(1 << (d->irq - gc->irq_base)); | ||
125 | |||
126 | irq_gc_lock(gc); | ||
127 | irq_reg_writel(mask, gc->reg_base + cur_regs(d)->ack); | ||
128 | irq_gc_unlock(gc); | ||
129 | } | ||
130 | |||
131 | /** | ||
118 | * irq_gc_mask_disable_reg_and_ack- Mask and ack pending interrupt | 132 | * irq_gc_mask_disable_reg_and_ack- Mask and ack pending interrupt |
119 | * @d: irq_data | 133 | * @d: irq_data |
120 | */ | 134 | */ |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index ddffc74cdebe..e013b8e57d25 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -108,10 +108,12 @@ enum mem_cgroup_events_index { | |||
108 | enum mem_cgroup_events_target { | 108 | enum mem_cgroup_events_target { |
109 | MEM_CGROUP_TARGET_THRESH, | 109 | MEM_CGROUP_TARGET_THRESH, |
110 | MEM_CGROUP_TARGET_SOFTLIMIT, | 110 | MEM_CGROUP_TARGET_SOFTLIMIT, |
111 | MEM_CGROUP_TARGET_NUMAINFO, | ||
111 | MEM_CGROUP_NTARGETS, | 112 | MEM_CGROUP_NTARGETS, |
112 | }; | 113 | }; |
113 | #define THRESHOLDS_EVENTS_TARGET (128) | 114 | #define THRESHOLDS_EVENTS_TARGET (128) |
114 | #define SOFTLIMIT_EVENTS_TARGET (1024) | 115 | #define SOFTLIMIT_EVENTS_TARGET (1024) |
116 | #define NUMAINFO_EVENTS_TARGET (1024) | ||
115 | 117 | ||
116 | struct mem_cgroup_stat_cpu { | 118 | struct mem_cgroup_stat_cpu { |
117 | long count[MEM_CGROUP_STAT_NSTATS]; | 119 | long count[MEM_CGROUP_STAT_NSTATS]; |
@@ -237,7 +239,8 @@ struct mem_cgroup { | |||
237 | int last_scanned_node; | 239 | int last_scanned_node; |
238 | #if MAX_NUMNODES > 1 | 240 | #if MAX_NUMNODES > 1 |
239 | nodemask_t scan_nodes; | 241 | nodemask_t scan_nodes; |
240 | unsigned long next_scan_node_update; | 242 | atomic_t numainfo_events; |
243 | atomic_t numainfo_updating; | ||
241 | #endif | 244 | #endif |
242 | /* | 245 | /* |
243 | * Should the accounting and control be hierarchical, per subtree? | 246 | * Should the accounting and control be hierarchical, per subtree? |
@@ -577,15 +580,6 @@ static long mem_cgroup_read_stat(struct mem_cgroup *mem, | |||
577 | return val; | 580 | return val; |
578 | } | 581 | } |
579 | 582 | ||
580 | static long mem_cgroup_local_usage(struct mem_cgroup *mem) | ||
581 | { | ||
582 | long ret; | ||
583 | |||
584 | ret = mem_cgroup_read_stat(mem, MEM_CGROUP_STAT_RSS); | ||
585 | ret += mem_cgroup_read_stat(mem, MEM_CGROUP_STAT_CACHE); | ||
586 | return ret; | ||
587 | } | ||
588 | |||
589 | static void mem_cgroup_swap_statistics(struct mem_cgroup *mem, | 583 | static void mem_cgroup_swap_statistics(struct mem_cgroup *mem, |
590 | bool charge) | 584 | bool charge) |
591 | { | 585 | { |
@@ -689,6 +683,9 @@ static void __mem_cgroup_target_update(struct mem_cgroup *mem, int target) | |||
689 | case MEM_CGROUP_TARGET_SOFTLIMIT: | 683 | case MEM_CGROUP_TARGET_SOFTLIMIT: |
690 | next = val + SOFTLIMIT_EVENTS_TARGET; | 684 | next = val + SOFTLIMIT_EVENTS_TARGET; |
691 | break; | 685 | break; |
686 | case MEM_CGROUP_TARGET_NUMAINFO: | ||
687 | next = val + NUMAINFO_EVENTS_TARGET; | ||
688 | break; | ||
692 | default: | 689 | default: |
693 | return; | 690 | return; |
694 | } | 691 | } |
@@ -707,11 +704,19 @@ static void memcg_check_events(struct mem_cgroup *mem, struct page *page) | |||
707 | mem_cgroup_threshold(mem); | 704 | mem_cgroup_threshold(mem); |
708 | __mem_cgroup_target_update(mem, MEM_CGROUP_TARGET_THRESH); | 705 | __mem_cgroup_target_update(mem, MEM_CGROUP_TARGET_THRESH); |
709 | if (unlikely(__memcg_event_check(mem, | 706 | if (unlikely(__memcg_event_check(mem, |
710 | MEM_CGROUP_TARGET_SOFTLIMIT))){ | 707 | MEM_CGROUP_TARGET_SOFTLIMIT))) { |
711 | mem_cgroup_update_tree(mem, page); | 708 | mem_cgroup_update_tree(mem, page); |
712 | __mem_cgroup_target_update(mem, | 709 | __mem_cgroup_target_update(mem, |
713 | MEM_CGROUP_TARGET_SOFTLIMIT); | 710 | MEM_CGROUP_TARGET_SOFTLIMIT); |
711 | } | ||
712 | #if MAX_NUMNODES > 1 | ||
713 | if (unlikely(__memcg_event_check(mem, | ||
714 | MEM_CGROUP_TARGET_NUMAINFO))) { | ||
715 | atomic_inc(&mem->numainfo_events); | ||
716 | __mem_cgroup_target_update(mem, | ||
717 | MEM_CGROUP_TARGET_NUMAINFO); | ||
714 | } | 718 | } |
719 | #endif | ||
715 | } | 720 | } |
716 | } | 721 | } |
717 | 722 | ||
@@ -1129,7 +1134,6 @@ unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, | |||
1129 | return MEM_CGROUP_ZSTAT(mz, lru); | 1134 | return MEM_CGROUP_ZSTAT(mz, lru); |
1130 | } | 1135 | } |
1131 | 1136 | ||
1132 | #ifdef CONFIG_NUMA | ||
1133 | static unsigned long mem_cgroup_node_nr_file_lru_pages(struct mem_cgroup *memcg, | 1137 | static unsigned long mem_cgroup_node_nr_file_lru_pages(struct mem_cgroup *memcg, |
1134 | int nid) | 1138 | int nid) |
1135 | { | 1139 | { |
@@ -1141,6 +1145,17 @@ static unsigned long mem_cgroup_node_nr_file_lru_pages(struct mem_cgroup *memcg, | |||
1141 | return ret; | 1145 | return ret; |
1142 | } | 1146 | } |
1143 | 1147 | ||
1148 | static unsigned long mem_cgroup_node_nr_anon_lru_pages(struct mem_cgroup *memcg, | ||
1149 | int nid) | ||
1150 | { | ||
1151 | unsigned long ret; | ||
1152 | |||
1153 | ret = mem_cgroup_get_zonestat_node(memcg, nid, LRU_INACTIVE_ANON) + | ||
1154 | mem_cgroup_get_zonestat_node(memcg, nid, LRU_ACTIVE_ANON); | ||
1155 | return ret; | ||
1156 | } | ||
1157 | |||
1158 | #if MAX_NUMNODES > 1 | ||
1144 | static unsigned long mem_cgroup_nr_file_lru_pages(struct mem_cgroup *memcg) | 1159 | static unsigned long mem_cgroup_nr_file_lru_pages(struct mem_cgroup *memcg) |
1145 | { | 1160 | { |
1146 | u64 total = 0; | 1161 | u64 total = 0; |
@@ -1152,17 +1167,6 @@ static unsigned long mem_cgroup_nr_file_lru_pages(struct mem_cgroup *memcg) | |||
1152 | return total; | 1167 | return total; |
1153 | } | 1168 | } |
1154 | 1169 | ||
1155 | static unsigned long mem_cgroup_node_nr_anon_lru_pages(struct mem_cgroup *memcg, | ||
1156 | int nid) | ||
1157 | { | ||
1158 | unsigned long ret; | ||
1159 | |||
1160 | ret = mem_cgroup_get_zonestat_node(memcg, nid, LRU_INACTIVE_ANON) + | ||
1161 | mem_cgroup_get_zonestat_node(memcg, nid, LRU_ACTIVE_ANON); | ||
1162 | |||
1163 | return ret; | ||
1164 | } | ||
1165 | |||
1166 | static unsigned long mem_cgroup_nr_anon_lru_pages(struct mem_cgroup *memcg) | 1170 | static unsigned long mem_cgroup_nr_anon_lru_pages(struct mem_cgroup *memcg) |
1167 | { | 1171 | { |
1168 | u64 total = 0; | 1172 | u64 total = 0; |
@@ -1559,6 +1563,28 @@ mem_cgroup_select_victim(struct mem_cgroup *root_mem) | |||
1559 | return ret; | 1563 | return ret; |
1560 | } | 1564 | } |
1561 | 1565 | ||
1566 | /** | ||
1567 | * test_mem_cgroup_node_reclaimable | ||
1568 | * @mem: the target memcg | ||
1569 | * @nid: the node ID to be checked. | ||
1570 | * @noswap : specify true here if the user wants flle only information. | ||
1571 | * | ||
1572 | * This function returns whether the specified memcg contains any | ||
1573 | * reclaimable pages on a node. Returns true if there are any reclaimable | ||
1574 | * pages in the node. | ||
1575 | */ | ||
1576 | static bool test_mem_cgroup_node_reclaimable(struct mem_cgroup *mem, | ||
1577 | int nid, bool noswap) | ||
1578 | { | ||
1579 | if (mem_cgroup_node_nr_file_lru_pages(mem, nid)) | ||
1580 | return true; | ||
1581 | if (noswap || !total_swap_pages) | ||
1582 | return false; | ||
1583 | if (mem_cgroup_node_nr_anon_lru_pages(mem, nid)) | ||
1584 | return true; | ||
1585 | return false; | ||
1586 | |||
1587 | } | ||
1562 | #if MAX_NUMNODES > 1 | 1588 | #if MAX_NUMNODES > 1 |
1563 | 1589 | ||
1564 | /* | 1590 | /* |
@@ -1570,26 +1596,26 @@ mem_cgroup_select_victim(struct mem_cgroup *root_mem) | |||
1570 | static void mem_cgroup_may_update_nodemask(struct mem_cgroup *mem) | 1596 | static void mem_cgroup_may_update_nodemask(struct mem_cgroup *mem) |
1571 | { | 1597 | { |
1572 | int nid; | 1598 | int nid; |
1573 | 1599 | /* | |
1574 | if (time_after(mem->next_scan_node_update, jiffies)) | 1600 | * numainfo_events > 0 means there was at least NUMAINFO_EVENTS_TARGET |
1601 | * pagein/pageout changes since the last update. | ||
1602 | */ | ||
1603 | if (!atomic_read(&mem->numainfo_events)) | ||
1604 | return; | ||
1605 | if (atomic_inc_return(&mem->numainfo_updating) > 1) | ||
1575 | return; | 1606 | return; |
1576 | 1607 | ||
1577 | mem->next_scan_node_update = jiffies + 10*HZ; | ||
1578 | /* make a nodemask where this memcg uses memory from */ | 1608 | /* make a nodemask where this memcg uses memory from */ |
1579 | mem->scan_nodes = node_states[N_HIGH_MEMORY]; | 1609 | mem->scan_nodes = node_states[N_HIGH_MEMORY]; |
1580 | 1610 | ||
1581 | for_each_node_mask(nid, node_states[N_HIGH_MEMORY]) { | 1611 | for_each_node_mask(nid, node_states[N_HIGH_MEMORY]) { |
1582 | 1612 | ||
1583 | if (mem_cgroup_get_zonestat_node(mem, nid, LRU_INACTIVE_FILE) || | 1613 | if (!test_mem_cgroup_node_reclaimable(mem, nid, false)) |
1584 | mem_cgroup_get_zonestat_node(mem, nid, LRU_ACTIVE_FILE)) | 1614 | node_clear(nid, mem->scan_nodes); |
1585 | continue; | ||
1586 | |||
1587 | if (total_swap_pages && | ||
1588 | (mem_cgroup_get_zonestat_node(mem, nid, LRU_INACTIVE_ANON) || | ||
1589 | mem_cgroup_get_zonestat_node(mem, nid, LRU_ACTIVE_ANON))) | ||
1590 | continue; | ||
1591 | node_clear(nid, mem->scan_nodes); | ||
1592 | } | 1615 | } |
1616 | |||
1617 | atomic_set(&mem->numainfo_events, 0); | ||
1618 | atomic_set(&mem->numainfo_updating, 0); | ||
1593 | } | 1619 | } |
1594 | 1620 | ||
1595 | /* | 1621 | /* |
@@ -1627,11 +1653,51 @@ int mem_cgroup_select_victim_node(struct mem_cgroup *mem) | |||
1627 | return node; | 1653 | return node; |
1628 | } | 1654 | } |
1629 | 1655 | ||
1656 | /* | ||
1657 | * Check all nodes whether it contains reclaimable pages or not. | ||
1658 | * For quick scan, we make use of scan_nodes. This will allow us to skip | ||
1659 | * unused nodes. But scan_nodes is lazily updated and may not cotain | ||
1660 | * enough new information. We need to do double check. | ||
1661 | */ | ||
1662 | bool mem_cgroup_reclaimable(struct mem_cgroup *mem, bool noswap) | ||
1663 | { | ||
1664 | int nid; | ||
1665 | |||
1666 | /* | ||
1667 | * quick check...making use of scan_node. | ||
1668 | * We can skip unused nodes. | ||
1669 | */ | ||
1670 | if (!nodes_empty(mem->scan_nodes)) { | ||
1671 | for (nid = first_node(mem->scan_nodes); | ||
1672 | nid < MAX_NUMNODES; | ||
1673 | nid = next_node(nid, mem->scan_nodes)) { | ||
1674 | |||
1675 | if (test_mem_cgroup_node_reclaimable(mem, nid, noswap)) | ||
1676 | return true; | ||
1677 | } | ||
1678 | } | ||
1679 | /* | ||
1680 | * Check rest of nodes. | ||
1681 | */ | ||
1682 | for_each_node_state(nid, N_HIGH_MEMORY) { | ||
1683 | if (node_isset(nid, mem->scan_nodes)) | ||
1684 | continue; | ||
1685 | if (test_mem_cgroup_node_reclaimable(mem, nid, noswap)) | ||
1686 | return true; | ||
1687 | } | ||
1688 | return false; | ||
1689 | } | ||
1690 | |||
1630 | #else | 1691 | #else |
1631 | int mem_cgroup_select_victim_node(struct mem_cgroup *mem) | 1692 | int mem_cgroup_select_victim_node(struct mem_cgroup *mem) |
1632 | { | 1693 | { |
1633 | return 0; | 1694 | return 0; |
1634 | } | 1695 | } |
1696 | |||
1697 | bool mem_cgroup_reclaimable(struct mem_cgroup *mem, bool noswap) | ||
1698 | { | ||
1699 | return test_mem_cgroup_node_reclaimable(mem, 0, noswap); | ||
1700 | } | ||
1635 | #endif | 1701 | #endif |
1636 | 1702 | ||
1637 | /* | 1703 | /* |
@@ -1702,7 +1768,7 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem, | |||
1702 | } | 1768 | } |
1703 | } | 1769 | } |
1704 | } | 1770 | } |
1705 | if (!mem_cgroup_local_usage(victim)) { | 1771 | if (!mem_cgroup_reclaimable(victim, noswap)) { |
1706 | /* this cgroup's local usage == 0 */ | 1772 | /* this cgroup's local usage == 0 */ |
1707 | css_put(&victim->css); | 1773 | css_put(&victim->css); |
1708 | continue; | 1774 | continue; |
diff --git a/mm/memory.c b/mm/memory.c index 40b7531ee8ba..9b8a01d941cb 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -305,6 +305,7 @@ int __tlb_remove_page(struct mmu_gather *tlb, struct page *page) | |||
305 | if (batch->nr == batch->max) { | 305 | if (batch->nr == batch->max) { |
306 | if (!tlb_next_batch(tlb)) | 306 | if (!tlb_next_batch(tlb)) |
307 | return 0; | 307 | return 0; |
308 | batch = tlb->active; | ||
308 | } | 309 | } |
309 | VM_BUG_ON(batch->nr > batch->max); | 310 | VM_BUG_ON(batch->nr > batch->max); |
310 | 311 | ||
diff --git a/mm/nommu.c b/mm/nommu.c index 1fd0c51b10a6..9edc897a3970 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -1813,10 +1813,13 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address, | |||
1813 | return NULL; | 1813 | return NULL; |
1814 | } | 1814 | } |
1815 | 1815 | ||
1816 | int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, | 1816 | int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr, |
1817 | unsigned long to, unsigned long size, pgprot_t prot) | 1817 | unsigned long pfn, unsigned long size, pgprot_t prot) |
1818 | { | 1818 | { |
1819 | vma->vm_start = vma->vm_pgoff << PAGE_SHIFT; | 1819 | if (addr != (pfn << PAGE_SHIFT)) |
1820 | return -EINVAL; | ||
1821 | |||
1822 | vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP; | ||
1820 | return 0; | 1823 | return 0; |
1821 | } | 1824 | } |
1822 | EXPORT_SYMBOL(remap_pfn_range); | 1825 | EXPORT_SYMBOL(remap_pfn_range); |
diff --git a/mm/vmscan.c b/mm/vmscan.c index 4f49535d4cd3..5ed24b94c5e6 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -2326,7 +2326,7 @@ static bool sleeping_prematurely(pg_data_t *pgdat, int order, long remaining, | |||
2326 | return true; | 2326 | return true; |
2327 | 2327 | ||
2328 | /* Check the watermark levels */ | 2328 | /* Check the watermark levels */ |
2329 | for (i = 0; i < pgdat->nr_zones; i++) { | 2329 | for (i = 0; i <= classzone_idx; i++) { |
2330 | struct zone *zone = pgdat->node_zones + i; | 2330 | struct zone *zone = pgdat->node_zones + i; |
2331 | 2331 | ||
2332 | if (!populated_zone(zone)) | 2332 | if (!populated_zone(zone)) |
@@ -2344,7 +2344,7 @@ static bool sleeping_prematurely(pg_data_t *pgdat, int order, long remaining, | |||
2344 | } | 2344 | } |
2345 | 2345 | ||
2346 | if (!zone_watermark_ok_safe(zone, order, high_wmark_pages(zone), | 2346 | if (!zone_watermark_ok_safe(zone, order, high_wmark_pages(zone), |
2347 | classzone_idx, 0)) | 2347 | i, 0)) |
2348 | all_zones_ok = false; | 2348 | all_zones_ok = false; |
2349 | else | 2349 | else |
2350 | balanced += zone->present_pages; | 2350 | balanced += zone->present_pages; |
@@ -2451,7 +2451,6 @@ loop_again: | |||
2451 | if (!zone_watermark_ok_safe(zone, order, | 2451 | if (!zone_watermark_ok_safe(zone, order, |
2452 | high_wmark_pages(zone), 0, 0)) { | 2452 | high_wmark_pages(zone), 0, 0)) { |
2453 | end_zone = i; | 2453 | end_zone = i; |
2454 | *classzone_idx = i; | ||
2455 | break; | 2454 | break; |
2456 | } | 2455 | } |
2457 | } | 2456 | } |
@@ -2510,18 +2509,18 @@ loop_again: | |||
2510 | KSWAPD_ZONE_BALANCE_GAP_RATIO); | 2509 | KSWAPD_ZONE_BALANCE_GAP_RATIO); |
2511 | if (!zone_watermark_ok_safe(zone, order, | 2510 | if (!zone_watermark_ok_safe(zone, order, |
2512 | high_wmark_pages(zone) + balance_gap, | 2511 | high_wmark_pages(zone) + balance_gap, |
2513 | end_zone, 0)) | 2512 | end_zone, 0)) { |
2514 | shrink_zone(priority, zone, &sc); | 2513 | shrink_zone(priority, zone, &sc); |
2515 | reclaim_state->reclaimed_slab = 0; | ||
2516 | nr_slab = shrink_slab(&shrink, sc.nr_scanned, lru_pages); | ||
2517 | sc.nr_reclaimed += reclaim_state->reclaimed_slab; | ||
2518 | total_scanned += sc.nr_scanned; | ||
2519 | 2514 | ||
2520 | if (zone->all_unreclaimable) | 2515 | reclaim_state->reclaimed_slab = 0; |
2521 | continue; | 2516 | nr_slab = shrink_slab(&shrink, sc.nr_scanned, lru_pages); |
2522 | if (nr_slab == 0 && | 2517 | sc.nr_reclaimed += reclaim_state->reclaimed_slab; |
2523 | !zone_reclaimable(zone)) | 2518 | total_scanned += sc.nr_scanned; |
2524 | zone->all_unreclaimable = 1; | 2519 | |
2520 | if (nr_slab == 0 && !zone_reclaimable(zone)) | ||
2521 | zone->all_unreclaimable = 1; | ||
2522 | } | ||
2523 | |||
2525 | /* | 2524 | /* |
2526 | * If we've done a decent amount of scanning and | 2525 | * If we've done a decent amount of scanning and |
2527 | * the reclaim ratio is low, start doing writepage | 2526 | * the reclaim ratio is low, start doing writepage |
@@ -2531,6 +2530,12 @@ loop_again: | |||
2531 | total_scanned > sc.nr_reclaimed + sc.nr_reclaimed / 2) | 2530 | total_scanned > sc.nr_reclaimed + sc.nr_reclaimed / 2) |
2532 | sc.may_writepage = 1; | 2531 | sc.may_writepage = 1; |
2533 | 2532 | ||
2533 | if (zone->all_unreclaimable) { | ||
2534 | if (end_zone && end_zone == i) | ||
2535 | end_zone--; | ||
2536 | continue; | ||
2537 | } | ||
2538 | |||
2534 | if (!zone_watermark_ok_safe(zone, order, | 2539 | if (!zone_watermark_ok_safe(zone, order, |
2535 | high_wmark_pages(zone), end_zone, 0)) { | 2540 | high_wmark_pages(zone), end_zone, 0)) { |
2536 | all_zones_ok = 0; | 2541 | all_zones_ok = 0; |
@@ -2709,8 +2714,8 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int order, int classzone_idx) | |||
2709 | */ | 2714 | */ |
2710 | static int kswapd(void *p) | 2715 | static int kswapd(void *p) |
2711 | { | 2716 | { |
2712 | unsigned long order; | 2717 | unsigned long order, new_order; |
2713 | int classzone_idx; | 2718 | int classzone_idx, new_classzone_idx; |
2714 | pg_data_t *pgdat = (pg_data_t*)p; | 2719 | pg_data_t *pgdat = (pg_data_t*)p; |
2715 | struct task_struct *tsk = current; | 2720 | struct task_struct *tsk = current; |
2716 | 2721 | ||
@@ -2740,17 +2745,23 @@ static int kswapd(void *p) | |||
2740 | tsk->flags |= PF_MEMALLOC | PF_SWAPWRITE | PF_KSWAPD; | 2745 | tsk->flags |= PF_MEMALLOC | PF_SWAPWRITE | PF_KSWAPD; |
2741 | set_freezable(); | 2746 | set_freezable(); |
2742 | 2747 | ||
2743 | order = 0; | 2748 | order = new_order = 0; |
2744 | classzone_idx = MAX_NR_ZONES - 1; | 2749 | classzone_idx = new_classzone_idx = pgdat->nr_zones - 1; |
2745 | for ( ; ; ) { | 2750 | for ( ; ; ) { |
2746 | unsigned long new_order; | ||
2747 | int new_classzone_idx; | ||
2748 | int ret; | 2751 | int ret; |
2749 | 2752 | ||
2750 | new_order = pgdat->kswapd_max_order; | 2753 | /* |
2751 | new_classzone_idx = pgdat->classzone_idx; | 2754 | * If the last balance_pgdat was unsuccessful it's unlikely a |
2752 | pgdat->kswapd_max_order = 0; | 2755 | * new request of a similar or harder type will succeed soon |
2753 | pgdat->classzone_idx = MAX_NR_ZONES - 1; | 2756 | * so consider going to sleep on the basis we reclaimed at |
2757 | */ | ||
2758 | if (classzone_idx >= new_classzone_idx && order == new_order) { | ||
2759 | new_order = pgdat->kswapd_max_order; | ||
2760 | new_classzone_idx = pgdat->classzone_idx; | ||
2761 | pgdat->kswapd_max_order = 0; | ||
2762 | pgdat->classzone_idx = pgdat->nr_zones - 1; | ||
2763 | } | ||
2764 | |||
2754 | if (order < new_order || classzone_idx > new_classzone_idx) { | 2765 | if (order < new_order || classzone_idx > new_classzone_idx) { |
2755 | /* | 2766 | /* |
2756 | * Don't sleep if someone wants a larger 'order' | 2767 | * Don't sleep if someone wants a larger 'order' |
@@ -2763,7 +2774,7 @@ static int kswapd(void *p) | |||
2763 | order = pgdat->kswapd_max_order; | 2774 | order = pgdat->kswapd_max_order; |
2764 | classzone_idx = pgdat->classzone_idx; | 2775 | classzone_idx = pgdat->classzone_idx; |
2765 | pgdat->kswapd_max_order = 0; | 2776 | pgdat->kswapd_max_order = 0; |
2766 | pgdat->classzone_idx = MAX_NR_ZONES - 1; | 2777 | pgdat->classzone_idx = pgdat->nr_zones - 1; |
2767 | } | 2778 | } |
2768 | 2779 | ||
2769 | ret = try_to_freeze(); | 2780 | ret = try_to_freeze(); |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index d21191dcfe88..b48fb43b5448 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -2715,17 +2715,30 @@ typedef int (*getput_call_t)(struct snd_kcontrol *kcontrol, | |||
2715 | 2715 | ||
2716 | static int alc_cap_getput_caller(struct snd_kcontrol *kcontrol, | 2716 | static int alc_cap_getput_caller(struct snd_kcontrol *kcontrol, |
2717 | struct snd_ctl_elem_value *ucontrol, | 2717 | struct snd_ctl_elem_value *ucontrol, |
2718 | getput_call_t func) | 2718 | getput_call_t func, bool check_adc_switch) |
2719 | { | 2719 | { |
2720 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | 2720 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
2721 | struct alc_spec *spec = codec->spec; | 2721 | struct alc_spec *spec = codec->spec; |
2722 | unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | 2722 | int i, err = 0; |
2723 | int err; | ||
2724 | 2723 | ||
2725 | mutex_lock(&codec->control_mutex); | 2724 | mutex_lock(&codec->control_mutex); |
2726 | kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[adc_idx], | 2725 | if (check_adc_switch && spec->dual_adc_switch) { |
2727 | 3, 0, HDA_INPUT); | 2726 | for (i = 0; i < spec->num_adc_nids; i++) { |
2728 | err = func(kcontrol, ucontrol); | 2727 | kcontrol->private_value = |
2728 | HDA_COMPOSE_AMP_VAL(spec->adc_nids[i], | ||
2729 | 3, 0, HDA_INPUT); | ||
2730 | err = func(kcontrol, ucontrol); | ||
2731 | if (err < 0) | ||
2732 | goto error; | ||
2733 | } | ||
2734 | } else { | ||
2735 | i = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | ||
2736 | kcontrol->private_value = | ||
2737 | HDA_COMPOSE_AMP_VAL(spec->adc_nids[i], | ||
2738 | 3, 0, HDA_INPUT); | ||
2739 | err = func(kcontrol, ucontrol); | ||
2740 | } | ||
2741 | error: | ||
2729 | mutex_unlock(&codec->control_mutex); | 2742 | mutex_unlock(&codec->control_mutex); |
2730 | return err; | 2743 | return err; |
2731 | } | 2744 | } |
@@ -2734,14 +2747,14 @@ static int alc_cap_vol_get(struct snd_kcontrol *kcontrol, | |||
2734 | struct snd_ctl_elem_value *ucontrol) | 2747 | struct snd_ctl_elem_value *ucontrol) |
2735 | { | 2748 | { |
2736 | return alc_cap_getput_caller(kcontrol, ucontrol, | 2749 | return alc_cap_getput_caller(kcontrol, ucontrol, |
2737 | snd_hda_mixer_amp_volume_get); | 2750 | snd_hda_mixer_amp_volume_get, false); |
2738 | } | 2751 | } |
2739 | 2752 | ||
2740 | static int alc_cap_vol_put(struct snd_kcontrol *kcontrol, | 2753 | static int alc_cap_vol_put(struct snd_kcontrol *kcontrol, |
2741 | struct snd_ctl_elem_value *ucontrol) | 2754 | struct snd_ctl_elem_value *ucontrol) |
2742 | { | 2755 | { |
2743 | return alc_cap_getput_caller(kcontrol, ucontrol, | 2756 | return alc_cap_getput_caller(kcontrol, ucontrol, |
2744 | snd_hda_mixer_amp_volume_put); | 2757 | snd_hda_mixer_amp_volume_put, true); |
2745 | } | 2758 | } |
2746 | 2759 | ||
2747 | /* capture mixer elements */ | 2760 | /* capture mixer elements */ |
@@ -2751,14 +2764,14 @@ static int alc_cap_sw_get(struct snd_kcontrol *kcontrol, | |||
2751 | struct snd_ctl_elem_value *ucontrol) | 2764 | struct snd_ctl_elem_value *ucontrol) |
2752 | { | 2765 | { |
2753 | return alc_cap_getput_caller(kcontrol, ucontrol, | 2766 | return alc_cap_getput_caller(kcontrol, ucontrol, |
2754 | snd_hda_mixer_amp_switch_get); | 2767 | snd_hda_mixer_amp_switch_get, false); |
2755 | } | 2768 | } |
2756 | 2769 | ||
2757 | static int alc_cap_sw_put(struct snd_kcontrol *kcontrol, | 2770 | static int alc_cap_sw_put(struct snd_kcontrol *kcontrol, |
2758 | struct snd_ctl_elem_value *ucontrol) | 2771 | struct snd_ctl_elem_value *ucontrol) |
2759 | { | 2772 | { |
2760 | return alc_cap_getput_caller(kcontrol, ucontrol, | 2773 | return alc_cap_getput_caller(kcontrol, ucontrol, |
2761 | snd_hda_mixer_amp_switch_put); | 2774 | snd_hda_mixer_amp_switch_put, true); |
2762 | } | 2775 | } |
2763 | 2776 | ||
2764 | #define _DEFINE_CAPMIX(num) \ | 2777 | #define _DEFINE_CAPMIX(num) \ |
diff --git a/sound/soc/blackfin/bf5xx-i2s-pcm.c b/sound/soc/blackfin/bf5xx-i2s-pcm.c index b5101efd1c87..f1fd95bb6416 100644 --- a/sound/soc/blackfin/bf5xx-i2s-pcm.c +++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c | |||
@@ -138,11 +138,20 @@ static snd_pcm_uframes_t bf5xx_pcm_pointer(struct snd_pcm_substream *substream) | |||
138 | pr_debug("%s enter\n", __func__); | 138 | pr_debug("%s enter\n", __func__); |
139 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 139 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
140 | diff = sport_curr_offset_tx(sport); | 140 | diff = sport_curr_offset_tx(sport); |
141 | frames = bytes_to_frames(substream->runtime, diff); | ||
142 | } else { | 141 | } else { |
143 | diff = sport_curr_offset_rx(sport); | 142 | diff = sport_curr_offset_rx(sport); |
144 | frames = bytes_to_frames(substream->runtime, diff); | ||
145 | } | 143 | } |
144 | |||
145 | /* | ||
146 | * TX at least can report one frame beyond the end of the | ||
147 | * buffer if we hit the wraparound case - clamp to within the | ||
148 | * buffer as the ALSA APIs require. | ||
149 | */ | ||
150 | if (diff == snd_pcm_lib_buffer_bytes(substream)) | ||
151 | diff = 0; | ||
152 | |||
153 | frames = bytes_to_frames(substream->runtime, diff); | ||
154 | |||
146 | return frames; | 155 | return frames; |
147 | } | 156 | } |
148 | 157 | ||
diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c index 4be0570e3f1f..65f46047b1cb 100644 --- a/sound/soc/codecs/ak4642.c +++ b/sound/soc/codecs/ak4642.c | |||
@@ -357,7 +357,7 @@ static int ak4642_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) | |||
357 | default: | 357 | default: |
358 | return -EINVAL; | 358 | return -EINVAL; |
359 | } | 359 | } |
360 | snd_soc_update_bits(codec, PW_MGMT2, MS, data); | 360 | snd_soc_update_bits(codec, PW_MGMT2, MS | MCKO | PMPLL, data); |
361 | snd_soc_update_bits(codec, MD_CTL1, BCKO_MASK, bcko); | 361 | snd_soc_update_bits(codec, MD_CTL1, BCKO_MASK, bcko); |
362 | 362 | ||
363 | /* format type */ | 363 | /* format type */ |
diff --git a/sound/soc/codecs/tlv320aic26.c b/sound/soc/codecs/tlv320aic26.c index e2a7608d3944..7859bdcc93db 100644 --- a/sound/soc/codecs/tlv320aic26.c +++ b/sound/soc/codecs/tlv320aic26.c | |||
@@ -161,10 +161,18 @@ static int aic26_hw_params(struct snd_pcm_substream *substream, | |||
161 | dev_dbg(&aic26->spi->dev, "bad format\n"); return -EINVAL; | 161 | dev_dbg(&aic26->spi->dev, "bad format\n"); return -EINVAL; |
162 | } | 162 | } |
163 | 163 | ||
164 | /* Configure PLL */ | 164 | /** |
165 | * Configure PLL | ||
166 | * fsref = (mclk * PLLM) / 2048 | ||
167 | * where PLLM = J.DDDD (DDDD register ranges from 0 to 9999, decimal) | ||
168 | */ | ||
165 | pval = 1; | 169 | pval = 1; |
166 | jval = (fsref == 44100) ? 7 : 8; | 170 | /* compute J portion of multiplier */ |
167 | dval = (fsref == 44100) ? 5264 : 1920; | 171 | jval = fsref / (aic26->mclk / 2048); |
172 | /* compute fractional DDDD component of multiplier */ | ||
173 | dval = fsref - (jval * (aic26->mclk / 2048)); | ||
174 | dval = (10000 * dval) / (aic26->mclk / 2048); | ||
175 | dev_dbg(&aic26->spi->dev, "Setting PLLM to %d.%04d\n", jval, dval); | ||
168 | qval = 0; | 176 | qval = 0; |
169 | reg = 0x8000 | qval << 11 | pval << 8 | jval << 2; | 177 | reg = 0x8000 | qval << 11 | pval << 8 | jval << 2; |
170 | aic26_reg_write(codec, AIC26_REG_PLL_PROG1, reg); | 178 | aic26_reg_write(codec, AIC26_REG_PLL_PROG1, reg); |
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index c3d96fc8c267..789453d44ec5 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c | |||
@@ -1114,12 +1114,19 @@ static int aic3x_set_power(struct snd_soc_codec *codec, int power) | |||
1114 | 1114 | ||
1115 | /* Sync reg_cache with the hardware */ | 1115 | /* Sync reg_cache with the hardware */ |
1116 | codec->cache_only = 0; | 1116 | codec->cache_only = 0; |
1117 | for (i = 0; i < ARRAY_SIZE(aic3x_reg); i++) | 1117 | for (i = AIC3X_SAMPLE_RATE_SEL_REG; i < ARRAY_SIZE(aic3x_reg); i++) |
1118 | snd_soc_write(codec, i, cache[i]); | 1118 | snd_soc_write(codec, i, cache[i]); |
1119 | if (aic3x->model == AIC3X_MODEL_3007) | 1119 | if (aic3x->model == AIC3X_MODEL_3007) |
1120 | aic3x_init_3007(codec); | 1120 | aic3x_init_3007(codec); |
1121 | codec->cache_sync = 0; | 1121 | codec->cache_sync = 0; |
1122 | } else { | 1122 | } else { |
1123 | /* | ||
1124 | * Do soft reset to this codec instance in order to clear | ||
1125 | * possible VDD leakage currents in case the supply regulators | ||
1126 | * remain on | ||
1127 | */ | ||
1128 | snd_soc_write(codec, AIC3X_RESET, SOFT_RESET); | ||
1129 | codec->cache_sync = 1; | ||
1123 | aic3x->power = 0; | 1130 | aic3x->power = 0; |
1124 | /* HW writes are needless when bias is off */ | 1131 | /* HW writes are needless when bias is off */ |
1125 | codec->cache_only = 1; | 1132 | codec->cache_only = 1; |
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 2dc964b55e4f..76b4361e9b80 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c | |||
@@ -175,6 +175,7 @@ static const struct snd_kcontrol_new wm8731_input_mux_controls = | |||
175 | SOC_DAPM_ENUM("Input Select", wm8731_insel_enum); | 175 | SOC_DAPM_ENUM("Input Select", wm8731_insel_enum); |
176 | 176 | ||
177 | static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = { | 177 | static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = { |
178 | SND_SOC_DAPM_SUPPLY("ACTIVE",WM8731_ACTIVE, 0, 0, NULL, 0), | ||
178 | SND_SOC_DAPM_SUPPLY("OSC", WM8731_PWR, 5, 1, NULL, 0), | 179 | SND_SOC_DAPM_SUPPLY("OSC", WM8731_PWR, 5, 1, NULL, 0), |
179 | SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1, | 180 | SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1, |
180 | &wm8731_output_mixer_controls[0], | 181 | &wm8731_output_mixer_controls[0], |
@@ -204,6 +205,8 @@ static int wm8731_check_osc(struct snd_soc_dapm_widget *source, | |||
204 | static const struct snd_soc_dapm_route wm8731_intercon[] = { | 205 | static const struct snd_soc_dapm_route wm8731_intercon[] = { |
205 | {"DAC", NULL, "OSC", wm8731_check_osc}, | 206 | {"DAC", NULL, "OSC", wm8731_check_osc}, |
206 | {"ADC", NULL, "OSC", wm8731_check_osc}, | 207 | {"ADC", NULL, "OSC", wm8731_check_osc}, |
208 | {"DAC", NULL, "ACTIVE"}, | ||
209 | {"ADC", NULL, "ACTIVE"}, | ||
207 | 210 | ||
208 | /* output mixer */ | 211 | /* output mixer */ |
209 | {"Output Mixer", "Line Bypass Switch", "Line Input"}, | 212 | {"Output Mixer", "Line Bypass Switch", "Line Input"}, |
@@ -315,29 +318,6 @@ static int wm8731_hw_params(struct snd_pcm_substream *substream, | |||
315 | return 0; | 318 | return 0; |
316 | } | 319 | } |
317 | 320 | ||
318 | static int wm8731_pcm_prepare(struct snd_pcm_substream *substream, | ||
319 | struct snd_soc_dai *dai) | ||
320 | { | ||
321 | struct snd_soc_codec *codec = dai->codec; | ||
322 | |||
323 | /* set active */ | ||
324 | snd_soc_write(codec, WM8731_ACTIVE, 0x0001); | ||
325 | |||
326 | return 0; | ||
327 | } | ||
328 | |||
329 | static void wm8731_shutdown(struct snd_pcm_substream *substream, | ||
330 | struct snd_soc_dai *dai) | ||
331 | { | ||
332 | struct snd_soc_codec *codec = dai->codec; | ||
333 | |||
334 | /* deactivate */ | ||
335 | if (!codec->active) { | ||
336 | udelay(50); | ||
337 | snd_soc_write(codec, WM8731_ACTIVE, 0x0); | ||
338 | } | ||
339 | } | ||
340 | |||
341 | static int wm8731_mute(struct snd_soc_dai *dai, int mute) | 321 | static int wm8731_mute(struct snd_soc_dai *dai, int mute) |
342 | { | 322 | { |
343 | struct snd_soc_codec *codec = dai->codec; | 323 | struct snd_soc_codec *codec = dai->codec; |
@@ -480,7 +460,6 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec, | |||
480 | snd_soc_write(codec, WM8731_PWR, reg | 0x0040); | 460 | snd_soc_write(codec, WM8731_PWR, reg | 0x0040); |
481 | break; | 461 | break; |
482 | case SND_SOC_BIAS_OFF: | 462 | case SND_SOC_BIAS_OFF: |
483 | snd_soc_write(codec, WM8731_ACTIVE, 0x0); | ||
484 | snd_soc_write(codec, WM8731_PWR, 0xffff); | 463 | snd_soc_write(codec, WM8731_PWR, 0xffff); |
485 | regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), | 464 | regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), |
486 | wm8731->supplies); | 465 | wm8731->supplies); |
@@ -496,9 +475,7 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec, | |||
496 | SNDRV_PCM_FMTBIT_S24_LE) | 475 | SNDRV_PCM_FMTBIT_S24_LE) |
497 | 476 | ||
498 | static struct snd_soc_dai_ops wm8731_dai_ops = { | 477 | static struct snd_soc_dai_ops wm8731_dai_ops = { |
499 | .prepare = wm8731_pcm_prepare, | ||
500 | .hw_params = wm8731_hw_params, | 478 | .hw_params = wm8731_hw_params, |
501 | .shutdown = wm8731_shutdown, | ||
502 | .digital_mute = wm8731_mute, | 479 | .digital_mute = wm8731_mute, |
503 | .set_sysclk = wm8731_set_dai_sysclk, | 480 | .set_sysclk = wm8731_set_dai_sysclk, |
504 | .set_fmt = wm8731_set_dai_fmt, | 481 | .set_fmt = wm8731_set_dai_fmt, |
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 970a95c5360b..c2fc0356c2a4 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -1713,6 +1713,8 @@ static int _wm8994_set_fll(struct snd_soc_codec *codec, int id, int src, | |||
1713 | snd_soc_update_bits(codec, WM8994_FLL1_CONTROL_1 + reg_offset, | 1713 | snd_soc_update_bits(codec, WM8994_FLL1_CONTROL_1 + reg_offset, |
1714 | WM8994_FLL1_ENA | WM8994_FLL1_FRAC, | 1714 | WM8994_FLL1_ENA | WM8994_FLL1_FRAC, |
1715 | reg); | 1715 | reg); |
1716 | |||
1717 | msleep(5); | ||
1716 | } | 1718 | } |
1717 | 1719 | ||
1718 | wm8994->fll[id].in = freq_in; | 1720 | wm8994->fll[id].in = freq_in; |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d75043ed7fc0..b194be09e74d 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1929,8 +1929,9 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) | |||
1929 | "%s", card->name); | 1929 | "%s", card->name); |
1930 | snprintf(card->snd_card->longname, sizeof(card->snd_card->longname), | 1930 | snprintf(card->snd_card->longname, sizeof(card->snd_card->longname), |
1931 | "%s", card->long_name ? card->long_name : card->name); | 1931 | "%s", card->long_name ? card->long_name : card->name); |
1932 | snprintf(card->snd_card->driver, sizeof(card->snd_card->driver), | 1932 | if (card->driver_name) |
1933 | "%s", card->driver_name ? card->driver_name : card->name); | 1933 | strlcpy(card->snd_card->driver, card->driver_name, |
1934 | sizeof(card->snd_card->driver)); | ||
1934 | 1935 | ||
1935 | if (card->late_probe) { | 1936 | if (card->late_probe) { |
1936 | ret = card->late_probe(card); | 1937 | ret = card->late_probe(card); |
diff --git a/sound/soc/tegra/tegra_i2s.c b/sound/soc/tegra/tegra_i2s.c index 6b817e20548c..95f03c10b4f7 100644 --- a/sound/soc/tegra/tegra_i2s.c +++ b/sound/soc/tegra/tegra_i2s.c | |||
@@ -222,12 +222,18 @@ static int tegra_i2s_hw_params(struct snd_pcm_substream *substream, | |||
222 | if (i2sclock % (2 * srate)) | 222 | if (i2sclock % (2 * srate)) |
223 | reg |= TEGRA_I2S_TIMING_NON_SYM_ENABLE; | 223 | reg |= TEGRA_I2S_TIMING_NON_SYM_ENABLE; |
224 | 224 | ||
225 | if (!i2s->clk_refs) | ||
226 | clk_enable(i2s->clk_i2s); | ||
227 | |||
225 | tegra_i2s_write(i2s, TEGRA_I2S_TIMING, reg); | 228 | tegra_i2s_write(i2s, TEGRA_I2S_TIMING, reg); |
226 | 229 | ||
227 | tegra_i2s_write(i2s, TEGRA_I2S_FIFO_SCR, | 230 | tegra_i2s_write(i2s, TEGRA_I2S_FIFO_SCR, |
228 | TEGRA_I2S_FIFO_SCR_FIFO2_ATN_LVL_FOUR_SLOTS | | 231 | TEGRA_I2S_FIFO_SCR_FIFO2_ATN_LVL_FOUR_SLOTS | |
229 | TEGRA_I2S_FIFO_SCR_FIFO1_ATN_LVL_FOUR_SLOTS); | 232 | TEGRA_I2S_FIFO_SCR_FIFO1_ATN_LVL_FOUR_SLOTS); |
230 | 233 | ||
234 | if (!i2s->clk_refs) | ||
235 | clk_disable(i2s->clk_i2s); | ||
236 | |||
231 | return 0; | 237 | return 0; |
232 | } | 238 | } |
233 | 239 | ||