Lines Matching full:settings
95 static void kone_set_settings_checksum(struct kone_settings *settings) in kone_set_settings_checksum() argument
98 unsigned char *address = (unsigned char *)settings; in kone_set_settings_checksum()
103 settings->checksum = cpu_to_le16(checksum); in kone_set_settings_checksum()
144 * Reads settings from mouse and stores it in @buf
156 * Writes settings from @buf to mouse
161 struct kone_settings const *settings) in kone_set_settings() argument
166 settings, sizeof(struct kone_settings)); in kone_set_settings()
279 memcpy(buf, ((char const *)&kone->settings) + off, count); in kone_sysfs_read_settings()
286 * Writing settings automatically activates startup_profile.
303 difference = memcmp(buf, &kone->settings, sizeof(struct kone_settings)); in kone_sysfs_write_settings()
312 old_profile = kone->settings.startup_profile; in kone_sysfs_write_settings()
313 memcpy(&kone->settings, buf, sizeof(struct kone_settings)); in kone_sysfs_write_settings()
315 kone_profile_activated(kone, kone->settings.startup_profile); in kone_sysfs_write_settings()
317 if (kone->settings.startup_profile != old_profile) in kone_sysfs_write_settings()
318 kone_profile_report(kone, kone->settings.startup_profile); in kone_sysfs_write_settings()
324 static BIN_ATTR(settings, 0660, kone_sysfs_read_settings,
448 return snprintf(buf, PAGE_SIZE, "%d\n", kone->settings.tcu); in kone_sysfs_show_tcu()
460 * Calibrating the tcu is the only action that changes settings data inside the
503 * Reading settings too early will result in invalid data. in kone_sysfs_set_tcu()
510 /* calibration changes values in settings, so reread */ in kone_sysfs_set_tcu()
511 retval = kone_get_settings(usb_dev, &kone->settings); in kone_sysfs_set_tcu()
515 /* only write settings back if activation state is different */ in kone_sysfs_set_tcu()
516 if (kone->settings.tcu != state) { in kone_sysfs_set_tcu()
517 kone->settings.tcu = state; in kone_sysfs_set_tcu()
518 kone_set_settings_checksum(&kone->settings); in kone_sysfs_set_tcu()
520 retval = kone_set_settings(usb_dev, &kone->settings); in kone_sysfs_set_tcu()
524 * try to reread valid settings into buffer overwriting in kone_sysfs_set_tcu()
527 retval = kone_get_settings(usb_dev, &kone->settings); in kone_sysfs_set_tcu()
533 kone_profile_activated(kone, kone->settings.startup_profile); in kone_sysfs_set_tcu()
538 dev_err(&usb_dev->dev, "couldn't read settings\n"); in kone_sysfs_set_tcu()
550 return snprintf(buf, PAGE_SIZE, "%d\n", kone->settings.startup_profile); in kone_sysfs_show_startup_profile()
574 kone->settings.startup_profile = new_startup_profile; in kone_sysfs_set_startup_profile()
575 kone_set_settings_checksum(&kone->settings); in kone_sysfs_set_startup_profile()
577 retval = kone_set_settings(usb_dev, &kone->settings); in kone_sysfs_set_startup_profile()
595 * Read actual dpi settings.
665 retval = kone_get_settings(usb_dev, &kone->settings); in kone_init_kone_device_struct()
673 kone_profile_activated(kone, kone->settings.startup_profile); in kone_init_kone_device_struct()