diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-01 21:46:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-01 21:46:13 -0400 |
commit | 8f446a7a069e0af0639385f67c78ee2279bca04c (patch) | |
tree | 580cf495616b36ca0af0826afa87c430cdc1e7cb /arch/arm/mach-ebsa110 | |
parent | 84be4ae2c038e2b03d650cbf2a7cfd9e8d6e9e51 (diff) | |
parent | 04ef037c926ddb31088c976538e29eada4fd1490 (diff) |
Merge tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM soc driver specific changes from Olof Johansson:
- A long-coming conversion of various platforms to a common LED
infrastructure
- AT91 is moved over to use the newer MCI driver for MMC
- Pincontrol conversions for samsung platforms
- DT bindings for gscaler on samsung
- i2c driver fixes for tegra, acked by i2c maintainer
Fix up conflicts as per Olof.
* tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (48 commits)
drivers: bus: omap_l3: use resources instead of hardcoded irqs
pinctrl: exynos: Fix wakeup IRQ domain registration check
pinctrl: samsung: Uninline samsung_pinctrl_get_soc_data
pinctrl: exynos: Correct the detection of wakeup-eint node
pinctrl: exynos: Mark exynos_irq_demux_eint as inline
pinctrl: exynos: Handle only unmasked wakeup interrupts
pinctrl: exynos: Fix typos in gpio/wkup _irq_mask
pinctrl: exynos: Set pin function to EINT in irq_set_type of GPIO EINTa
drivers: bus: Move the OMAP interconnect driver to drivers/bus/
i2c: tegra: dynamically control fast clk
i2c: tegra: I2_M_NOSTART functionality not supported in Tegra20
ARM: tegra: clock: remove unused clock entry for i2c
ARM: tegra: clock: add connection name in i2c clock entry
i2c: tegra: pass proper name for getting clock
ARM: tegra: clock: add i2c fast clock entry in clock table
ARM: EXYNOS: Adds G-Scaler device from Device Tree
ARM: EXYNOS: Add clock support for G-Scaler
ARM: EXYNOS: Enable pinctrl driver support for EXYNOS4 device tree enabled platform
ARM: dts: Add pinctrl node entries for SAMSUNG EXYNOS4210 SoC
ARM: EXYNOS: skip wakeup interrupt setup if pinctrl driver is used
...
Diffstat (limited to 'arch/arm/mach-ebsa110')
-rw-r--r-- | arch/arm/mach-ebsa110/Makefile | 4 | ||||
-rw-r--r-- | arch/arm/mach-ebsa110/leds.c | 81 |
2 files changed, 51 insertions, 34 deletions
diff --git a/arch/arm/mach-ebsa110/Makefile b/arch/arm/mach-ebsa110/Makefile index 6520ac835802..935e4af01a27 100644 --- a/arch/arm/mach-ebsa110/Makefile +++ b/arch/arm/mach-ebsa110/Makefile | |||
@@ -4,9 +4,7 @@ | |||
4 | 4 | ||
5 | # Object file lists. | 5 | # Object file lists. |
6 | 6 | ||
7 | obj-y := core.o io.o | 7 | obj-y := core.o io.o leds.o |
8 | obj-m := | 8 | obj-m := |
9 | obj-n := | 9 | obj-n := |
10 | obj- := | 10 | obj- := |
11 | |||
12 | obj-$(CONFIG_LEDS) += leds.o | ||
diff --git a/arch/arm/mach-ebsa110/leds.c b/arch/arm/mach-ebsa110/leds.c index 99e14e362500..0398258c20cd 100644 --- a/arch/arm/mach-ebsa110/leds.c +++ b/arch/arm/mach-ebsa110/leds.c | |||
@@ -1,52 +1,71 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/mach-ebsa110/leds.c | 2 | * Driver for the LED found on the EBSA110 machine |
3 | * Based on Versatile and RealView machine LED code | ||
3 | * | 4 | * |
4 | * Copyright (C) 1998 Russell King | 5 | * License terms: GNU General Public License (GPL) version 2 |
5 | * | 6 | * Author: Bryan Wu <bryan.wu@canonical.com> |
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * EBSA-110 LED control routines. We use the led as follows: | ||
11 | * | ||
12 | * - Red - toggles state every 50 timer interrupts | ||
13 | */ | 7 | */ |
14 | #include <linux/module.h> | 8 | #include <linux/kernel.h> |
15 | #include <linux/spinlock.h> | ||
16 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/io.h> | ||
11 | #include <linux/slab.h> | ||
12 | #include <linux/leds.h> | ||
17 | 13 | ||
18 | #include <mach/hardware.h> | ||
19 | #include <asm/leds.h> | ||
20 | #include <asm/mach-types.h> | 14 | #include <asm/mach-types.h> |
21 | 15 | ||
22 | #include "core.h" | 16 | #include "core.h" |
23 | 17 | ||
24 | static spinlock_t leds_lock; | 18 | #if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS) |
25 | 19 | static void ebsa110_led_set(struct led_classdev *cdev, | |
26 | static void ebsa110_leds_event(led_event_t ledevt) | 20 | enum led_brightness b) |
27 | { | 21 | { |
28 | unsigned long flags; | 22 | u8 reg = __raw_readb(SOFT_BASE); |
29 | 23 | ||
30 | spin_lock_irqsave(&leds_lock, flags); | 24 | if (b != LED_OFF) |
25 | reg |= 0x80; | ||
26 | else | ||
27 | reg &= ~0x80; | ||
31 | 28 | ||
32 | switch(ledevt) { | 29 | __raw_writeb(reg, SOFT_BASE); |
33 | case led_timer: | 30 | } |
34 | *(volatile unsigned char *)SOFT_BASE ^= 128; | ||
35 | break; | ||
36 | 31 | ||
37 | default: | 32 | static enum led_brightness ebsa110_led_get(struct led_classdev *cdev) |
38 | break; | 33 | { |
39 | } | 34 | u8 reg = __raw_readb(SOFT_BASE); |
40 | 35 | ||
41 | spin_unlock_irqrestore(&leds_lock, flags); | 36 | return (reg & 0x80) ? LED_FULL : LED_OFF; |
42 | } | 37 | } |
43 | 38 | ||
44 | static int __init leds_init(void) | 39 | static int __init ebsa110_leds_init(void) |
45 | { | 40 | { |
46 | if (machine_is_ebsa110()) | 41 | |
47 | leds_event = ebsa110_leds_event; | 42 | struct led_classdev *cdev; |
43 | int ret; | ||
44 | |||
45 | if (!machine_is_ebsa110()) | ||
46 | return -ENODEV; | ||
47 | |||
48 | cdev = kzalloc(sizeof(*cdev), GFP_KERNEL); | ||
49 | if (!cdev) | ||
50 | return -ENOMEM; | ||
51 | |||
52 | cdev->name = "ebsa110:0"; | ||
53 | cdev->brightness_set = ebsa110_led_set; | ||
54 | cdev->brightness_get = ebsa110_led_get; | ||
55 | cdev->default_trigger = "heartbeat"; | ||
56 | |||
57 | ret = led_classdev_register(NULL, cdev); | ||
58 | if (ret < 0) { | ||
59 | kfree(cdev); | ||
60 | return ret; | ||
61 | } | ||
48 | 62 | ||
49 | return 0; | 63 | return 0; |
50 | } | 64 | } |
51 | 65 | ||
52 | __initcall(leds_init); | 66 | /* |
67 | * Since we may have triggers on any subsystem, defer registration | ||
68 | * until after subsystem_init. | ||
69 | */ | ||
70 | fs_initcall(ebsa110_leds_init); | ||
71 | #endif | ||