i2c_get_clientdata和to_i2c_client 的使用擷取平台裝置

來源:互聯網
上載者:User

struct mxt224_data {
struct i2c_client *client;
struct input_dev *input_dev;
struct early_suspend early_suspend;
u8 family_id;
u32 finger_mask;
int gpio_read_done;
struct object_t *objects;
u8 objects_len;
u8 tsp_version;
const u8 *power_cfg;
const u8 *noise_suppression_cfg_ta;
const u8 *noise_suppression_cfg;
const u8 *noise_suppression_cfg_t46_ta;
const u8 *noise_suppression_cfg_t46;

u8 finger_type;
u16 msg_proc;
u16 cmd_proc;
u16 msg_object_size;
u32 x_dropbits:2;
u32 y_dropbits:2;
void (*power_on)(void);
void (*power_off)(void);
//void (*register_cb)(void*);
void (*read_ta_status)(void*);
int num_fingers;
struct finger_info fingers[MXT224_MAX_MT_FINGERS];
struct timer_list autocal_timer;
};

static struct workqueue_struct *cal_check_wq;
static struct work_struct cal_check_work;

#define CLEAR_MEDIAN_FILTER_ERROR

#ifdef CLEAR_MEDIAN_FILTER_ERROR
typedef enum
{
ERR_RTN_CONDITION_T9,
ERR_RTN_CONDITION_T48,
ERR_RTN_CONDITION_IDLE,
ERR_RTN_CONDITION_MAX
}ERR_RTN_CONTIOIN;

ERR_RTN_CONTIOIN gErrCondition = ERR_RTN_CONDITION_IDLE;

static t48_median_config_t noise_median = {0}; //110927 gumi noise

#endif

struct mxt224_data *copy_data;
extern struct class *sec_class;

static int mxt224_suspend(struct device *dev)

{
struct i2c_client *client = to_i2c_client(dev);    從dev 擷取 i2c client .  
struct mxt224_data *data = i2c_get_clientdata(client);   從i2c client 擷取平台裝置 data

    //cal_check_work_queue
    int ret;
    ret = cancel_work_sync(&cal_check_work);

mxt224_enabled = 0;
touch_is_pressed = 0;
Doing_calibration_falg = 0;
return mxt224_internal_suspend(data);
}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.