ar71xx: add latch_change field to rb750_led_platform_data
authorGabor Juhos <juhosg@openwrt.org>
Mon, 19 Mar 2012 15:57:01 +0000 (15:57 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Mon, 19 Mar 2012 15:57:01 +0000 (15:57 +0000)
SVN-Revision: 31023

target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c
target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/mach-rb750.h
target/linux/ar71xx/files/drivers/leds/leds-rb750.c

index bcd961e1bd97048147c82e7d8c7f60182501d977..4ef1b10d37496c0d170b053f8d4ebf22c215aeaa 100644 (file)
@@ -47,11 +47,7 @@ static struct rb750_led_data rb750_leds[] = {
        }
 };
 
        }
 };
 
-static struct rb750_led_platform_data rb750_leds_data = {
-       .num_leds       = ARRAY_SIZE(rb750_leds),
-       .leds           = rb750_leds,
-};
-
+static struct rb750_led_platform_data rb750_leds_data;
 static struct platform_device rb750_leds_device = {
        .name   = "leds-rb750",
        .dev    = {
 static struct platform_device rb750_leds_device = {
        .name   = "leds-rb750",
        .dev    = {
@@ -155,6 +151,9 @@ static void __init rb750_setup(void)
        /* WAN port */
        ath79_register_eth(0);
 
        /* WAN port */
        ath79_register_eth(0);
 
+       rb750_leds_data.num_leds = ARRAY_SIZE(rb750_leds);
+       rb750_leds_data.leds = rb750_leds;
+       rb750_leds_data.latch_change = rb750_nand_latch_change;
        platform_device_register(&rb750_leds_device);
 
        rb750_nand_data.nce_line = RB750_NAND_NCE;
        platform_device_register(&rb750_leds_device);
 
        rb750_nand_data.nce_line = RB750_NAND_NCE;
index 9509fca71eb2c37571adbe3bbe558f56a548dae1..19d7a12123f39bc7daf33838f30fb84e24fcb657 100644 (file)
@@ -60,6 +60,7 @@ struct rb750_led_data {
 struct rb750_led_platform_data {
        int                     num_leds;
        struct rb750_led_data   *leds;
 struct rb750_led_platform_data {
        int                     num_leds;
        struct rb750_led_data   *leds;
+       void                    (*latch_change)(u32 clear, u32 set);
 };
 
 struct rb7xx_nand_platform_data {
 };
 
 struct rb7xx_nand_platform_data {
index 40469444fec3bd3f4a4ad4b48546b49426ec9327..483e4fc96767e843afaa6019cfd4dc8f8042b4a2 100644 (file)
@@ -23,6 +23,7 @@ struct rb750_led_dev {
        struct led_classdev     cdev;
        u32                     mask;
        int                     active_low;
        struct led_classdev     cdev;
        u32                     mask;
        int                     active_low;
+       void                    (*latch_change)(u32 clear, u32 set);
 };
 
 struct rb750_led_drvdata {
 };
 
 struct rb750_led_drvdata {
@@ -46,9 +47,9 @@ static void rb750_led_brightness_set(struct led_classdev *led_cdev,
        level ^= rbled->active_low;
 
        if (level)
        level ^= rbled->active_low;
 
        if (level)
-               rb750_latch_change(0, rbled->mask);
+               rbled->latch_change(0, rbled->mask);
        else
        else
-               rb750_latch_change(rbled->mask, 0);
+               rbled->latch_change(rbled->mask, 0);
 }
 
 static int __devinit rb750_led_probe(struct platform_device *pdev)
 }
 
 static int __devinit rb750_led_probe(struct platform_device *pdev)
@@ -82,6 +83,7 @@ static int __devinit rb750_led_probe(struct platform_device *pdev)
 
                rbled->mask = led_data->mask;
                rbled->active_low = !!led_data->active_low;
 
                rbled->mask = led_data->mask;
                rbled->active_low = !!led_data->active_low;
+               rbled->latch_change = pdata->latch_change;
 
                ret = led_classdev_register(&pdev->dev, &rbled->cdev);
                if (ret)
 
                ret = led_classdev_register(&pdev->dev, &rbled->cdev);
                if (ret)