type stringclasses 5
values | content stringlengths 9 163k |
|---|---|
includes | #include <linux/gpio.h> |
includes | #include <mach/gpio.h> |
includes | #include <linux/irq.h> |
includes | #include <linux/interrupt.h> |
includes | #include <linux/timer.h> |
includes | #include <linux/workqueue.h> |
includes | #include <linux/byteorder/generic.h> |
includes | #include <linux/bitops.h> |
includes | #include <linux/earlysuspend.h> |
includes | #include <linux/regulator/consumer.h> |
includes | #include <mach/vreg.h> |
includes | #include <linux/wakelock.h> |
includes | #include <linux/input/mt.h> |
includes | #include <linux/miscdevice.h> |
includes | #include <linux/cyttsp.h> |
includes | #include <linux/issp_defs.h> |
includes | #include <linux/issp_extern.h> |
includes |
#include <linux/uaccess.h> |
defines |
#define CYTTSP_DECLARE_GLOBALS |
defines | #define FEATURE_TOUCH_KEY |
defines | #define GPIO_TOUCH_RST 95 |
defines | #define GPIO_TOUCH_CHG 61 |
defines | #define GPIO_TOUCH_SDA 64 |
defines | #define GPIO_TOUCH_SCL 65 |
defines | #define GPIO_TOUCH_ID 93 |
defines | #define IRQ_TOUCH_INT gpio_to_irq(GPIO_TOUCH_CHG) |
defines | #define dbg(fmt, args...) printk("[TOUCH]" fmt, ##args) |
defines | #define dbg(fmt, args...) |
defines | #define dbg_func_in() dbg("[FUNC_IN] %s\n", __func__) |
defines | #define dbg_func_out() dbg("[FUNC_OUT] %s\n", __func__) |
defines | #define dbg_line() dbg("[LINE] %d(%s)\n", __LINE__, __func__) |
defines |
#define FEATURE_SKY_PROCESS_CMD_KEY |
defines | #define X_MAX 480 |
defines | #define Y_MAX 800 |
defines |
#define NULL_KEY_AREA 840 |
defines |
#define MENU_KEY_MIN 40 |
defines | #define MENU_KEY_MAX 140 |
defines |
#define HOME_KEY_MIN 210 |
defines | #define HOME_KEY_MAX 280 |
defines |
#define BACK_KEY_MIN 360 |
defines | #define BACK_KEY_MAX 460 |
defines | #define CYTTSP_HEARTBEAT_TIME 3 |
defines |
#define TOUCH_MAX_NUM 4 // 2 |
defines |
#define SENSOR_X 12 |
defines | #define SENSOR_Y 20 |
defines | #define MAX_NODE SENSOR_X*SENSOR_Y |
defines |
#define CYTTSP_BASE_MIN 65 |
defines | #define CYTTSP_BASE_MAX 135 |
defines |
#define CYTTSP_MUTEX_LOCK //ST_LIM |
defines | #define CY_NUM_ABS_VAL 5 /* number of abs values per setting */ |
defines | #define CY_SIGNAL_OST 0 |
defines | #define CY_MIN_OST 1 |
defines | #define CY_MAX_OST 2 |
defines | #define CY_FUZZ_OST 3 |
defines | #define CY_FLAT_OST 4 |
defines | #define CY_NUM_ABS_SET 5 /* number of abs signal sets */ |
defines | #define CY_ABS_X_OST 0 |
defines | #define CY_ABS_Y_OST 1 |
defines | #define CY_ABS_P_OST 2 |
defines | #define CY_ABS_W_OST 3 |
defines | #define CY_ABS_ID_OST 4 |
defines | #define CY_IGNORE_VALUE 0xFFFF /* mark unused signals as ignore */ |
defines |
#define HI_TRACKID(reg) ((reg & 0xF0) >> 4) |
defines | #define LO_TRACKID(reg) ((reg & 0x0F) >> 0) |
defines | #define CYTTSP_MENU_KEY 0x01 |
defines | #define CYTTSP_BACK_KEY 0x02 |
defines | #define CYTTSP_HOME_KEY 0x04 |
defines | #define CYTTSP_NULL_KEY 0x08 |
defines | #define CYTTSP_MAX_I2C_LEN 256 |
defines | #define CYTTSP_MAX_TRY 10 |
defines | #define CYTTSP_BL_PAGE_SIZE 16 |
defines | #define CYTTSP_BL_NUM_PAGES 5 |
structs | struct cyttsp {
struct i2c_client *client;
struct input_dev *input;
struct work_struct work;
#ifdef FEATURE_CYTTSP_HEARTBEAT
struct work_struct work2;
#endif
#ifdef FEATURE_CYTTSP_FIRMWAREUPGRADE
//struct work_struct work3; // N1037 20120312 for ICS
struct delayed_work work3;
#endif
struct timer_list timer;
st... |
functions | int ts_fops_open(struct inode *inode, struct file *filp)
{
//filp->private_data = cyttsp_data;
return 0;
} |
functions | void Change_Active_Distance(u8 value)
{
int rc = -1;
u8 byte_data;
struct cyttsp *ts = ts_temp;
#ifdef CYTTSP_MUTEX_LOCK
mutex_lock(&ts->lock_mutex);
#endif
rc = i2c_smbus_read_i2c_block_data(ts->client, CYTTSP_REG_GEST_SET,sizeof(byte_data), &byte_data);
//printk("Chage_Active_Distance : %02x\n", byte_data);
... |
functions | ssize_t cyttsp_irq_status(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct i2c_client *client = container_of(dev,
struct i2c_client, dev);
struct cyttsp *ts = i2c_get_clientdata(client);
return sprintf(buf, "%u\n", atomi... |
functions | ssize_t cyttsp_irq_enable(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
struct i2c_client *client = container_of(dev,
struct i2c_client, dev);
struct cyttsp *ts = i2c_get_cl... |
functions | int pantech_ctl_update(int cmd, int value)
{
int rt = -1;
struct regulator *vreg_touch, *vreg_touch_temp;
switch(cmd)
{
case ISSP_IOCTL_SCLK_TO_GPIO:
if(value){
gpio_tlmm_config(GPIO_CFG(GPIO_TOUCH_SCL, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),GPIO_CFG_ENABLE);
} |
functions | void check_firmware_update(struct work_struct *work3)
{
int retry_cnt = 3;
u8 byte_data[4];
int rc = -1, check_update_pass = 0, curr_version =0;
struct cyttsp *ts = ts_temp;
// If phone enter a poweroff, Stop firmware update
if(Touch_Status >= TOUCH_POWEROFF)
return;
#ifdef FEATURE_CYTTSP_HEARTBEAT
start_h... |
functions | int firmware_version_check(void)
{
int rc = -1, retry_cnt = 3;
u8 byte_data[4];
struct cyttsp *ts = ts_temp;
if(Touch_Status >= TOUCH_POWEROFF)
{
pantech_ctl_update(ISSP_IOCTL_POWER_ALL , 1);
pantech_ctl_update(ISSP_IOCTL_INTR, 1);
pantech_ctl_update(ISSP_COMPLITED_UPDATA, 0);
msleep(300);
// return fals... |
functions | endif
if(rc < CYTTSP_OPERATIONAL)
{
printk("Can't read Touch Firmware Version\n");
return 1;
} |
functions | int firmware_set_charger_mode(int mode)
{
int rc = -1, retry_cnt = 3;
u8 byte_data[4], send_byte = 0x00;
struct cyttsp *ts = ts_temp;
#ifdef CYTTSP_MUTEX_LOCK
mutex_lock(&ts->lock_mutex);
#endif
do {
rc = i2c_smbus_read_i2c_block_data(ts->client, CYTTSP_REG_CHARGER_MODE,sizeof(byte_data), (u8 *)&byte_data);
... |
functions | endif
if(rc < CYTTSP_OPERATIONAL)
{
printk("Can't read Touch Charger Mode\n");
return 1;
} |
functions | int firmware_update_by_user(void)
{
struct cyttsp *ts = ts_temp;
int check_update_pass = -1;
// If phone enter a poweroff, Stop firmware update
if(Touch_Status >= TOUCH_POWEROFF)
{
pantech_ctl_update(ISSP_IOCTL_POWER_ALL , 1);
msleep(300);
// return false;
} |
functions | void cyttsp_check_heartbeat(struct work_struct *work2)
{
struct cyttsp *ts = container_of(work2,struct cyttsp,work2);
int retry_cnt = 3;
u8 new_heartbeart_data[4];
int rc = -1;
static u8 old_heartbeat_data = 0xFF;
memset((void*)new_heartbeart_data,0x00,sizeof(new_heartbeart_data));
if(start_heartbeat_timer ... |
functions | void cyttsp_xy_worker(struct work_struct *work)
{
struct cyttsp *ts = container_of(work,struct cyttsp,work);
int i;
int retval = 0;
u8 curr_touches = 0;
u8 id = 0;
// int t = 0;
// int num_sent = 0;
// int signal = 0;
int tch = 0;
#ifdef FEATURE_TOUCH_KEY
int key_relese = true;
#endif
for... |
functions | FEATURE_TOUCH_KEY
for(i=0; i<curr_touches; i++)
{
int x =0, y=0;
switch(i)
{
case 0:
x = be16_to_cpu(g_xy_data.x1);
y = be16_to_cpu(g_xy_data.y1);
break;
case 1:
x = be16_to_cpu(g_xy_data.x2);
y = be16_to_cpu(g_xy_data.y2);
break;
case 2:
x = be16_to_cpu(g_xy_data.x3);
... |
functions | Event
if ( curr_touches == 0 )
{
dbg("Touch Released\n");
for (i=0; i < TOUCH_MAX_NUM; i++)
{
if (cur_touchflag[i] /*cur_trk[i].abs[CY_ABS_ID_OST] >= 0*/)
{
cur_trk[i].abs[CY_ABS_ID_OST] = -1;
cur_touchflag[i] = 0;
input_mt_slot(ts->input, i);
input_report_abs(ts->inp... |
functions | 1
if ( cur_trk[i].abs[CY_ABS_ID_OST] >= 0 )
{
cur_touchflag[cur_trk[i].abs[CY_ABS_ID_OST]] = 0;
cur_trk[i].abs[CY_ABS_ID_OST] = -1;
input_mt_slot(ts->input, i);
input_report_abs(ts->input, ABS_MT_TRACKING_ID... |
functions | ÀÓ
if(ts->client->irq == 0) {
/* restart event timer */
mod_timer(&ts->timer, jiffies + TOUCHSCREEN_TIMEOUT);
} |
functions | int cyttsp_inlist(u16 prev_track[], u8 curr_track_id, u8 *prev_loc, u8 num_touches)
{
u8 id =0;
*prev_loc = CYTTSP_IGNORE_TOUCH;
cyttsp_xdebug("IN p[%d]=%d c=%d n=%d loc=%d\n", \
id, prev_track[id], curr_track_id, num_touches, *prev_loc);
for (id = 0, *prev_loc = CYTTSP_IGNORE_TOUCH;
(id < num_touches); id+... |
functions | int cyttsp_next_avail_inlist(u16 curr_track[], u8 *new_loc, u8 num_touches)
{
u8 id;
for (id = 0, *new_loc = CYTTSP_IGNORE_TOUCH;
(id < num_touches); id++) {
if (curr_track[id] > CYTTSP_NUM_TRACK_ID) {
*new_loc = id;
break;
} |
functions | void cyttsp_timer(unsigned long handle)
{
struct cyttsp *ts = (struct cyttsp *) handle;
cyttsp_xdebug("TTSP Device timer event\n");
#ifdef FEATURE_CYTTSP_HEARTBEAT
/* schedule motion signal handling */
if(start_heartbeat_timer)
{
schedule_work(&ts->work2);
mod_timer(&ts->timer, jiffies + CYTTSP_HEARTBEAT_TIM... |
functions | irqreturn_t cyttsp_irq(int irq, void *handle)
{
struct cyttsp *ts = (struct cyttsp *) handle;
cyttsp_xdebug("%s: Got IRQ\n", CYTTSP_I2C_NAME);
if(Touch_Status >= TOUCH_POWEROFF)
return IRQ_HANDLED;
/* disable further interrupts until this interrupt is processed */
disable_irq_nosync(ts->client->irq);
/* sc... |
functions | int cyttsp_putbl(struct cyttsp *ts, int show, int show_status, int show_version, int show_cid)
{
int retval = CYTTSP_OPERATIONAL;
int num_bytes = (show_status * 3) + (show_version * 6) + (show_cid * 3);
if (show_cid) {
num_bytes = sizeof(struct cyttsp_bootloader_data_t);
} |
functions | else if (show_version) {
num_bytes = sizeof(struct cyttsp_bootloader_data_t) - 3;
} |
functions | endif
if (show_status) {
cyttsp_debug("BL%d: f=%02X s=%02X err=%02X bl=%02X%02X bld=%02X%02X\n", \
show, \
g_bl_data.bl_file, g_bl_data.bl_status, g_bl_data.bl_error, \
g_bl_data.blver_hi, g_bl_data.blver_lo, \
g_bl_data.bld_blver_hi, g_bl_data.bld_blver_lo);
} |
functions | int cyttsp_i2c_write_block_data(struct i2c_client *client, u8 command,
u8 length, const u8 *values)
{
int retval = CYTTSP_OPERATIONAL;
u8 dataray[CYTTSP_MAX_I2C_LEN];
u8 try;
dataray[0] = command;
if (length) {
memcpy(&dataray[1], values, length);
} |
functions | int cyttsp_i2c_write_block_data_chunks(struct cyttsp *ts, u8 command,
u8 length, const u8 *values)
{
int retval = CYTTSP_OPERATIONAL;
int block = 1;
u8 dataray[CYTTSP_MAX_I2C_LEN];
/* first page already includes the bl page offset */
#ifdef CYTTSP_MUTEX_LOCK
mutex_lock(&ts->lock_mutex);
#endif
retval ... |
functions | int cyttsp_bootload_app(struct cyttsp *ts)
{
int retval = CYTTSP_OPERATIONAL;
int i, tries;
u8 host_reg;
cyttsp_debug("load new firmware \n");
#ifdef CYTTSP_MUTEX_LOCK
mutex_lock(&ts->lock_mutex);
#endif
/* reset TTSP Device back to bootloader mode */
host_reg = CYTTSP_SOFT_RESET_MODE;
retval = i2c_smbus_wr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.