• nuvoton980 kernel support leds-gpio (五)


    1      Scope of Document

    This document describes kernel how to support leds-gpio

    2      Requiremen

    2.1     Function Requirement

    2.2     Performance Requirement

    NA

    3      Method

    3.1     Export cross compile

    3.2     Support  kernel  leds-gpio

    arch/arm/mach-nuc980/dev.c

    #define SMART_FOURCE_LEDS_GPIO

    #if defined(SMART_FOURCE_LEDS_GPIO)

    #include <linux/leds.h>

    #include <linux/gpio.h>

    #include <linux/gpio_keys.h>

    static struct gpio_led gpio_leds[] = {

            {

                    .name                   = "heartbeat",

                    .gpio                   = 170,

                    .default_trigger        = "heartbeat",

            },

            {

                    .name                   = "4g-power",

                    .gpio                   = 139,

                    .default_state          = 0,

            },

            {

                    .name                   = "4g-reset",

                    .gpio                   = 140,

                    .default_state          = 0,

            },

    };

    static struct gpio_led_platform_data gpio_led_info = {

            .leds           = gpio_leds,

            .num_leds       = ARRAY_SIZE(gpio_leds),

    };

    static struct platform_device leds_gpio = {

            .name   = "leds-gpio",

            .id     = -1,

            .dev    = {

                    .platform_data  = &gpio_led_info,

            },

    };

    #endif

    /* USB EHCI Host Controller */

    #if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE)

    static struct resource nuc980_ehci_resource[] = {

    #if defined(CONFIG_BACKLIGHT_PWM)

           &nuc980_pwm_bl,

    #endif

    +#if defined(SMART_FOURCE_LEDS_GPIO)

    +     &leds_gpio

    +#endif

    };

    make nuc980_eth2uart_defconfig

    make uImage

    4      Output file

    ../image/980uImage

  • 相关阅读:
    Frameworks.Entity.Core 5 EntityValidation
    Frameworks.Entity.Core 4
    大叔 Frameworks.Entity.Core 3 Predicate
    大叔 Frameworks.Entity.Core 2 PageList
    Frameworks.Entity.Core 1
    大叔 EF 来分析 EntityFrameworks.Data.Core 2
    大叔 EF 来分析 EntityFrameworks.Data.Core 1
    基于 Lind.DDD 的 权限管理系统
    HttpApplication IHttpAsyncHandler, IHttpHandler, IComponent, IDisposable ps url System.Web.dll
    MVC 记录
  • 原文地址:https://www.cnblogs.com/lianghong881018/p/12529735.html
Copyright © 2020-2023  润新知