diff options
author | Pawel Moll <pawel.moll@arm.com> | 2012-11-19 08:39:04 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-12-07 19:33:57 -0500 |
commit | 5faf7cbb848da827f6ea1458b5a1c26a44e7510a (patch) | |
tree | 553c142358276c2c0eb78895fa14736f51582baa /drivers | |
parent | a5559a3336205eaa7c8302fcbe9da1e35f2e5a3a (diff) |
mfd: vexpress-sysreg: Remove LEDs code
As the current LEDs code breaks other platform, remove it.
It shall be replaced by a generic "MMIO LEDs" driver.
Reported-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mfd/vexpress-sysreg.c | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c index 059d6b17b14a..733c06bd2d17 100644 --- a/drivers/mfd/vexpress-sysreg.c +++ b/drivers/mfd/vexpress-sysreg.c | |||
@@ -473,80 +473,3 @@ static int __init vexpress_sysreg_init(void) | |||
473 | return platform_driver_register(&vexpress_sysreg_driver); | 473 | return platform_driver_register(&vexpress_sysreg_driver); |
474 | } | 474 | } |
475 | core_initcall(vexpress_sysreg_init); | 475 | core_initcall(vexpress_sysreg_init); |
476 | |||
477 | |||
478 | #if defined(CONFIG_LEDS_CLASS) | ||
479 | |||
480 | struct vexpress_sysreg_led { | ||
481 | u32 mask; | ||
482 | struct led_classdev cdev; | ||
483 | } vexpress_sysreg_leds[] = { | ||
484 | { .mask = 1 << 0, .cdev.name = "v2m:green:user1", | ||
485 | .cdev.default_trigger = "heartbeat", }, | ||
486 | { .mask = 1 << 1, .cdev.name = "v2m:green:user2", | ||
487 | .cdev.default_trigger = "mmc0", }, | ||
488 | { .mask = 1 << 2, .cdev.name = "v2m:green:user3", | ||
489 | .cdev.default_trigger = "cpu0", }, | ||
490 | { .mask = 1 << 3, .cdev.name = "v2m:green:user4", | ||
491 | .cdev.default_trigger = "cpu1", }, | ||
492 | { .mask = 1 << 4, .cdev.name = "v2m:green:user5", | ||
493 | .cdev.default_trigger = "cpu2", }, | ||
494 | { .mask = 1 << 5, .cdev.name = "v2m:green:user6", | ||
495 | .cdev.default_trigger = "cpu3", }, | ||
496 | { .mask = 1 << 6, .cdev.name = "v2m:green:user7", | ||
497 | .cdev.default_trigger = "cpu4", }, | ||
498 | { .mask = 1 << 7, .cdev.name = "v2m:green:user8", | ||
499 | .cdev.default_trigger = "cpu5", }, | ||
500 | }; | ||
501 | |||
502 | static DEFINE_SPINLOCK(vexpress_sysreg_leds_lock); | ||
503 | |||
504 | static void vexpress_sysreg_led_brightness_set(struct led_classdev *cdev, | ||
505 | enum led_brightness brightness) | ||
506 | { | ||
507 | struct vexpress_sysreg_led *led = container_of(cdev, | ||
508 | struct vexpress_sysreg_led, cdev); | ||
509 | unsigned long flags; | ||
510 | u32 val; | ||
511 | |||
512 | spin_lock_irqsave(&vexpress_sysreg_leds_lock, flags); | ||
513 | |||
514 | val = readl(vexpress_sysreg_base + SYS_LED); | ||
515 | if (brightness == LED_OFF) | ||
516 | val &= ~led->mask; | ||
517 | else | ||
518 | val |= led->mask; | ||
519 | writel(val, vexpress_sysreg_base + SYS_LED); | ||
520 | |||
521 | spin_unlock_irqrestore(&vexpress_sysreg_leds_lock, flags); | ||
522 | } | ||
523 | |||
524 | static int __init vexpress_sysreg_init_leds(void) | ||
525 | { | ||
526 | struct vexpress_sysreg_led *led; | ||
527 | int i; | ||
528 | |||
529 | /* Clear all user LEDs */ | ||
530 | writel(0, vexpress_sysreg_base + SYS_LED); | ||
531 | |||
532 | for (i = 0, led = vexpress_sysreg_leds; | ||
533 | i < ARRAY_SIZE(vexpress_sysreg_leds); i++, led++) { | ||
534 | int err; | ||
535 | |||
536 | led->cdev.brightness_set = vexpress_sysreg_led_brightness_set; | ||
537 | err = led_classdev_register(vexpress_sysreg_dev, &led->cdev); | ||
538 | if (err) { | ||
539 | dev_err(vexpress_sysreg_dev, | ||
540 | "Failed to register LED %d! (%d)\n", | ||
541 | i, err); | ||
542 | while (led--, i--) | ||
543 | led_classdev_unregister(&led->cdev); | ||
544 | return err; | ||
545 | } | ||
546 | } | ||
547 | |||
548 | return 0; | ||
549 | } | ||
550 | device_initcall(vexpress_sysreg_init_leds); | ||
551 | |||
552 | #endif | ||