void lock_entry_by_ruri(str* ruri) { unsigned int sl; sl = core_hash(ruri, 0, 0) & (t_table->size-1); ts_lock(t_table, &t_table->entries[sl]); }
static void hisik3_ts_main(void) { struct input_dev *input = ts_input_dev; int x_coord, y_coord; static int bts_is_down = 0; static int x_coord_tmp, y_coord_tmp; int ret; hisik3_ts_info st_ts_info = {0}; //msleep(10); ts_lock(); //printk("[%s]: Get intr lock OK.\r\n", __func__); /* touch panel is power off */ if(0 == g_touch_is_poweron){ if(bts_is_down && g_touch_is_resume){ bts_is_down = 0; //printk("intr touch release.\n"); input_report_key(input, BTN_TOUCH, 0); input_report_abs(input, ABS_PRESSURE, 0); input_sync(input); } ts_release(); return; } /* effective irq conver coordinate */ ret = hisik3_ts_hkadc_get_sample_value(&st_ts_info); //printk("k3 touch intr report is x %d, y %d, num %d\n", st_ts_info.x, st_ts_info.y, st_ts_info.num); /* clear intr */ hisik3_gpio_IntrClr(TOUCH_PANEL_GPIO); /* enable intr */ hisik3_gpio_IntrEnable(TOUCH_PANEL_GPIO); if(0 != ret){ ts_release(); return; } #if 0 hisik3_set_target(0, MAX_CPU_FREQ, 0); #endif //printk("x_coord_raw %u y_coord_raw %u\n", x_coord_raw,y_coord_raw); if(st_ts_info.num > 0){ if((st_ts_info.x>0) && (st_ts_info.x<TOUCH_IC_X) && (st_ts_info.y<TOUCH_IC_Y) && (st_ts_info.y>0)){ x_coord = st_ts_info.x * TOUCH_PANEL_X / TOUCH_IC_X; y_coord = (TOUCH_IC_Y -st_ts_info.y)*TOUCH_PANEL_Y/TOUCH_IC_Y; if(0 == bts_is_down){ bts_is_down = 1; x_coord_tmp = x_coord; y_coord_tmp = y_coord; } else{ #define COEFFPARAMETERA 6 #define COEFFPARAMETERB 10 x_coord_tmp = (COEFFPARAMETERA * x_coord + COEFFPARAMETERB * x_coord_tmp) >> 4; y_coord_tmp = (COEFFPARAMETERA * y_coord + COEFFPARAMETERB * y_coord_tmp) >> 4; } //printk("intr touch press\n"); input_report_abs(input, ABS_X, x_coord); input_report_abs(input, ABS_Y, y_coord); input_report_abs(input, ABS_PRESSURE, 1); input_report_key(input, BTN_TOUCH, 1); input_sync(input); //printk("intr touch press: %d, %d\n",x_coord, y_coord); } //printk("time start OK\n"); }
int bs_tune(void __iomem *regs, struct mutex *lock, int addr, int channel, ISDB_S_TMCC *tmcc) { int lp ; int lp2; WBLOCK wk; __u32 val ; ISDB_S_TS_ID *tsid ; union{ __u8 slot[4]; __u32 u32slot; }ts_slot ; union{ __u16 ts[2]; __u32 tsid; }ts_id ; if(channel >= MAX_BS_CHANNEL){ PT1_PRINTK(0, KERN_ERR, "Invalid Channel(%d)\n", channel); return -EIO ; } val = bs_frequency(regs, lock, addr, channel); if(val == -EIO){ return val ; } tsid = &tmcc->ts_id[0] ; // 該当周波数のTS-IDを取得 for(lp = 0 ; lp < (MAX_BS_TS_ID / 2) ; lp++){ for(lp2 = 0 ; lp2 < 100 ; lp2++){ memcpy(&wk, bs_get_ts_id[lp], sizeof(WBLOCK)); wk.addr = addr; ts_id.tsid = i2c_read(regs, lock, &wk, 4); // TS-IDが0の場合は再取得する if((ts_id.ts[0] != 0) && (ts_id.ts[1] != 0)){ break ; } } tsid->ts_id = ts_id.ts[1] ; tsid += 1; tsid->ts_id = ts_id.ts[0] ; tsid += 1; } memcpy(&wk, &bs_get_agc, sizeof(WBLOCK)); wk.addr = addr; tmcc->agc = i2c_read(regs, lock, &wk, 1); // TS-ID別の情報を取得 tsid = &tmcc->ts_id[0] ; for(lp = 0 ; lp < MAX_BS_TS_ID ; lp++, tsid += 1){ // TS-IDなし=0XFFFF if(tsid->ts_id == 0xFFFF){ continue ; } ts_lock(regs, lock, addr, tsid->ts_id); //スロット取得 memcpy(&wk, &bs_get_slot, sizeof(WBLOCK)); wk.addr = addr; ts_slot.u32slot = i2c_read(regs, lock, &wk, 3); tsid->high_mode = 0; tsid->low_slot = ts_slot.slot[0] ; tsid->high_slot = ts_slot.slot[1] ; tsid->low_mode = ts_slot.slot[2] ; } memcpy(&wk, &bs_get_clock, sizeof(WBLOCK)); wk.addr = addr; tmcc->clockmargin = i2c_read(regs, lock, &wk, 1); memcpy(&wk, &bs_get_carrir, sizeof(WBLOCK)); wk.addr = addr; tmcc->carriermargin = i2c_read(regs, lock, &wk, 1); return 0 ; }
void lock_entry(ts_entry_t *entry) { ts_lock(t_table, entry); }