• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/hid/

Lines Matching refs:msc

106 static int magicmouse_firm_touch(struct magicmouse_sc *msc)
114 for (ii = 0; ii < msc->ntouches; ii++) {
115 int idx = msc->tracking_ids[ii];
116 if (msc->touches[idx].size < 8) {
129 static void magicmouse_emit_buttons(struct magicmouse_sc *msc, int state)
131 int last_state = test_bit(BTN_LEFT, msc->input->key) << 0 |
132 test_bit(BTN_RIGHT, msc->input->key) << 1 |
133 test_bit(BTN_MIDDLE, msc->input->key) << 2;
146 } else if ((id = magicmouse_firm_touch(msc)) >= 0) {
147 int x = msc->touches[id].x;
156 input_report_key(msc->input, BTN_MIDDLE, state & 4);
159 input_report_key(msc->input, BTN_LEFT, state & 1);
160 input_report_key(msc->input, BTN_RIGHT, state & 2);
163 msc->scroll_accel = SCROLL_ACCEL_DEFAULT;
166 static void magicmouse_emit_touch(struct magicmouse_sc *msc, int raw_id, u8 *tdata)
168 struct input_dev *input = msc->input;
177 msc->tracking_ids[raw_id] = id;
178 msc->touches[id].x = x;
179 msc->touches[id].y = y;
180 msc->touches[id].size = misc & 63;
187 int step_x = msc->touches[id].scroll_x - x;
188 int step_y = msc->touches[id].scroll_y - y;
193 msc->touches[id].scroll_x = x;
194 msc->touches[id].scroll_y = y;
198 msc->scroll_jiffies + HZ / 2))
199 msc->scroll_accel = max_t(int,
200 msc->scroll_accel - 1, 1);
202 msc->scroll_accel = SCROLL_ACCEL_DEFAULT;
206 step_x /= (64 - (int)scroll_speed) * msc->scroll_accel;
208 msc->touches[id].scroll_x -= step_x *
209 (64 - scroll_speed) * msc->scroll_accel;
210 msc->scroll_jiffies = now;
214 step_y /= (64 - (int)scroll_speed) * msc->scroll_accel;
216 msc->touches[id].scroll_y -= step_y *
217 (64 - scroll_speed) * msc->scroll_accel;
218 msc->scroll_jiffies = now;
229 msc->touches[id].down = 1;
248 struct magicmouse_sc *msc = hid_get_drvdata(hdev);
249 struct input_dev *input = msc->input;
265 msc->delta_time = (ts - msc->last_timestamp) & 0x3ffff;
266 msc->last_timestamp = ts;
267 msc->ntouches = (size - 6) / 8;
268 for (ii = 0; ii < msc->ntouches; ii++)
269 magicmouse_emit_touch(msc, ii, data + ii * 8 + 6);
273 for (ii = 0; ii < ARRAY_SIZE(msc->touches); ii++) {
274 if (msc->touches[ii].down) {
276 msc->touches[ii].down = 0;
303 magicmouse_emit_buttons(msc, clicks & 3);
386 struct magicmouse_sc *msc;
390 msc = kzalloc(sizeof(*msc), GFP_KERNEL);
391 if (msc == NULL) {
396 msc->scroll_accel = SCROLL_ACCEL_DEFAULT;
398 msc->quirks = id->driver_data;
399 hid_set_drvdata(hdev, msc);
452 msc->input = input;
460 kfree(msc);
466 struct magicmouse_sc *msc = hid_get_drvdata(hdev);
469 input_unregister_device(msc->input);
470 kfree(msc);