Lines Matching defs:range

61 static void lg4ff_set_range_dfp(struct hid_device *hid, u16 range);
62 static void lg4ff_set_range_g25(struct hid_device *hid, u16 range);
67 u16 range;
79 void (*set_range)(struct hid_device *hid, u16 range);
103 void (*set_range)(struct hid_device *hid, u16 range);
276 /* Recalculates X axis value accordingly to currently selected range */
277 static s32 lg4ff_adjust_dfp_x_axis(s32 value, u16 range)
282 if (range == 900)
284 else if (range == 200)
286 else if (range < 200)
291 new_value = 8192 + mult_frac(value - 8192, max_range, range);
315 new_value = lg4ff_adjust_dfp_x_axis(value, entry->wdata.range);
583 /* Sends command to set range compatible with G25/G27/Driving Force GT */
584 static void lg4ff_set_range_g25(struct hid_device *hid, u16 range)
603 dbg_hid("G25/G27/DFGT: setting range to %u\n", range);
608 value[2] = range & 0x00ff;
609 value[3] = (range & 0xff00) >> 8;
618 /* Sends commands to set range compatible with Driving Force Pro wheel */
619 static void lg4ff_set_range_dfp(struct hid_device *hid, u16 range)
639 dbg_hid("Driving Force Pro: setting range to %u\n", range);
651 if (range > 200) {
669 if (range == 200 || range == 900) { /* Do not apply any fine limit */
676 start_left = (((full_range - range + 1) * 2047) / full_range);
991 /* Export the currently set range of the wheel */
1012 count = scnprintf(buf, PAGE_SIZE, "%u\n", entry->wdata.range);
1016 /* Set range to user specified value, call appropriate function
1024 u16 range = simple_strtoul(buf, NULL, 10);
1038 if (range == 0)
1039 range = entry->wdata.max_range;
1041 /* Check if the wheel supports range setting
1042 * and that the range is within limits for the wheel */
1043 if (entry->wdata.set_range && range >= entry->wdata.min_range && range <= entry->wdata.max_range) {
1044 entry->wdata.set_range(hid, range);
1045 entry->wdata.range = range;
1050 static DEVICE_ATTR(range, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH, lg4ff_range_show, lg4ff_range_store);
1377 hid_warn(hid, "Unable to create sysfs interface for \"range\", errno %d\n", error);
1388 /* Set the maximum range to start with */
1389 entry->wdata.range = entry->wdata.max_range;
1391 entry->wdata.set_range(hid, entry->wdata.range);