Lines Matching refs:samsung
321 struct samsung_laptop *samsung; member
383 static int sabi_command(struct samsung_laptop *samsung, u16 command, in sabi_command() argument
387 const struct sabi_config *config = samsung->config; in sabi_command()
389 u16 port = readw(samsung->sabi + config->header_offsets.port); in sabi_command()
392 mutex_lock(&samsung->sabi_mutex); in sabi_command()
404 outb(readb(samsung->sabi + config->header_offsets.en_mem), port); in sabi_command()
407 writew(config->main_function, samsung->sabi_iface + SABI_IFACE_MAIN); in sabi_command()
408 writew(command, samsung->sabi_iface + SABI_IFACE_SUB); in sabi_command()
409 writeb(0, samsung->sabi_iface + SABI_IFACE_COMPLETE); in sabi_command()
411 writel(in->d0, samsung->sabi_iface + SABI_IFACE_DATA); in sabi_command()
412 writel(in->d1, samsung->sabi_iface + SABI_IFACE_DATA + 4); in sabi_command()
413 writew(in->d2, samsung->sabi_iface + SABI_IFACE_DATA + 8); in sabi_command()
414 writeb(in->d3, samsung->sabi_iface + SABI_IFACE_DATA + 10); in sabi_command()
416 outb(readb(samsung->sabi + config->header_offsets.iface_func), port); in sabi_command()
419 outb(readb(samsung->sabi + config->header_offsets.re_mem), port); in sabi_command()
422 complete = readb(samsung->sabi_iface + SABI_IFACE_COMPLETE); in sabi_command()
423 iface_data = readb(samsung->sabi_iface + SABI_IFACE_DATA); in sabi_command()
440 out->d0 = readl(samsung->sabi_iface + SABI_IFACE_DATA); in sabi_command()
441 out->d1 = readl(samsung->sabi_iface + SABI_IFACE_DATA + 4); in sabi_command()
442 out->d2 = readw(samsung->sabi_iface + SABI_IFACE_DATA + 2); in sabi_command()
443 out->d3 = readb(samsung->sabi_iface + SABI_IFACE_DATA + 1); in sabi_command()
452 mutex_unlock(&samsung->sabi_mutex); in sabi_command()
457 static int sabi_set_commandb(struct samsung_laptop *samsung, in sabi_set_commandb() argument
463 return sabi_command(samsung, command, &in, NULL); in sabi_set_commandb()
466 static int read_brightness(struct samsung_laptop *samsung) in read_brightness() argument
468 const struct sabi_config *config = samsung->config; in read_brightness()
469 const struct sabi_commands *commands = &samsung->config->commands; in read_brightness()
474 retval = sabi_command(samsung, commands->get_brightness, in read_brightness()
488 static void set_brightness(struct samsung_laptop *samsung, u8 user_brightness) in set_brightness() argument
490 const struct sabi_config *config = samsung->config; in set_brightness()
491 const struct sabi_commands *commands = &samsung->config->commands; in set_brightness()
494 if (samsung->has_stepping_quirk && user_level != 0) { in set_brightness()
499 if (user_brightness == read_brightness(samsung)) in set_brightness()
502 sabi_set_commandb(samsung, commands->set_brightness, 0); in set_brightness()
505 sabi_set_commandb(samsung, commands->set_brightness, user_level); in set_brightness()
510 struct samsung_laptop *samsung = bl_get_data(bd); in get_brightness() local
512 return read_brightness(samsung); in get_brightness()
515 static void check_for_stepping_quirk(struct samsung_laptop *samsung) in check_for_stepping_quirk() argument
519 int orig_level = read_brightness(samsung); in check_for_stepping_quirk()
529 set_brightness(samsung, 1); in check_for_stepping_quirk()
531 initial_level = read_brightness(samsung); in check_for_stepping_quirk()
538 samsung->has_stepping_quirk = false; in check_for_stepping_quirk()
539 set_brightness(samsung, check_level); in check_for_stepping_quirk()
541 if (read_brightness(samsung) != check_level) { in check_for_stepping_quirk()
542 samsung->has_stepping_quirk = true; in check_for_stepping_quirk()
546 set_brightness(samsung, orig_level); in check_for_stepping_quirk()
551 struct samsung_laptop *samsung = bl_get_data(bd); in update_status() local
552 const struct sabi_commands *commands = &samsung->config->commands; in update_status()
554 set_brightness(samsung, bd->props.brightness); in update_status()
557 sabi_set_commandb(samsung, commands->set_backlight, 1); in update_status()
559 sabi_set_commandb(samsung, commands->set_backlight, 0); in update_status()
572 struct samsung_laptop *samsung = srfkill->samsung; in seclinux_rfkill_set() local
573 const struct sabi_commands *commands = &samsung->config->commands; in seclinux_rfkill_set()
575 return sabi_set_commandb(samsung, commands->set_wireless_button, in seclinux_rfkill_set()
583 static int swsmi_wireless_status(struct samsung_laptop *samsung, in swsmi_wireless_status() argument
586 const struct sabi_commands *commands = &samsung->config->commands; in swsmi_wireless_status()
588 return sabi_command(samsung, commands->get_wireless_status, in swsmi_wireless_status()
595 struct samsung_laptop *samsung = srfkill->samsung; in swsmi_rfkill_set() local
596 const struct sabi_commands *commands = &samsung->config->commands; in swsmi_rfkill_set()
600 ret = swsmi_wireless_status(samsung, &data); in swsmi_rfkill_set()
614 return sabi_command(samsung, commands->set_wireless_status, in swsmi_rfkill_set()
621 struct samsung_laptop *samsung = srfkill->samsung; in swsmi_rfkill_query() local
625 ret = swsmi_wireless_status(samsung, &data); in swsmi_rfkill_query()
647 struct samsung_laptop *samsung = dev_get_drvdata(dev); in get_performance_level() local
648 const struct sabi_config *config = samsung->config; in get_performance_level()
655 retval = sabi_command(samsung, commands->get_performance_level, in get_performance_level()
672 struct samsung_laptop *samsung = dev_get_drvdata(dev); in set_performance_level() local
673 const struct sabi_config *config = samsung->config; in set_performance_level()
684 sabi_set_commandb(samsung, in set_performance_level()
700 static int read_battery_life_extender(struct samsung_laptop *samsung) in read_battery_life_extender() argument
702 const struct sabi_commands *commands = &samsung->config->commands; in read_battery_life_extender()
711 retval = sabi_command(samsung, commands->get_battery_life_extender, in read_battery_life_extender()
723 static int write_battery_life_extender(struct samsung_laptop *samsung, in write_battery_life_extender() argument
726 const struct sabi_commands *commands = &samsung->config->commands; in write_battery_life_extender()
731 return sabi_command(samsung, commands->set_battery_life_extender, in write_battery_life_extender()
739 struct samsung_laptop *samsung = dev_get_drvdata(dev); in get_battery_life_extender() local
742 ret = read_battery_life_extender(samsung); in get_battery_life_extender()
753 struct samsung_laptop *samsung = dev_get_drvdata(dev); in set_battery_life_extender() local
759 ret = write_battery_life_extender(samsung, !!value); in set_battery_life_extender()
769 static int read_usb_charge(struct samsung_laptop *samsung) in read_usb_charge() argument
771 const struct sabi_commands *commands = &samsung->config->commands; in read_usb_charge()
780 retval = sabi_command(samsung, commands->get_usb_charge, in read_usb_charge()
792 static int write_usb_charge(struct samsung_laptop *samsung, in write_usb_charge() argument
795 const struct sabi_commands *commands = &samsung->config->commands; in write_usb_charge()
800 return sabi_command(samsung, commands->set_usb_charge, in write_usb_charge()
808 struct samsung_laptop *samsung = dev_get_drvdata(dev); in get_usb_charge() local
811 ret = read_usb_charge(samsung); in get_usb_charge()
822 struct samsung_laptop *samsung = dev_get_drvdata(dev); in set_usb_charge() local
828 ret = write_usb_charge(samsung, !!value); in set_usb_charge()
838 static int read_lid_handling(struct samsung_laptop *samsung) in read_lid_handling() argument
840 const struct sabi_commands *commands = &samsung->config->commands; in read_lid_handling()
848 retval = sabi_command(samsung, commands->get_lid_handling, in read_lid_handling()
857 static int write_lid_handling(struct samsung_laptop *samsung, in write_lid_handling() argument
860 const struct sabi_commands *commands = &samsung->config->commands; in write_lid_handling()
865 return sabi_command(samsung, commands->set_lid_handling, in write_lid_handling()
873 struct samsung_laptop *samsung = dev_get_drvdata(dev); in get_lid_handling() local
876 ret = read_lid_handling(samsung); in get_lid_handling()
887 struct samsung_laptop *samsung = dev_get_drvdata(dev); in set_lid_handling() local
893 ret = write_lid_handling(samsung, !!value); in set_lid_handling()
930 static void samsung_rfkill_exit(struct samsung_laptop *samsung) in samsung_rfkill_exit() argument
932 if (samsung->wlan.rfkill) { in samsung_rfkill_exit()
933 rfkill_unregister(samsung->wlan.rfkill); in samsung_rfkill_exit()
934 rfkill_destroy(samsung->wlan.rfkill); in samsung_rfkill_exit()
935 samsung->wlan.rfkill = NULL; in samsung_rfkill_exit()
937 if (samsung->bluetooth.rfkill) { in samsung_rfkill_exit()
938 rfkill_unregister(samsung->bluetooth.rfkill); in samsung_rfkill_exit()
939 rfkill_destroy(samsung->bluetooth.rfkill); in samsung_rfkill_exit()
940 samsung->bluetooth.rfkill = NULL; in samsung_rfkill_exit()
944 static int samsung_new_rfkill(struct samsung_laptop *samsung, in samsung_new_rfkill() argument
954 arfkill->samsung = samsung; in samsung_new_rfkill()
956 *rfkill = rfkill_alloc(name, &samsung->platform_device->dev, in samsung_new_rfkill()
974 static int __init samsung_rfkill_init_seclinux(struct samsung_laptop *samsung) in samsung_rfkill_init_seclinux() argument
976 return samsung_new_rfkill(samsung, &samsung->wlan, "samsung-wlan", in samsung_rfkill_init_seclinux()
980 static int __init samsung_rfkill_init_swsmi(struct samsung_laptop *samsung) in samsung_rfkill_init_swsmi() argument
985 ret = swsmi_wireless_status(samsung, &data); in samsung_rfkill_init_swsmi()
990 ret = samsung_rfkill_init_seclinux(samsung); in samsung_rfkill_init_swsmi()
997 ret = samsung_new_rfkill(samsung, &samsung->wlan, in samsung_rfkill_init_swsmi()
1006 ret = samsung_new_rfkill(samsung, &samsung->bluetooth, in samsung_rfkill_init_swsmi()
1016 samsung_rfkill_exit(samsung); in samsung_rfkill_init_swsmi()
1021 static int __init samsung_rfkill_init(struct samsung_laptop *samsung) in samsung_rfkill_init() argument
1023 if (samsung->config->sabi_version == 2) in samsung_rfkill_init()
1024 return samsung_rfkill_init_seclinux(samsung); in samsung_rfkill_init()
1025 if (samsung->config->sabi_version == 3) in samsung_rfkill_init()
1026 return samsung_rfkill_init_swsmi(samsung); in samsung_rfkill_init()
1030 static void samsung_lid_handling_exit(struct samsung_laptop *samsung) in samsung_lid_handling_exit() argument
1032 if (samsung->quirks->lid_handling) in samsung_lid_handling_exit()
1033 write_lid_handling(samsung, 0); in samsung_lid_handling_exit()
1036 static int __init samsung_lid_handling_init(struct samsung_laptop *samsung) in samsung_lid_handling_init() argument
1040 if (samsung->quirks->lid_handling) in samsung_lid_handling_init()
1041 retval = write_lid_handling(samsung, 1); in samsung_lid_handling_init()
1046 static int kbd_backlight_enable(struct samsung_laptop *samsung) in kbd_backlight_enable() argument
1048 const struct sabi_commands *commands = &samsung->config->commands; in kbd_backlight_enable()
1057 retval = sabi_command(samsung, commands->kbd_backlight, in kbd_backlight_enable()
1068 static int kbd_backlight_read(struct samsung_laptop *samsung) in kbd_backlight_read() argument
1070 const struct sabi_commands *commands = &samsung->config->commands; in kbd_backlight_read()
1076 retval = sabi_command(samsung, commands->kbd_backlight, in kbd_backlight_read()
1085 static int kbd_backlight_write(struct samsung_laptop *samsung, int brightness) in kbd_backlight_write() argument
1087 const struct sabi_commands *commands = &samsung->config->commands; in kbd_backlight_write()
1092 return sabi_command(samsung, commands->kbd_backlight, in kbd_backlight_write()
1098 struct samsung_laptop *samsung; in kbd_led_update() local
1100 samsung = container_of(work, struct samsung_laptop, kbd_led_work); in kbd_led_update()
1101 kbd_backlight_write(samsung, samsung->kbd_led_wk); in kbd_led_update()
1107 struct samsung_laptop *samsung; in kbd_led_set() local
1109 samsung = container_of(led_cdev, struct samsung_laptop, kbd_led); in kbd_led_set()
1111 if (value > samsung->kbd_led.max_brightness) in kbd_led_set()
1112 value = samsung->kbd_led.max_brightness; in kbd_led_set()
1114 samsung->kbd_led_wk = value; in kbd_led_set()
1115 queue_work(samsung->led_workqueue, &samsung->kbd_led_work); in kbd_led_set()
1120 struct samsung_laptop *samsung; in kbd_led_get() local
1122 samsung = container_of(led_cdev, struct samsung_laptop, kbd_led); in kbd_led_get()
1123 return kbd_backlight_read(samsung); in kbd_led_get()
1126 static void samsung_leds_exit(struct samsung_laptop *samsung) in samsung_leds_exit() argument
1128 led_classdev_unregister(&samsung->kbd_led); in samsung_leds_exit()
1129 if (samsung->led_workqueue) in samsung_leds_exit()
1130 destroy_workqueue(samsung->led_workqueue); in samsung_leds_exit()
1133 static int __init samsung_leds_init(struct samsung_laptop *samsung) in samsung_leds_init() argument
1137 samsung->led_workqueue = create_singlethread_workqueue("led_workqueue"); in samsung_leds_init()
1138 if (!samsung->led_workqueue) in samsung_leds_init()
1141 if (kbd_backlight_enable(samsung) >= 0) { in samsung_leds_init()
1142 INIT_WORK(&samsung->kbd_led_work, kbd_led_update); in samsung_leds_init()
1144 samsung->kbd_led.name = "samsung::kbd_backlight"; in samsung_leds_init()
1145 samsung->kbd_led.brightness_set = kbd_led_set; in samsung_leds_init()
1146 samsung->kbd_led.brightness_get = kbd_led_get; in samsung_leds_init()
1147 samsung->kbd_led.max_brightness = 8; in samsung_leds_init()
1148 if (samsung->quirks->four_kbd_backlight_levels) in samsung_leds_init()
1149 samsung->kbd_led.max_brightness = 4; in samsung_leds_init()
1151 ret = led_classdev_register(&samsung->platform_device->dev, in samsung_leds_init()
1152 &samsung->kbd_led); in samsung_leds_init()
1156 samsung_leds_exit(samsung); in samsung_leds_init()
1161 static void samsung_backlight_exit(struct samsung_laptop *samsung) in samsung_backlight_exit() argument
1163 if (samsung->backlight_device) { in samsung_backlight_exit()
1164 backlight_device_unregister(samsung->backlight_device); in samsung_backlight_exit()
1165 samsung->backlight_device = NULL; in samsung_backlight_exit()
1169 static int __init samsung_backlight_init(struct samsung_laptop *samsung) in samsung_backlight_init() argument
1174 if (!samsung->handle_backlight) in samsung_backlight_init()
1179 props.max_brightness = samsung->config->max_brightness - in samsung_backlight_init()
1180 samsung->config->min_brightness; in samsung_backlight_init()
1183 &samsung->platform_device->dev, in samsung_backlight_init()
1184 samsung, &backlight_ops, in samsung_backlight_init()
1189 samsung->backlight_device = bd; in samsung_backlight_init()
1190 samsung->backlight_device->props.brightness = read_brightness(samsung); in samsung_backlight_init()
1191 samsung->backlight_device->props.power = BACKLIGHT_POWER_ON; in samsung_backlight_init()
1192 backlight_update_status(samsung->backlight_device); in samsung_backlight_init()
1201 struct samsung_laptop *samsung = dev_get_drvdata(dev); in samsung_sysfs_is_visible() local
1205 ok = !!samsung->config->performance_levels[0].name; in samsung_sysfs_is_visible()
1207 ok = !!(read_battery_life_extender(samsung) >= 0); in samsung_sysfs_is_visible()
1209 ok = !!(read_usb_charge(samsung) >= 0); in samsung_sysfs_is_visible()
1211 ok = !!(read_lid_handling(samsung) >= 0); in samsung_sysfs_is_visible()
1221 static void samsung_sysfs_exit(struct samsung_laptop *samsung) in samsung_sysfs_exit() argument
1223 struct platform_device *device = samsung->platform_device; in samsung_sysfs_exit()
1228 static int __init samsung_sysfs_init(struct samsung_laptop *samsung) in samsung_sysfs_init() argument
1230 struct platform_device *device = samsung->platform_device; in samsung_sysfs_init()
1238 struct samsung_laptop *samsung = m->private; in samsung_laptop_call_show() local
1239 struct sabi_data *sdata = &samsung->debug.data; in samsung_laptop_call_show()
1243 samsung->debug.command, in samsung_laptop_call_show()
1246 ret = sabi_command(samsung, samsung->debug.command, sdata, sdata); in samsung_laptop_call_show()
1250 samsung->debug.command); in samsung_laptop_call_show()
1260 static void samsung_debugfs_exit(struct samsung_laptop *samsung) in samsung_debugfs_exit() argument
1262 debugfs_remove_recursive(samsung->debug.root); in samsung_debugfs_exit()
1265 static void samsung_debugfs_init(struct samsung_laptop *samsung) in samsung_debugfs_init() argument
1270 samsung->debug.root = root; in samsung_debugfs_init()
1272 samsung->debug.f0000_wrapper.data = samsung->f0000_segment; in samsung_debugfs_init()
1273 samsung->debug.f0000_wrapper.size = 0xffff; in samsung_debugfs_init()
1275 samsung->debug.data_wrapper.data = &samsung->debug.data; in samsung_debugfs_init()
1276 samsung->debug.data_wrapper.size = sizeof(samsung->debug.data); in samsung_debugfs_init()
1278 samsung->debug.sdiag_wrapper.data = samsung->sdiag; in samsung_debugfs_init()
1279 samsung->debug.sdiag_wrapper.size = strlen(samsung->sdiag); in samsung_debugfs_init()
1281 debugfs_create_u16("command", 0644, root, &samsung->debug.command); in samsung_debugfs_init()
1282 debugfs_create_u32("d0", 0644, root, &samsung->debug.data.d0); in samsung_debugfs_init()
1283 debugfs_create_u32("d1", 0644, root, &samsung->debug.data.d1); in samsung_debugfs_init()
1284 debugfs_create_u16("d2", 0644, root, &samsung->debug.data.d2); in samsung_debugfs_init()
1285 debugfs_create_u8("d3", 0644, root, &samsung->debug.data.d3); in samsung_debugfs_init()
1286 debugfs_create_blob("data", 0444, root, &samsung->debug.data_wrapper); in samsung_debugfs_init()
1288 &samsung->debug.f0000_wrapper); in samsung_debugfs_init()
1289 debugfs_create_file("call", 0444, root, samsung, in samsung_debugfs_init()
1291 debugfs_create_blob("sdiag", 0444, root, &samsung->debug.sdiag_wrapper); in samsung_debugfs_init()
1294 static void samsung_sabi_exit(struct samsung_laptop *samsung) in samsung_sabi_exit() argument
1296 const struct sabi_config *config = samsung->config; in samsung_sabi_exit()
1300 sabi_set_commandb(samsung, config->commands.set_linux, 0x80); in samsung_sabi_exit()
1302 if (samsung->sabi_iface) { in samsung_sabi_exit()
1303 iounmap(samsung->sabi_iface); in samsung_sabi_exit()
1304 samsung->sabi_iface = NULL; in samsung_sabi_exit()
1306 if (samsung->f0000_segment) { in samsung_sabi_exit()
1307 iounmap(samsung->f0000_segment); in samsung_sabi_exit()
1308 samsung->f0000_segment = NULL; in samsung_sabi_exit()
1311 samsung->config = NULL; in samsung_sabi_exit()
1314 static __init void samsung_sabi_infos(struct samsung_laptop *samsung, int loca, in samsung_sabi_infos() argument
1317 const struct sabi_config *config = samsung->config; in samsung_sabi_infos()
1324 readw(samsung->sabi + config->header_offsets.port)); in samsung_sabi_infos()
1326 readb(samsung->sabi + config->header_offsets.iface_func)); in samsung_sabi_infos()
1328 readb(samsung->sabi + config->header_offsets.en_mem)); in samsung_sabi_infos()
1330 readb(samsung->sabi + config->header_offsets.re_mem)); in samsung_sabi_infos()
1332 readw(samsung->sabi + config->header_offsets.data_offset)); in samsung_sabi_infos()
1334 readw(samsung->sabi + config->header_offsets.data_segment)); in samsung_sabi_infos()
1339 static void __init samsung_sabi_diag(struct samsung_laptop *samsung) in samsung_sabi_diag() argument
1341 int loca = find_signature(samsung->f0000_segment, "SDiaG@"); in samsung_sabi_diag()
1354 for (i = 0; loca < 0xffff && i < sizeof(samsung->sdiag) - 1; loca++) { in samsung_sabi_diag()
1355 char temp = readb(samsung->f0000_segment + loca); in samsung_sabi_diag()
1358 samsung->sdiag[i++] = temp; in samsung_sabi_diag()
1363 if (debug && samsung->sdiag[0]) in samsung_sabi_diag()
1364 pr_info("sdiag: %s", samsung->sdiag); in samsung_sabi_diag()
1367 static int __init samsung_sabi_init(struct samsung_laptop *samsung) in samsung_sabi_init() argument
1376 samsung->f0000_segment = ioremap(0xf0000, 0xffff); in samsung_sabi_init()
1377 if (!samsung->f0000_segment) { in samsung_sabi_init()
1384 samsung_sabi_diag(samsung); in samsung_sabi_init()
1388 samsung->config = &sabi_configs[i]; in samsung_sabi_init()
1389 loca = find_signature(samsung->f0000_segment, in samsung_sabi_init()
1390 samsung->config->test_string); in samsung_sabi_init()
1402 config = samsung->config; in samsung_sabi_init()
1407 samsung->sabi = (samsung->f0000_segment + loca); in samsung_sabi_init()
1410 ifaceP = (readw(samsung->sabi + config->header_offsets.data_segment) & 0x0ffff) << 4; in samsung_sabi_init()
1411 ifaceP += readw(samsung->sabi + config->header_offsets.data_offset) & 0x0ffff; in samsung_sabi_init()
1414 samsung_sabi_infos(samsung, loca, ifaceP); in samsung_sabi_init()
1416 samsung->sabi_iface = ioremap(ifaceP, 16); in samsung_sabi_init()
1417 if (!samsung->sabi_iface) { in samsung_sabi_init()
1425 int retval = sabi_set_commandb(samsung, in samsung_sabi_init()
1435 if (samsung->handle_backlight) in samsung_sabi_init()
1436 check_for_stepping_quirk(samsung); in samsung_sabi_init()
1439 samsung->config->test_string); in samsung_sabi_init()
1443 samsung_sabi_exit(samsung); in samsung_sabi_init()
1448 static void samsung_platform_exit(struct samsung_laptop *samsung) in samsung_platform_exit() argument
1450 if (samsung->platform_device) { in samsung_platform_exit()
1451 platform_device_unregister(samsung->platform_device); in samsung_platform_exit()
1452 samsung->platform_device = NULL; in samsung_platform_exit()
1459 struct samsung_laptop *samsung; in samsung_pm_notification() local
1461 samsung = container_of(nb, struct samsung_laptop, pm_nb); in samsung_pm_notification()
1463 samsung->quirks->enable_kbd_backlight) in samsung_pm_notification()
1464 kbd_backlight_enable(samsung); in samsung_pm_notification()
1466 if (val == PM_POST_HIBERNATION && samsung->quirks->lid_handling) in samsung_pm_notification()
1467 write_lid_handling(samsung, 1); in samsung_pm_notification()
1472 static int __init samsung_platform_init(struct samsung_laptop *samsung) in samsung_platform_init() argument
1480 samsung->platform_device = pdev; in samsung_platform_init()
1481 platform_set_drvdata(samsung->platform_device, samsung); in samsung_platform_init()
1558 struct samsung_laptop *samsung; in samsung_init() local
1568 samsung = kzalloc(sizeof(*samsung), GFP_KERNEL); in samsung_init()
1569 if (!samsung) in samsung_init()
1572 mutex_init(&samsung->sabi_mutex); in samsung_init()
1573 samsung->handle_backlight = true; in samsung_init()
1574 samsung->quirks = quirks; in samsung_init()
1577 samsung->handle_backlight = false; in samsung_init()
1579 ret = samsung_platform_init(samsung); in samsung_init()
1583 ret = samsung_sabi_init(samsung); in samsung_init()
1587 ret = samsung_sysfs_init(samsung); in samsung_init()
1591 ret = samsung_backlight_init(samsung); in samsung_init()
1595 ret = samsung_rfkill_init(samsung); in samsung_init()
1599 ret = samsung_leds_init(samsung); in samsung_init()
1603 ret = samsung_lid_handling_init(samsung); in samsung_init()
1607 samsung_debugfs_init(samsung); in samsung_init()
1609 samsung->pm_nb.notifier_call = samsung_pm_notification; in samsung_init()
1610 register_pm_notifier(&samsung->pm_nb); in samsung_init()
1612 samsung_platform_device = samsung->platform_device; in samsung_init()
1616 samsung_leds_exit(samsung); in samsung_init()
1618 samsung_rfkill_exit(samsung); in samsung_init()
1620 samsung_backlight_exit(samsung); in samsung_init()
1622 samsung_sysfs_exit(samsung); in samsung_init()
1624 samsung_sabi_exit(samsung); in samsung_init()
1626 samsung_platform_exit(samsung); in samsung_init()
1628 kfree(samsung); in samsung_init()
1634 struct samsung_laptop *samsung; in samsung_exit() local
1636 samsung = platform_get_drvdata(samsung_platform_device); in samsung_exit()
1637 unregister_pm_notifier(&samsung->pm_nb); in samsung_exit()
1639 samsung_debugfs_exit(samsung); in samsung_exit()
1640 samsung_lid_handling_exit(samsung); in samsung_exit()
1641 samsung_leds_exit(samsung); in samsung_exit()
1642 samsung_rfkill_exit(samsung); in samsung_exit()
1643 samsung_backlight_exit(samsung); in samsung_exit()
1644 samsung_sysfs_exit(samsung); in samsung_exit()
1645 samsung_sabi_exit(samsung); in samsung_exit()
1646 samsung_platform_exit(samsung); in samsung_exit()
1648 kfree(samsung); in samsung_exit()