switch
文章平均质量分 78
lamdoc
这个作者很懒,什么都没留下…
展开
-
switch_gpio
创建玩一个switch类之后,最普通的用法就是把一个GPIO端口,用作一个switch信号,所以switch_gpio.c就这么诞生了,这是我的理解,不一定正确。 1.两个相关的数据结构: struct gpio_switch_platform_data { const char *name; unsigned gpio; /* if N原创 2012-06-28 11:13:41 · 867 阅读 · 0 评论 -
lc1120 jack detect switch
/* switch data register*/ struct lc1120_priv *data = container_of(codec, struct lc1120_priv, codec); //从元素codec,得到lc1120_priv地址 data->sdev.name = "h2w"; //switch设备只需要给个名字就能注册了。原创 2012-06-28 11:11:55 · 718 阅读 · 0 评论 -
switch_class
switch 类 1. init/exit: static int __init switch_class_init(void) { return create_switch_class(); //新建一个switch类 } static void __exit switch_class_exit(void) { class_原创 2012-06-28 11:15:36 · 831 阅读 · 0 评论