linux 修改代碼以支援LED 控制(board-am335xevm)

來源:互聯網
上載者:User

QQ:196568501

Mail:bookworepeng@hotmail.com

Welcome to exchange!

Note:

All the codes are changed at the file board-am335xevm.c

define led informations

static 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 function

static 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\n");}}

add init function

static struct evm_dev_cfg gen_purp_evm_dev_cfg[] = {...{leds_init, DEV_ON_BASEBOARD, PROFILE_0},// added by driver monkey... }

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.