[問題] struct file *filp, struct inode *inode
目前寫 touchscreen的driver, 除了標準的input interface外,
還要再新增一個更新fw的功能, 就是misc_register()
因此會要建立file_operation的pointer, 主要問題是在
open(struct inode *inode, struct file *filp)
上面那兩個struct內的值, 因為我的driver架構是上面有一個大的
struct xxx_ts *ts; 來管理我全部的變數, 之前在別的function呼叫時,
因為有先把他設入
i2c_set_clientdata(client, ts);
input_set_drvdata(ts->input, ts);
因此可以順利得到 ts 的結構, 順利操控ts內的值.
但是現在問題來了, 我無法在open()內不透過 Global variable方式
去得到 ts, 我有看過kernel內其他driver的作法, 但還是無法
配合到我的driver上, 因此想請教各位, 這種情況要取道ts,
都是怎樣取得的, 謝謝.
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 192.72.220.129
LinuxDev 近期熱門文章
PTT數位生活區 即時熱門文章