-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJZXUGpAAoJEL1qUBy3i3wmBdgP/jhpBsA9D+W4grLEzbTSTWSV GKm19egbgujyLWkTecs1ICtuPYQFI90xV2HqmoSsXa9BEZHErB7zbubBzPEqS4RW ghsqweaLllOe6LtHs/ZvgvTGILaivpvK1R9qawaqJi6Cmg0VZvG8ApQNNpQD6bnj YCknKetLK+pdcjVCTaG7hyf+Ess7ASrwiWwIBiU26K+X6p7YpilxT5AylYWH6erl s+Lr3U0As86Fj+/ELOgmYBMTO1phZ7r1FSR/sa7RTlfgEgJQxmgagCfAvPGH92K3 gK0UKKKirzfU08nUliHeHqn1K9ZaTKS15bbRNHpzl3/be/oLCuN3kB/Y/ZWtPgOc pEaCkWn2+4TeChlznyEmmTAeJgKLOBlt8ffSlz+wWNNL9wjG/LVm0Gq/eO49rWsG fJVbAT/lnWQ5dVEXlzQbw4uKU8DZDpjChjkv7shLMcValUtysnJ/w3edl5Czyx0y s2ckFmWnmQwTd+//PoJYnfdywPc3NfpsJD2j2VrEc0unsodAszwrdHdFVmsSgAJY u6cbrrxWYakXUcV/6gKVybhdMpNsV4f2KDthxrZmN3JGetQU/zoNsMBrNJu30l3d Iifry+UlYNHoozITKyk1+J3atEF6YzMIhuJTP1ifN07tvo5WaSESPFuoJdxLFlyt 4OZcjjWj+CGqZ6+RSUya =5JLc -----END PGP SIGNATURE----- Merge tag 'leds_for_4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds Pull LED updates from Jacek Anaszewski: "This time we're removing more than adding: Removed drivers: leds-versatile: - all users of the Versatile LED driver are deleted and replaced with the very generic leds-syscon leds-sead3: - SEAD3 is using the generic leds-syscon & regmap based register-bit-led driver LED class drivers improvements: ledtrig-gpio: - use threaded IRQ, which both simplifies the code because we can drop the workqueue indirection, and it enables using the trigger for GPIOs that work with threaded IRQs themselves - refresh LED state after GPIO change since the new GPIO may have a different state than the old one leds-lp55xx: - make various arrays static const leds-pca963x: - add bindings to invert polarity" * tag 'leds_for_4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds: leds: lp55xx: make various arrays static const leds: Remove SEAD-3 driver leds: trigger: gpio: Use threaded IRQ leds: trigger: gpio: Refresh LED state after GPIO change leds: Delete obsolete Versatile driver leds: pca963x: Add bindings to invert polaritytirimbino
commit
4f5dfdd290
@ -1,78 +0,0 @@ |
||||
/*
|
||||
* This file is subject to the terms and conditions of the GNU General Public |
||||
* License. See the file "COPYING" in the main directory of this archive |
||||
* for more details. |
||||
* |
||||
* Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. |
||||
* Copyright (C) 2015 Imagination Technologies, Inc. |
||||
*/ |
||||
#include <linux/kernel.h> |
||||
#include <linux/module.h> |
||||
#include <linux/init.h> |
||||
#include <linux/platform_device.h> |
||||
#include <linux/leds.h> |
||||
#include <linux/err.h> |
||||
#include <linux/io.h> |
||||
|
||||
#include <asm/mips-boards/sead3-addr.h> |
||||
|
||||
static void sead3_pled_set(struct led_classdev *led_cdev, |
||||
enum led_brightness value) |
||||
{ |
||||
writel(value, (void __iomem *)SEAD3_CPLD_P_LED); |
||||
} |
||||
|
||||
static void sead3_fled_set(struct led_classdev *led_cdev, |
||||
enum led_brightness value) |
||||
{ |
||||
writel(value, (void __iomem *)SEAD3_CPLD_F_LED); |
||||
} |
||||
|
||||
static struct led_classdev sead3_pled = { |
||||
.name = "sead3::pled", |
||||
.brightness_set = sead3_pled_set, |
||||
.flags = LED_CORE_SUSPENDRESUME, |
||||
}; |
||||
|
||||
static struct led_classdev sead3_fled = { |
||||
.name = "sead3::fled", |
||||
.brightness_set = sead3_fled_set, |
||||
.flags = LED_CORE_SUSPENDRESUME, |
||||
}; |
||||
|
||||
static int sead3_led_probe(struct platform_device *pdev) |
||||
{ |
||||
int ret; |
||||
|
||||
ret = led_classdev_register(&pdev->dev, &sead3_pled); |
||||
if (ret < 0) |
||||
return ret; |
||||
|
||||
ret = led_classdev_register(&pdev->dev, &sead3_fled); |
||||
if (ret < 0) |
||||
led_classdev_unregister(&sead3_pled); |
||||
|
||||
return ret; |
||||
} |
||||
|
||||
static int sead3_led_remove(struct platform_device *pdev) |
||||
{ |
||||
led_classdev_unregister(&sead3_pled); |
||||
led_classdev_unregister(&sead3_fled); |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
static struct platform_driver sead3_led_driver = { |
||||
.probe = sead3_led_probe, |
||||
.remove = sead3_led_remove, |
||||
.driver = { |
||||
.name = "sead3-led", |
||||
}, |
||||
}; |
||||
|
||||
module_platform_driver(sead3_led_driver); |
||||
|
||||
MODULE_AUTHOR("Kristian Kielhofner <kris@krisk.org>"); |
||||
MODULE_DESCRIPTION("SEAD3 LED driver"); |
||||
MODULE_LICENSE("GPL"); |
@ -1,110 +0,0 @@ |
||||
/*
|
||||
* Driver for the 8 user LEDs found on the RealViews and Versatiles |
||||
* Based on DaVinci's DM365 board code |
||||
* |
||||
* License terms: GNU General Public License (GPL) version 2 |
||||
* Author: Linus Walleij <triad@df.lth.se> |
||||
*/ |
||||
#include <linux/kernel.h> |
||||
#include <linux/init.h> |
||||
#include <linux/module.h> |
||||
#include <linux/io.h> |
||||
#include <linux/slab.h> |
||||
#include <linux/leds.h> |
||||
#include <linux/platform_device.h> |
||||
|
||||
struct versatile_led { |
||||
void __iomem *base; |
||||
struct led_classdev cdev; |
||||
u8 mask; |
||||
}; |
||||
|
||||
/*
|
||||
* The triggers lines up below will only be used if the |
||||
* LED triggers are compiled in. |
||||
*/ |
||||
static const struct { |
||||
const char *name; |
||||
const char *trigger; |
||||
} versatile_leds[] = { |
||||
{ "versatile:0", "heartbeat", }, |
||||
{ "versatile:1", "mmc0", }, |
||||
{ "versatile:2", "cpu0" }, |
||||
{ "versatile:3", "cpu1" }, |
||||
{ "versatile:4", "cpu2" }, |
||||
{ "versatile:5", "cpu3" }, |
||||
{ "versatile:6", }, |
||||
{ "versatile:7", }, |
||||
}; |
||||
|
||||
static void versatile_led_set(struct led_classdev *cdev, |
||||
enum led_brightness b) |
||||
{ |
||||
struct versatile_led *led = container_of(cdev, |
||||
struct versatile_led, cdev); |
||||
u32 reg = readl(led->base); |
||||
|
||||
if (b != LED_OFF) |
||||
reg |= led->mask; |
||||
else |
||||
reg &= ~led->mask; |
||||
writel(reg, led->base); |
||||
} |
||||
|
||||
static enum led_brightness versatile_led_get(struct led_classdev *cdev) |
||||
{ |
||||
struct versatile_led *led = container_of(cdev, |
||||
struct versatile_led, cdev); |
||||
u32 reg = readl(led->base); |
||||
|
||||
return (reg & led->mask) ? LED_FULL : LED_OFF; |
||||
} |
||||
|
||||
static int versatile_leds_probe(struct platform_device *dev) |
||||
{ |
||||
int i; |
||||
struct resource *res; |
||||
void __iomem *base; |
||||
|
||||
res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
||||
base = devm_ioremap_resource(&dev->dev, res); |
||||
if (IS_ERR(base)) |
||||
return PTR_ERR(base); |
||||
|
||||
/* All off */ |
||||
writel(0, base); |
||||
for (i = 0; i < ARRAY_SIZE(versatile_leds); i++) { |
||||
struct versatile_led *led; |
||||
|
||||
led = kzalloc(sizeof(*led), GFP_KERNEL); |
||||
if (!led) |
||||
break; |
||||
|
||||
led->base = base; |
||||
led->cdev.name = versatile_leds[i].name; |
||||
led->cdev.brightness_set = versatile_led_set; |
||||
led->cdev.brightness_get = versatile_led_get; |
||||
led->cdev.default_trigger = versatile_leds[i].trigger; |
||||
led->mask = BIT(i); |
||||
|
||||
if (led_classdev_register(NULL, &led->cdev) < 0) { |
||||
kfree(led); |
||||
break; |
||||
} |
||||
} |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
static struct platform_driver versatile_leds_driver = { |
||||
.driver = { |
||||
.name = "versatile-leds", |
||||
}, |
||||
.probe = versatile_leds_probe, |
||||
}; |
||||
|
||||
module_platform_driver(versatile_leds_driver); |
||||
|
||||
MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); |
||||
MODULE_DESCRIPTION("ARM Versatile LED driver"); |
||||
MODULE_LICENSE("GPL v2"); |
Loading…
Reference in new issue