[OpenWrt-Devel] Help required for LED toggling for SATA host controller

Deepanjan Kar dkar at ikanos.com
Tue Apr 7 09:50:12 EDT 2015


Dear All,

I have introduced a new file in the linux-3.10.49/drivers/leds directory for SATA LED toggling.
I however find that the callback registered for LED activity is not getting called.
Underneath is the snippet of code and the function in RED is the one that I am talking about.
I do see the print in the function satadev_trig_init onces the ledtrig-satadev.ko function is inmod.

static struct led_trigger satadev_led_trigger = {
                .name                   = "satadev-led",
                .activate               = satadev_trig_activate,
                .deactivate         = satadev_trig_deactivate,
};

static int __init satadev_trig_init(void)
{
                printk("SATA_LED %s\n", __func__);
                return led_trigger_register(&satadev_led_trigger);
}

I have also made the following changes in the following files


1.       Makefile
obj-$(CONFIG_LEDS_FUSIV_SATADEV)       += ledtrig-satadev.o

2.       Kconfig

config LEDS_FUSIV_SATADEV

        tristate "LED Support for FUSIV platforms"

        help

          This file enables lED toggling for SATA on Fusiv platforms

3.       openwrt/package/kernel/linux/modules/leds.mk

define KernelPackage/ledtrig-satadev

  SUBMENU:=$(LEDS_MENU)

  TITLE:=Catshark SATA LED

  KCONFIG:=CONFIG_LEDS_FUSIV_SATADEV

  FILES:=$(LINUX_DIR)/drivers/leds/ledtrig-satadev.ko

  DEPENDS:=+kmod-ata-ahci

  AUTOLOAD:=$(call AutoLoad,81,satadev-led,0)

endef



define KernelPackage/KernelPackage/ledtrig-satadev/description

Support for Catshark SATA LED

endef



$(eval $(call KernelPackage,ledtrig-satadev))

4.       .config

The following LED macros are enabled in the config file

CONFIG_LEDS_GPIO_REGISTER=y

CONFIG_NEW_LEDS=y

CONFIG_LEDS_CLASS=y

#

# LED drivers

#

CONFIG_LEDS_GPIO=y

#

# LED Triggers

#

CONFIG_LEDS_TRIGGERS=y

Please let me know what else I need to do(/what I am missing) for the callback function satadev_trig_activate to get called.

Regards,
Deepanjan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150407/6a03594a/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list