Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: tsc2007 - Convert msecs to jiffies only once

Eliminate redundant calculations by performing millisecond to jiffy
calculations once during driver initialization.

Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Aaron Sierra and committed by
Dmitry Torokhov
bbdb38a2 709583e8

+5 -6
+5 -6
drivers/input/touchscreen/tsc2007.c
··· 75 75 u16 model; 76 76 u16 x_plate_ohms; 77 77 u16 max_rt; 78 - unsigned long poll_period; 78 + unsigned long poll_period; /* in jiffies */ 79 79 int fuzzx; 80 80 int fuzzy; 81 81 int fuzzz; ··· 214 214 dev_dbg(&ts->client->dev, "ignored pressure %d\n", rt); 215 215 } 216 216 217 - wait_event_timeout(ts->wait, ts->stopped, 218 - msecs_to_jiffies(ts->poll_period)); 217 + wait_event_timeout(ts->wait, ts->stopped, ts->poll_period); 219 218 } 220 219 221 220 dev_dbg(&ts->client->dev, "UP\n"); ··· 313 314 ts->fuzzz = val32; 314 315 315 316 if (!of_property_read_u64(np, "ti,poll-period", &val64)) 316 - ts->poll_period = val64; 317 + ts->poll_period = msecs_to_jiffies(val64); 317 318 else 318 - ts->poll_period = 1; 319 + ts->poll_period = msecs_to_jiffies(1); 319 320 320 321 if (!of_property_read_u32(np, "ti,x-plate-ohms", &val32)) { 321 322 ts->x_plate_ohms = val32; ··· 349 350 ts->model = pdata->model; 350 351 ts->x_plate_ohms = pdata->x_plate_ohms; 351 352 ts->max_rt = pdata->max_rt ? : MAX_12BIT; 352 - ts->poll_period = pdata->poll_period ? : 1; 353 + ts->poll_period = msecs_to_jiffies(pdata->poll_period ? : 1); 353 354 ts->get_pendown_state = pdata->get_pendown_state; 354 355 ts->clear_penirq = pdata->clear_penirq; 355 356 ts->fuzzx = pdata->fuzzx;