Lines Matching refs: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()
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()
297 struct kone_settings *settings = (struct kone_settings *)buf; in kone_sysfs_write_settings() local
304 difference = memcmp(settings, &kone->settings, in kone_sysfs_write_settings()
307 if (settings->startup_profile < 1 || in kone_sysfs_write_settings()
308 settings->startup_profile > 5) { in kone_sysfs_write_settings()
313 retval = kone_set_settings(usb_dev, settings); in kone_sysfs_write_settings()
317 old_profile = kone->settings.startup_profile; in kone_sysfs_write_settings()
318 memcpy(&kone->settings, settings, sizeof(struct kone_settings)); in kone_sysfs_write_settings()
320 kone_profile_activated(kone, kone->settings.startup_profile); in kone_sysfs_write_settings()
322 if (kone->settings.startup_profile != old_profile) in kone_sysfs_write_settings()
323 kone_profile_report(kone, kone->settings.startup_profile); in kone_sysfs_write_settings()
333 static BIN_ATTR(settings, 0660, kone_sysfs_read_settings,
457 return snprintf(buf, PAGE_SIZE, "%d\n", kone->settings.tcu); in kone_sysfs_show_tcu()
520 retval = kone_get_settings(usb_dev, &kone->settings); in kone_sysfs_set_tcu()
525 if (kone->settings.tcu != state) { in kone_sysfs_set_tcu()
526 kone->settings.tcu = state; in kone_sysfs_set_tcu()
527 kone_set_settings_checksum(&kone->settings); in kone_sysfs_set_tcu()
529 retval = kone_set_settings(usb_dev, &kone->settings); in kone_sysfs_set_tcu()
536 retval = kone_get_settings(usb_dev, &kone->settings); in kone_sysfs_set_tcu()
542 kone_profile_activated(kone, kone->settings.startup_profile); in kone_sysfs_set_tcu()
559 return snprintf(buf, PAGE_SIZE, "%d\n", kone->settings.startup_profile); in kone_sysfs_show_startup_profile()
583 kone->settings.startup_profile = new_startup_profile; in kone_sysfs_set_startup_profile()
584 kone_set_settings_checksum(&kone->settings); in kone_sysfs_set_startup_profile()
586 retval = kone_set_settings(usb_dev, &kone->settings); in kone_sysfs_set_startup_profile()
674 retval = kone_get_settings(usb_dev, &kone->settings); in kone_init_kone_device_struct()
682 kone_profile_activated(kone, kone->settings.startup_profile); in kone_init_kone_device_struct()