Lines Matching defs:settings

97 static void kone_set_settings_checksum(struct kone_settings *settings)
100 unsigned char *address = (unsigned char *)settings;
105 settings->checksum = cpu_to_le16(checksum);
146 * Reads settings from mouse and stores it in @buf
158 * Writes settings from @buf to mouse
163 struct kone_settings const *settings)
167 settings, sizeof(struct kone_settings));
281 memcpy(buf, ((char const *)&kone->settings) + off, count);
288 * Writing settings automatically activates startup_profile.
306 difference = memcmp(buf, &kone->settings, sizeof(struct kone_settings));
315 old_profile = kone->settings.startup_profile;
316 memcpy(&kone->settings, buf, sizeof(struct kone_settings));
318 kone_profile_activated(kone, kone->settings.startup_profile);
320 if (kone->settings.startup_profile != old_profile)
321 kone_profile_report(kone, kone->settings.startup_profile);
433 return snprintf(buf, PAGE_SIZE, "%d\n", kone->settings.tcu);
444 * Calibrating the tcu is the only action that changes settings data inside the
487 * Reading settings too early will result in invalid data.
494 /* calibration changes values in settings, so reread */
495 retval = kone_get_settings(usb_dev, &kone->settings);
499 /* only write settings back if activation state is different */
500 if (kone->settings.tcu != state) {
501 kone->settings.tcu = state;
502 kone_set_settings_checksum(&kone->settings);
504 retval = kone_set_settings(usb_dev, &kone->settings);
508 * try to reread valid settings into buffer overwriting
511 retval = kone_get_settings(usb_dev, &kone->settings);
517 kone_profile_activated(kone, kone->settings.startup_profile);
522 hid_err(usb_dev, "couldn't read settings\n");
533 return snprintf(buf, PAGE_SIZE, "%d\n", kone->settings.startup_profile);
557 kone->settings.startup_profile = new_startup_profile;
558 kone_set_settings_checksum(&kone->settings);
560 retval = kone_set_settings(usb_dev, &kone->settings);
576 * Read actual dpi settings.
617 .attr = { .name = "settings", .mode = 0660 },
674 retval = kone_get_settings(usb_dev, &kone->settings);
682 kone_profile_activated(kone, kone->settings.startup_profile);