am335x linux修改ip,Linux 修改代码以支持LED 控制(board-am335xevm)

Linux 修改代码以支持LED 控制(board-am335xevm)

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

...

}

0b1331709591d260c1c78e86d0c51c18.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值