共 20 篇文章 |
|
#ifdef CONFIG_HAS_EARLYSUSPENDftk_ts->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 1;ftk_ts->early_suspend.suspend = stm_ts_early_suspend;ftk_ts->early_suspend.resume =stm_ts_late_resume;#ifdef CONFIG_HAS_EARLYSUSPENDstatic void stm_ts_early_suspend(struct early_suspend *h){struct ftk_ts *ts;#ifnd... 阅1035 转2 评0 公众公开 16-01-20 11:35 |
10: void devm_pwm_put(struct device *dev, struct pwm_device *pwm);npwm,该pwm chip可以支持的pwm channel(也可以称作pwm device由struct pwm_device表示)个数,kernel会根据该number,分配相应个数的struct pwm_device结构,保存在pwms指针中。struct pwm_device是pwm device的操作句柄,consumer的API调用,会中转到provider的pwm ops... 阅103 转1 评0 公众公开 16-01-20 11:02 |
它的原型是:struct i2c_client * i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info);这个函数将会使用info提供的信息建立一个i2c_client并与第一个参数指向的i2c_adapter绑定。获取i2c_adapter指针的函数是:struct i2c_adapter* i2c_get_adapter(int id);struct i2c_client * i2c_new_probed_device(struct i2c... 阅108 转2 评0 公众公开 16-01-12 10:58 |
--> 运行queue:queue_delayed_work(test_workqueue, test_delayed_work, delay_time); // 定义在:kernel/workqueue.c, 其中delay_time是延迟多少时间来运行queue。3) int schedule_delayed_work(struct work_struct *work, unsigned long delay) ---> queue_delayed_work --> queue_work.附:queue_work()和schedule_work(&vib... 阅62 转0 评0 公众公开 16-01-06 10:53 |
内核的 工作队列 使用方法,struct work_struct.工作队列的使用又分两种情况,一种是利用系统共享的工作队列来添加自己的工作,这种情况处理函数不能消耗太多时间,这样会影响共享队列中其他任务的处理;另外一种是创建自己的工作队列并添加工作。//创建一个名为my_queue的工作队列并把工作队列的入口地址赋给声明的指针。//作用与schedule_work(... 阅21 转自坚韧的石头 公众公开 16-01-06 10:39 |
/* Each adapter gets 2 lines from the table */ if (config_type) rc = msm_gpios_enable(&qup_i2c_gpios_hw[adap_id*2], 2);else rc = msm_gpios_enable(&qup_i2c_gpios_io[adap_id*2], 2);if (foo <0 || foo >1) { printk("input foo error. foo=%d.\n",foo);} sda = GPIO_PIN... 阅24 转0 评0 公众公开 15-07-31 10:33 |
设置GPIO的方向,如果是输出同时设置电平:/* set as input or output, returning 0 or negative errno */int gpio_direction_input(unsigned gpio);int gpio_direction_output(unsigned gpio, int value);/* GPIO OUTPUT, might sleep */void gpio_set_value_cansleep(unsigned gpio, int value);将GPIO映射为IRQ中断:/* map GPIO numbers to... 阅18 转0 评0 公众公开 15-07-03 16:29 |
320 480:意思是你开机动画在屏幕先以多少的解析度显示超过手机的分辨率,你的画面就显示不全了30:这个数字是代表每秒播放的帧数,假如part0文件夹里有30张图片,播放时间就是30/30=1秒播放完毕p 1 0 part0p 1(只播放一次) 0(空指令)part0 */代表part0文件夹內的图片只按名称顺序播放一次p 0 0 part1p 0(重复播放)0 (空指令)part1 */... 阅142 转0 评0 公众公开 15-06-24 09:28 |
static struct attribute *dev_attrs[] = { &dev_attr_polling.attr, NULL, };static struct device_attribute dev_attr_proximity_enable =__ATTR(enable, S_IRUGO | S_IWUGO, proximity_enable_show, proximity_enable_store);eg: static struct attribute *proximity_sysfs_attrs[] = {&dev_attr_proximity_enabl... 阅30 转0 评0 公众公开 15-06-18 15:38 |
struct i2c_driver { int (*probe)(struct i2c_client *, const struct i2c_device_id *);//动态获取总线号 adapter->nr = id; return i2c_register_adapter(adapter); //注册adapter}int i2c_add_numbered_adapter(struct i2c_adapter *adap){ int id; int status; if (adap->nr == -1) /* -1 means dynamically assign bus id */ retur... 阅177 转2 评0 公众公开 15-06-08 17:34 |