Welcome 微信登录
编程资源 图片资源库 蚂蚁家优选 PDF转换器

首页 / 操作系统 / Linux / Linux 修改代码以支持LED 控制(board-am335xevm)

Linux 修改代码以支持LED 控制(board-am335xevm)Note:All the codes are changed at the file board-am335xevm.cdefine led informationsstatic struct gpio_led am335x_evm_gpio_leds[] = { 
    { 
        .name         = "omap3evm::leda", 
        /* normally not visible (board underside) */ 
        .default_trigger    = "default-on", 
        .gpio         = GPIO_TO_PIN(1,23),    /* gets replaced */ 
        .active_low   = true, 
    }, 
    { 
        .name         = "omap3evm::ledb", 
        /* normally not visible (board underside) */ 
        .default_trigger    = "default-on", 
        .gpio         =  GPIO_TO_PIN(1,24), /* gets replaced */ 
        .active_low   = true, 
    }, 
}; 
 
static struct gpio_led_platform_data am335x_evm_gpio_led_info = { 
    .leds     = am335x_evm_gpio_leds, 
    .num_leds = ARRAY_SIZE(am335x_evm_gpio_leds), 
}; 
 
static struct platform_device am335x_evm_leds_gpio = { 
    .name    = "leds-gpio", 
    .id    = -1, 
    .dev    = { 
        .platform_data    = &am335x_evm_gpio_led_info, 
    }, 
}; define init functionstatic void leds_init(int evm_id, int profile) 

    int err; 
 
    setup_pin_mux(leds_pin_mux); 
    err = platform_device_register(&am335x_evm_leds_gpio); 
    if (err) { 
        pr_err("failed to register matrix keypad (2x3) device "); 
    } 
add init functionstatic struct evm_dev_cfg gen_purp_evm_dev_cfg[] = { 
 
... 
 
{leds_init, DEV_ON_BASEBOARD, PROFILE_0},// added by driver monkey 
 
... 
 
 }