mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-12 16:40:42 +09:00
input: ts: ct36x: init use async and fix compile warning
This commit is contained in:
@@ -81,13 +81,13 @@ static int ct36x_chip_era_flash(struct ct36x_data *ts)
|
||||
static int ct36x_chip_set_code(unsigned short flash_addr, char *buf)
|
||||
{
|
||||
unsigned char cod_chksum;
|
||||
unsigned char *binary_data;
|
||||
|
||||
// Flash address
|
||||
// data length
|
||||
buf[2] = (char)(flash_addr >> 8);
|
||||
buf[3] = (char)(flash_addr & 0xFF);
|
||||
buf[4] = 0x08;
|
||||
unsigned char *binary_data;
|
||||
|
||||
if(flag_ct36x_model ==365)
|
||||
binary_data = ct365_binary_data;
|
||||
|
||||
@@ -24,8 +24,8 @@ struct ct363_priv{
|
||||
|
||||
static int ct363_init_hw(struct ct36x_data *ts)
|
||||
{
|
||||
int ret = 0;
|
||||
/*
|
||||
int ret = 0;
|
||||
ret = gpio_request(ts->rst_io.gpio, "ct363_rst");
|
||||
if(ret < 0){
|
||||
dev_err(ts->dev, "Failed to request rst gpio\n");
|
||||
@@ -163,6 +163,7 @@ static int ct363_resume(struct ct36x_data *ts)
|
||||
|
||||
static void ct363_report(struct ct36x_data *ts)
|
||||
{
|
||||
int t ,m;
|
||||
int i, ret = 0;
|
||||
int sync = 0, x, y;
|
||||
int len = sizeof(struct ct363_finger_data) * ts->point_num;
|
||||
@@ -174,7 +175,6 @@ static void ct363_report(struct ct36x_data *ts)
|
||||
return;
|
||||
}
|
||||
|
||||
int t ,m;
|
||||
if(ct36x_dbg_level==2)
|
||||
for(t=0;t< ts->point_num;t++){
|
||||
ct36x_dbg(ts, "CT363buf[%d]: ", t);
|
||||
|
||||
@@ -20,14 +20,6 @@
|
||||
|
||||
#include <linux/ct36x.h>
|
||||
|
||||
//#include <mach/board.h>
|
||||
//#include <mach/gpio.h>
|
||||
//#if 1
|
||||
//#define ct36x_dbg(ts, format, arg...) \
|
||||
// dev_printk(KERN_INFO , ts->dev , format , ## arg)
|
||||
//#else
|
||||
//#define ct36x_dbg(ts, format, arg...)
|
||||
//#endif
|
||||
int flag_ct36x_model;
|
||||
|
||||
int ct36x_dbg_level = 0;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "ct36x_priv.h"
|
||||
#include <linux/of_gpio.h>
|
||||
#include <linux/async.h>
|
||||
|
||||
#include "core.c"
|
||||
#include "ct360.c"
|
||||
@@ -141,6 +142,7 @@ static void ct36x_ts_late_resume(struct early_suspend *h)
|
||||
|
||||
static int ct36x_ts_probe(struct i2c_client *client, const struct i2c_device_id *id)
|
||||
{
|
||||
int orientation[4];
|
||||
int ret = 0, i;
|
||||
struct ct36x_data *ts = NULL;
|
||||
/*struct ct36x_platform_data *pdata = client->dev.platform_data;
|
||||
@@ -191,11 +193,10 @@ static int ct36x_ts_probe(struct i2c_client *client, const struct i2c_device_id
|
||||
//ts->y_max = pdata->y_max;
|
||||
//ts->rst_io = pdata->rst_io;
|
||||
//ts->irq_io = pdata->irq_io;
|
||||
ts->irq_io.gpio = of_get_named_gpio_flags(np, "touch-gpio", 0, &irq_flags);
|
||||
ts->irq_io.gpio = of_get_named_gpio_flags(np, "touch-gpio", 0, (enum of_gpio_flags *)&irq_flags);
|
||||
ts->rst_io.gpio = of_get_named_gpio_flags(np, "reset-gpio", 0, &rst_flags);
|
||||
|
||||
printk("the irq_flags is %d,rst_flags is %d\n",irq_flags,rst_flags);
|
||||
int orientation[4];
|
||||
printk("the irq_flags is %ld,rst_flags is %d\n",irq_flags,rst_flags);
|
||||
|
||||
ret = of_property_read_u32_array(np, "orientation",orientation,4);
|
||||
if (ret < 0)
|
||||
@@ -337,7 +338,7 @@ static struct i2c_driver ct36x_ts_driver = {
|
||||
},
|
||||
};
|
||||
|
||||
static int __init ct36x_ts_init(void)
|
||||
static void __init ct36x_ts_init_async(void *unused, async_cookie_t cookie)
|
||||
{
|
||||
#ifndef CONFIG_CT36X_TS //make modules
|
||||
int ret = 0;
|
||||
@@ -355,7 +356,13 @@ static int __init ct36x_ts_init(void)
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
return i2c_add_driver(&ct36x_ts_driver);
|
||||
i2c_add_driver(&ct36x_ts_driver);
|
||||
}
|
||||
|
||||
static int __init ct36x_ts_init(void)
|
||||
{
|
||||
async_schedule(ct36x_ts_init_async, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit ct36x_ts_exit(void)
|
||||
|
||||
Reference in New Issue
Block a user