Hey,

I'm trying to get the RB951G's LED's to work. The User led and wlan
led is connected to ethernet switch chip (pins LED_LINK10n_4 and
LED_LINK10n_0) - ethernet switch chip driver has to provide those led devices.

I have tried exposing them in the architecture like so:

#define RB_USER_LED             4
#define RB_WLAN_LED             0
#define RB_USB_POWER            20

static struct gpio_led rb95x_leds_gpio[] __initdata = {
        {
                .name           = "user-led",
                .gpio           = RB_USER_LED,
                .active_low     = 0,
        }, {
                .name           = "wlan-led",
                .gpio           = RB_WLAN_LED,
                .active_low     = 0,
        }, {
                .name           = "usb-power-off",
                .gpio           = RB_USB_POWER,
                .active_low     = 0,
        }
};

//and adding to __init rb95x_setup(void)
ath79_register_leds_gpio(-1, ARRAY_SIZE(rb95x_leds_gpio),
                                        rb95x_leds_gpio);

Mikrotik has provided me with the following LED Map:

static int rb951g_led_map[] = {
    PLD(4,15), 0, 0, 0, 0, 0, PLDI(20, 0), 0, PLD(0,15), PLEND
};
static struct platform_device rb951g_led_device = {
    .name    = "rb400-led",
    .id    = -1,
    .dev    = {
        .platform_data = rb951g_led_map,
    },
};

I have tried compiling in the rb400-led driver, and it still does not
expose the LED's. I have a feeling that the ar8327 switch driver needs
to allow the LED's to be exposed, however i'm unsure of how to do
that.

I was looking inside of "linux-3.7.4/drivers/net/phy/ar8216.c" where I found:

led_cfg = pdata->led_cfg;
        if (led_cfg) {
                if (led_cfg->open_drain)
                        new_pos |= AR8327_POWER_ON_STRIP_LED_OPEN_EN;
                else
                        new_pos &= ~AR8327_POWER_ON_STRIP_LED_OPEN_EN;

                priv->write(priv, AR8327_REG_LED_CTRL0, led_cfg->led_ctrl0);
                priv->write(priv, AR8327_REG_LED_CTRL1, led_cfg->led_ctrl1);
                priv->write(priv, AR8327_REG_LED_CTRL2, led_cfg->led_ctrl2);
                priv->write(priv, AR8327_REG_LED_CTRL3, led_cfg->led_ctrl3);
        }

Does something in that stanza need to be added to allow exposure of
LED_LINK10n_4 and
LED_LINK10n_0? Perhaps I read the LED Map incorrectly and do not have
the LED GPIO's defined right?

Any help is much appreciated :-)

-- Davey
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to