zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    Tomcat生命周期管理与观察者模式
    利于ThreadLocal管理Hibernate Session
    Spring多数据源配置
    MySQL数据库性能优化之硬件瓶颈分析
    浅谈监听器与过滤器
    StringManager与单例模式
    ThreadLocal在spring框架中的作用
    spring中事件机制
    MySQL数据库性能优化之存储引擎选择
    Spring常用的Listener
  • 原文地址:https://www.cnblogs.com/lianghong881018/p/12529735.html
Copyright © 2011-2022 走看看