Lines Matching full:samsung

3  * Samsung Laptop driver
30 * This driver is needed because a number of Samsung laptops do not hook
290 * samsung-laptop/ - debugfs root directory
322 struct samsung_laptop *samsung; member
384 static int sabi_command(struct samsung_laptop *samsung, u16 command, in sabi_command() argument
388 const struct sabi_config *config = samsung->config; in sabi_command()
390 u16 port = readw(samsung->sabi + config->header_offsets.port); in sabi_command()
393 mutex_lock(&samsung->sabi_mutex); in sabi_command()
405 outb(readb(samsung->sabi + config->header_offsets.en_mem), port); in sabi_command()
408 writew(config->main_function, samsung->sabi_iface + SABI_IFACE_MAIN); in sabi_command()
409 writew(command, samsung->sabi_iface + SABI_IFACE_SUB); in sabi_command()
410 writeb(0, samsung->sabi_iface + SABI_IFACE_COMPLETE); in sabi_command()
412 writel(in->d0, samsung->sabi_iface + SABI_IFACE_DATA); in sabi_command()
413 writel(in->d1, samsung->sabi_iface + SABI_IFACE_DATA + 4); in sabi_command()
414 writew(in->d2, samsung->sabi_iface + SABI_IFACE_DATA + 8); in sabi_command()
415 writeb(in->d3, samsung->sabi_iface + SABI_IFACE_DATA + 10); in sabi_command()
417 outb(readb(samsung->sabi + config->header_offsets.iface_func), port); in sabi_command()
420 outb(readb(samsung->sabi + config->header_offsets.re_mem), port); in sabi_command()
423 complete = readb(samsung->sabi_iface + SABI_IFACE_COMPLETE); in sabi_command()
424 iface_data = readb(samsung->sabi_iface + SABI_IFACE_DATA); in sabi_command()
441 out->d0 = readl(samsung->sabi_iface + SABI_IFACE_DATA); in sabi_command()
442 out->d1 = readl(samsung->sabi_iface + SABI_IFACE_DATA + 4); in sabi_command()
443 out->d2 = readw(samsung->sabi_iface + SABI_IFACE_DATA + 2); in sabi_command()
444 out->d3 = readb(samsung->sabi_iface + SABI_IFACE_DATA + 1); in sabi_command()
453 mutex_unlock(&samsung->sabi_mutex); in sabi_command()
458 static int sabi_set_commandb(struct samsung_laptop *samsung, in sabi_set_commandb() argument
464 return sabi_command(samsung, command, &in, NULL); in sabi_set_commandb()
467 static int read_brightness(struct samsung_laptop *samsung) in read_brightness() argument
469 const struct sabi_config *config = samsung->config; in read_brightness()
470 const struct sabi_commands *commands = &samsung->config->commands; in read_brightness()
475 retval = sabi_command(samsung, commands->get_brightness, in read_brightness()
489 static void set_brightness(struct samsung_laptop *samsung, u8 user_brightness) in set_brightness() argument
491 const struct sabi_config *config = samsung->config; in set_brightness()
492 const struct sabi_commands *commands = &samsung->config->commands; in set_brightness()
495 if (samsung->has_stepping_quirk && user_level != 0) { in set_brightness()
500 if (user_brightness == read_brightness(samsung)) in set_brightness()
503 sabi_set_commandb(samsung, commands->set_brightness, 0); in set_brightness()
506 sabi_set_commandb(samsung, commands->set_brightness, user_level); in set_brightness()
511 struct samsung_laptop *samsung = bl_get_data(bd); in get_brightness() local
513 return read_brightness(samsung); in get_brightness()
516 static void check_for_stepping_quirk(struct samsung_laptop *samsung) in check_for_stepping_quirk() argument
520 int orig_level = read_brightness(samsung); in check_for_stepping_quirk()
530 set_brightness(samsung, 1); in check_for_stepping_quirk()
532 initial_level = read_brightness(samsung); in check_for_stepping_quirk()
539 samsung->has_stepping_quirk = false; in check_for_stepping_quirk()
540 set_brightness(samsung, check_level); in check_for_stepping_quirk()
542 if (read_brightness(samsung) != check_level) { in check_for_stepping_quirk()
543 samsung->has_stepping_quirk = true; in check_for_stepping_quirk()
547 set_brightness(samsung, orig_level); in check_for_stepping_quirk()
552 struct samsung_laptop *samsung = bl_get_data(bd); in update_status() local
553 const struct sabi_commands *commands = &samsung->config->commands; in update_status()
555 set_brightness(samsung, bd->props.brightness); in update_status()
558 sabi_set_commandb(samsung, commands->set_backlight, 1); in update_status()
560 sabi_set_commandb(samsung, commands->set_backlight, 0); in update_status()
573 struct samsung_laptop *samsung = srfkill->samsung; in seclinux_rfkill_set() local
574 const struct sabi_commands *commands = &samsung->config->commands; in seclinux_rfkill_set()
576 return sabi_set_commandb(samsung, commands->set_wireless_button, in seclinux_rfkill_set()
584 static int swsmi_wireless_status(struct samsung_laptop *samsung, in swsmi_wireless_status() argument
587 const struct sabi_commands *commands = &samsung->config->commands; in swsmi_wireless_status()
589 return sabi_command(samsung, commands->get_wireless_status, in swsmi_wireless_status()
596 struct samsung_laptop *samsung = srfkill->samsung; in swsmi_rfkill_set() local
597 const struct sabi_commands *commands = &samsung->config->commands; in swsmi_rfkill_set()
601 ret = swsmi_wireless_status(samsung, &data); in swsmi_rfkill_set()
615 return sabi_command(samsung, commands->set_wireless_status, in swsmi_rfkill_set()
622 struct samsung_laptop *samsung = srfkill->samsung; in swsmi_rfkill_query() local
626 ret = swsmi_wireless_status(samsung, &data); in swsmi_rfkill_query()
648 struct samsung_laptop *samsung = dev_get_drvdata(dev); in get_performance_level() local
649 const struct sabi_config *config = samsung->config; in get_performance_level()
656 retval = sabi_command(samsung, commands->get_performance_level, in get_performance_level()
673 struct samsung_laptop *samsung = dev_get_drvdata(dev); in set_performance_level() local
674 const struct sabi_config *config = samsung->config; in set_performance_level()
685 sabi_set_commandb(samsung, in set_performance_level()
701 static int read_battery_life_extender(struct samsung_laptop *samsung) in read_battery_life_extender() argument
703 const struct sabi_commands *commands = &samsung->config->commands; in read_battery_life_extender()
712 retval = sabi_command(samsung, commands->get_battery_life_extender, in read_battery_life_extender()
724 static int write_battery_life_extender(struct samsung_laptop *samsung, in write_battery_life_extender() argument
727 const struct sabi_commands *commands = &samsung->config->commands; in write_battery_life_extender()
732 return sabi_command(samsung, commands->set_battery_life_extender, in write_battery_life_extender()
740 struct samsung_laptop *samsung = dev_get_drvdata(dev); in get_battery_life_extender() local
743 ret = read_battery_life_extender(samsung); in get_battery_life_extender()
754 struct samsung_laptop *samsung = dev_get_drvdata(dev); in set_battery_life_extender() local
760 ret = write_battery_life_extender(samsung, !!value); in set_battery_life_extender()
770 static int read_usb_charge(struct samsung_laptop *samsung) in read_usb_charge() argument
772 const struct sabi_commands *commands = &samsung->config->commands; in read_usb_charge()
781 retval = sabi_command(samsung, commands->get_usb_charge, in read_usb_charge()
793 static int write_usb_charge(struct samsung_laptop *samsung, in write_usb_charge() argument
796 const struct sabi_commands *commands = &samsung->config->commands; in write_usb_charge()
801 return sabi_command(samsung, commands->set_usb_charge, in write_usb_charge()
809 struct samsung_laptop *samsung = dev_get_drvdata(dev); in get_usb_charge() local
812 ret = read_usb_charge(samsung); in get_usb_charge()
823 struct samsung_laptop *samsung = dev_get_drvdata(dev); in set_usb_charge() local
829 ret = write_usb_charge(samsung, !!value); in set_usb_charge()
839 static int read_lid_handling(struct samsung_laptop *samsung) in read_lid_handling() argument
841 const struct sabi_commands *commands = &samsung->config->commands; in read_lid_handling()
849 retval = sabi_command(samsung, commands->get_lid_handling, in read_lid_handling()
858 static int write_lid_handling(struct samsung_laptop *samsung, in write_lid_handling() argument
861 const struct sabi_commands *commands = &samsung->config->commands; in write_lid_handling()
866 return sabi_command(samsung, commands->set_lid_handling, in write_lid_handling()
874 struct samsung_laptop *samsung = dev_get_drvdata(dev); in get_lid_handling() local
877 ret = read_lid_handling(samsung); in get_lid_handling()
888 struct samsung_laptop *samsung = dev_get_drvdata(dev); in set_lid_handling() local
894 ret = write_lid_handling(samsung, !!value); in set_lid_handling()
931 static void samsung_rfkill_exit(struct samsung_laptop *samsung) in samsung_rfkill_exit() argument
933 if (samsung->wlan.rfkill) { in samsung_rfkill_exit()
934 rfkill_unregister(samsung->wlan.rfkill); in samsung_rfkill_exit()
935 rfkill_destroy(samsung->wlan.rfkill); in samsung_rfkill_exit()
936 samsung->wlan.rfkill = NULL; in samsung_rfkill_exit()
938 if (samsung->bluetooth.rfkill) { in samsung_rfkill_exit()
939 rfkill_unregister(samsung->bluetooth.rfkill); in samsung_rfkill_exit()
940 rfkill_destroy(samsung->bluetooth.rfkill); in samsung_rfkill_exit()
941 samsung->bluetooth.rfkill = NULL; in samsung_rfkill_exit()
945 static int samsung_new_rfkill(struct samsung_laptop *samsung, in samsung_new_rfkill() argument
955 arfkill->samsung = samsung; in samsung_new_rfkill()
957 *rfkill = rfkill_alloc(name, &samsung->platform_device->dev, in samsung_new_rfkill()
975 static int __init samsung_rfkill_init_seclinux(struct samsung_laptop *samsung) in samsung_rfkill_init_seclinux() argument
977 return samsung_new_rfkill(samsung, &samsung->wlan, "samsung-wlan", in samsung_rfkill_init_seclinux()
981 static int __init samsung_rfkill_init_swsmi(struct samsung_laptop *samsung) in samsung_rfkill_init_swsmi() argument
986 ret = swsmi_wireless_status(samsung, &data); in samsung_rfkill_init_swsmi()
991 ret = samsung_rfkill_init_seclinux(samsung); in samsung_rfkill_init_swsmi()
998 ret = samsung_new_rfkill(samsung, &samsung->wlan, in samsung_rfkill_init_swsmi()
999 "samsung-wlan", in samsung_rfkill_init_swsmi()
1007 ret = samsung_new_rfkill(samsung, &samsung->bluetooth, in samsung_rfkill_init_swsmi()
1008 "samsung-bluetooth", in samsung_rfkill_init_swsmi()
1017 samsung_rfkill_exit(samsung); in samsung_rfkill_init_swsmi()
1022 static int __init samsung_rfkill_init(struct samsung_laptop *samsung) in samsung_rfkill_init() argument
1024 if (samsung->config->sabi_version == 2) in samsung_rfkill_init()
1025 return samsung_rfkill_init_seclinux(samsung); in samsung_rfkill_init()
1026 if (samsung->config->sabi_version == 3) in samsung_rfkill_init()
1027 return samsung_rfkill_init_swsmi(samsung); in samsung_rfkill_init()
1031 static void samsung_lid_handling_exit(struct samsung_laptop *samsung) in samsung_lid_handling_exit() argument
1033 if (samsung->quirks->lid_handling) in samsung_lid_handling_exit()
1034 write_lid_handling(samsung, 0); in samsung_lid_handling_exit()
1037 static int __init samsung_lid_handling_init(struct samsung_laptop *samsung) in samsung_lid_handling_init() argument
1041 if (samsung->quirks->lid_handling) in samsung_lid_handling_init()
1042 retval = write_lid_handling(samsung, 1); in samsung_lid_handling_init()
1047 static int kbd_backlight_enable(struct samsung_laptop *samsung) in kbd_backlight_enable() argument
1049 const struct sabi_commands *commands = &samsung->config->commands; in kbd_backlight_enable()
1058 retval = sabi_command(samsung, commands->kbd_backlight, in kbd_backlight_enable()
1069 static int kbd_backlight_read(struct samsung_laptop *samsung) in kbd_backlight_read() argument
1071 const struct sabi_commands *commands = &samsung->config->commands; in kbd_backlight_read()
1077 retval = sabi_command(samsung, commands->kbd_backlight, in kbd_backlight_read()
1086 static int kbd_backlight_write(struct samsung_laptop *samsung, int brightness) in kbd_backlight_write() argument
1088 const struct sabi_commands *commands = &samsung->config->commands; in kbd_backlight_write()
1093 return sabi_command(samsung, commands->kbd_backlight, in kbd_backlight_write()
1099 struct samsung_laptop *samsung; in kbd_led_update() local
1101 samsung = container_of(work, struct samsung_laptop, kbd_led_work); in kbd_led_update()
1102 kbd_backlight_write(samsung, samsung->kbd_led_wk); in kbd_led_update()
1108 struct samsung_laptop *samsung; in kbd_led_set() local
1110 samsung = container_of(led_cdev, struct samsung_laptop, kbd_led); in kbd_led_set()
1112 if (value > samsung->kbd_led.max_brightness) in kbd_led_set()
1113 value = samsung->kbd_led.max_brightness; in kbd_led_set()
1115 samsung->kbd_led_wk = value; in kbd_led_set()
1116 queue_work(samsung->led_workqueue, &samsung->kbd_led_work); in kbd_led_set()
1121 struct samsung_laptop *samsung; in kbd_led_get() local
1123 samsung = container_of(led_cdev, struct samsung_laptop, kbd_led); in kbd_led_get()
1124 return kbd_backlight_read(samsung); in kbd_led_get()
1127 static void samsung_leds_exit(struct samsung_laptop *samsung) in samsung_leds_exit() argument
1129 led_classdev_unregister(&samsung->kbd_led); in samsung_leds_exit()
1130 if (samsung->led_workqueue) in samsung_leds_exit()
1131 destroy_workqueue(samsung->led_workqueue); in samsung_leds_exit()
1134 static int __init samsung_leds_init(struct samsung_laptop *samsung) in samsung_leds_init() argument
1138 samsung->led_workqueue = create_singlethread_workqueue("led_workqueue"); in samsung_leds_init()
1139 if (!samsung->led_workqueue) in samsung_leds_init()
1142 if (kbd_backlight_enable(samsung) >= 0) { in samsung_leds_init()
1143 INIT_WORK(&samsung->kbd_led_work, kbd_led_update); in samsung_leds_init()
1145 samsung->kbd_led.name = "samsung::kbd_backlight"; in samsung_leds_init()
1146 samsung->kbd_led.brightness_set = kbd_led_set; in samsung_leds_init()
1147 samsung->kbd_led.brightness_get = kbd_led_get; in samsung_leds_init()
1148 samsung->kbd_led.max_brightness = 8; in samsung_leds_init()
1149 if (samsung->quirks->four_kbd_backlight_levels) in samsung_leds_init()
1150 samsung->kbd_led.max_brightness = 4; in samsung_leds_init()
1152 ret = led_classdev_register(&samsung->platform_device->dev, in samsung_leds_init()
1153 &samsung->kbd_led); in samsung_leds_init()
1157 samsung_leds_exit(samsung); in samsung_leds_init()
1162 static void samsung_backlight_exit(struct samsung_laptop *samsung) in samsung_backlight_exit() argument
1164 if (samsung->backlight_device) { in samsung_backlight_exit()
1165 backlight_device_unregister(samsung->backlight_device); in samsung_backlight_exit()
1166 samsung->backlight_device = NULL; in samsung_backlight_exit()
1170 static int __init samsung_backlight_init(struct samsung_laptop *samsung) in samsung_backlight_init() argument
1175 if (!samsung->handle_backlight) in samsung_backlight_init()
1180 props.max_brightness = samsung->config->max_brightness - in samsung_backlight_init()
1181 samsung->config->min_brightness; in samsung_backlight_init()
1183 bd = backlight_device_register("samsung", in samsung_backlight_init()
1184 &samsung->platform_device->dev, in samsung_backlight_init()
1185 samsung, &backlight_ops, in samsung_backlight_init()
1190 samsung->backlight_device = bd; in samsung_backlight_init()
1191 samsung->backlight_device->props.brightness = read_brightness(samsung); in samsung_backlight_init()
1192 samsung->backlight_device->props.power = FB_BLANK_UNBLANK; in samsung_backlight_init()
1193 backlight_update_status(samsung->backlight_device); in samsung_backlight_init()
1202 struct samsung_laptop *samsung = dev_get_drvdata(dev); in samsung_sysfs_is_visible() local
1206 ok = !!samsung->config->performance_levels[0].name; in samsung_sysfs_is_visible()
1208 ok = !!(read_battery_life_extender(samsung) >= 0); in samsung_sysfs_is_visible()
1210 ok = !!(read_usb_charge(samsung) >= 0); in samsung_sysfs_is_visible()
1212 ok = !!(read_lid_handling(samsung) >= 0); in samsung_sysfs_is_visible()
1222 static void samsung_sysfs_exit(struct samsung_laptop *samsung) in samsung_sysfs_exit() argument
1224 struct platform_device *device = samsung->platform_device; in samsung_sysfs_exit()
1229 static int __init samsung_sysfs_init(struct samsung_laptop *samsung) in samsung_sysfs_init() argument
1231 struct platform_device *device = samsung->platform_device; in samsung_sysfs_init()
1239 struct samsung_laptop *samsung = m->private; in samsung_laptop_call_show() local
1240 struct sabi_data *sdata = &samsung->debug.data; in samsung_laptop_call_show()
1244 samsung->debug.command, in samsung_laptop_call_show()
1247 ret = sabi_command(samsung, samsung->debug.command, sdata, sdata); in samsung_laptop_call_show()
1251 samsung->debug.command); in samsung_laptop_call_show()
1261 static void samsung_debugfs_exit(struct samsung_laptop *samsung) in samsung_debugfs_exit() argument
1263 debugfs_remove_recursive(samsung->debug.root); in samsung_debugfs_exit()
1266 static void samsung_debugfs_init(struct samsung_laptop *samsung) in samsung_debugfs_init() argument
1270 root = debugfs_create_dir("samsung-laptop", NULL); in samsung_debugfs_init()
1271 samsung->debug.root = root; in samsung_debugfs_init()
1273 samsung->debug.f0000_wrapper.data = samsung->f0000_segment; in samsung_debugfs_init()
1274 samsung->debug.f0000_wrapper.size = 0xffff; in samsung_debugfs_init()
1276 samsung->debug.data_wrapper.data = &samsung->debug.data; in samsung_debugfs_init()
1277 samsung->debug.data_wrapper.size = sizeof(samsung->debug.data); in samsung_debugfs_init()
1279 samsung->debug.sdiag_wrapper.data = samsung->sdiag; in samsung_debugfs_init()
1280 samsung->debug.sdiag_wrapper.size = strlen(samsung->sdiag); in samsung_debugfs_init()
1282 debugfs_create_u16("command", 0644, root, &samsung->debug.command); in samsung_debugfs_init()
1283 debugfs_create_u32("d0", 0644, root, &samsung->debug.data.d0); in samsung_debugfs_init()
1284 debugfs_create_u32("d1", 0644, root, &samsung->debug.data.d1); in samsung_debugfs_init()
1285 debugfs_create_u16("d2", 0644, root, &samsung->debug.data.d2); in samsung_debugfs_init()
1286 debugfs_create_u8("d3", 0644, root, &samsung->debug.data.d3); in samsung_debugfs_init()
1287 debugfs_create_blob("data", 0444, root, &samsung->debug.data_wrapper); in samsung_debugfs_init()
1289 &samsung->debug.f0000_wrapper); in samsung_debugfs_init()
1290 debugfs_create_file("call", 0444, root, samsung, in samsung_debugfs_init()
1292 debugfs_create_blob("sdiag", 0444, root, &samsung->debug.sdiag_wrapper); in samsung_debugfs_init()
1295 static void samsung_sabi_exit(struct samsung_laptop *samsung) in samsung_sabi_exit() argument
1297 const struct sabi_config *config = samsung->config; in samsung_sabi_exit()
1301 sabi_set_commandb(samsung, config->commands.set_linux, 0x80); in samsung_sabi_exit()
1303 if (samsung->sabi_iface) { in samsung_sabi_exit()
1304 iounmap(samsung->sabi_iface); in samsung_sabi_exit()
1305 samsung->sabi_iface = NULL; in samsung_sabi_exit()
1307 if (samsung->f0000_segment) { in samsung_sabi_exit()
1308 iounmap(samsung->f0000_segment); in samsung_sabi_exit()
1309 samsung->f0000_segment = NULL; in samsung_sabi_exit()
1312 samsung->config = NULL; in samsung_sabi_exit()
1315 static __init void samsung_sabi_infos(struct samsung_laptop *samsung, int loca, in samsung_sabi_infos() argument
1318 const struct sabi_config *config = samsung->config; in samsung_sabi_infos()
1325 readw(samsung->sabi + config->header_offsets.port)); in samsung_sabi_infos()
1327 readb(samsung->sabi + config->header_offsets.iface_func)); in samsung_sabi_infos()
1329 readb(samsung->sabi + config->header_offsets.en_mem)); in samsung_sabi_infos()
1331 readb(samsung->sabi + config->header_offsets.re_mem)); in samsung_sabi_infos()
1333 readw(samsung->sabi + config->header_offsets.data_offset)); in samsung_sabi_infos()
1335 readw(samsung->sabi + config->header_offsets.data_segment)); in samsung_sabi_infos()
1340 static void __init samsung_sabi_diag(struct samsung_laptop *samsung) in samsung_sabi_diag() argument
1342 int loca = find_signature(samsung->f0000_segment, "SDiaG@"); in samsung_sabi_diag()
1355 for (i = 0; loca < 0xffff && i < sizeof(samsung->sdiag) - 1; loca++) { in samsung_sabi_diag()
1356 char temp = readb(samsung->f0000_segment + loca); in samsung_sabi_diag()
1359 samsung->sdiag[i++] = temp; in samsung_sabi_diag()
1364 if (debug && samsung->sdiag[0]) in samsung_sabi_diag()
1365 pr_info("sdiag: %s", samsung->sdiag); in samsung_sabi_diag()
1368 static int __init samsung_sabi_init(struct samsung_laptop *samsung) in samsung_sabi_init() argument
1377 samsung->f0000_segment = ioremap(0xf0000, 0xffff); in samsung_sabi_init()
1378 if (!samsung->f0000_segment) { in samsung_sabi_init()
1385 samsung_sabi_diag(samsung); in samsung_sabi_init()
1389 samsung->config = &sabi_configs[i]; in samsung_sabi_init()
1390 loca = find_signature(samsung->f0000_segment, in samsung_sabi_init()
1391 samsung->config->test_string); in samsung_sabi_init()
1403 config = samsung->config; in samsung_sabi_init()
1408 samsung->sabi = (samsung->f0000_segment + loca); in samsung_sabi_init()
1411 ifaceP = (readw(samsung->sabi + config->header_offsets.data_segment) & 0x0ffff) << 4; in samsung_sabi_init()
1412 ifaceP += readw(samsung->sabi + config->header_offsets.data_offset) & 0x0ffff; in samsung_sabi_init()
1415 samsung_sabi_infos(samsung, loca, ifaceP); in samsung_sabi_init()
1417 samsung->sabi_iface = ioremap(ifaceP, 16); in samsung_sabi_init()
1418 if (!samsung->sabi_iface) { in samsung_sabi_init()
1426 int retval = sabi_set_commandb(samsung, in samsung_sabi_init()
1436 if (samsung->handle_backlight) in samsung_sabi_init()
1437 check_for_stepping_quirk(samsung); in samsung_sabi_init()
1440 samsung->config->test_string); in samsung_sabi_init()
1444 samsung_sabi_exit(samsung); in samsung_sabi_init()
1449 static void samsung_platform_exit(struct samsung_laptop *samsung) in samsung_platform_exit() argument
1451 if (samsung->platform_device) { in samsung_platform_exit()
1452 platform_device_unregister(samsung->platform_device); in samsung_platform_exit()
1453 samsung->platform_device = NULL; in samsung_platform_exit()
1460 struct samsung_laptop *samsung; in samsung_pm_notification() local
1462 samsung = container_of(nb, struct samsung_laptop, pm_nb); in samsung_pm_notification()
1464 samsung->quirks->enable_kbd_backlight) in samsung_pm_notification()
1465 kbd_backlight_enable(samsung); in samsung_pm_notification()
1467 if (val == PM_POST_HIBERNATION && samsung->quirks->lid_handling) in samsung_pm_notification()
1468 write_lid_handling(samsung, 1); in samsung_pm_notification()
1473 static int __init samsung_platform_init(struct samsung_laptop *samsung) in samsung_platform_init() argument
1477 pdev = platform_device_register_simple("samsung", PLATFORM_DEVID_NONE, NULL, 0); in samsung_platform_init()
1481 samsung->platform_device = pdev; in samsung_platform_init()
1482 platform_set_drvdata(samsung->platform_device, samsung); in samsung_platform_init()
1498 "SAMSUNG ELECTRONICS CO., LTD."),
1505 "SAMSUNG ELECTRONICS CO., LTD."),
1512 "SAMSUNG ELECTRONICS CO., LTD."),
1519 "SAMSUNG ELECTRONICS CO., LTD."),
1527 DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
1537 DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
1546 DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
1559 struct samsung_laptop *samsung; in samsung_init() local
1569 samsung = kzalloc(sizeof(*samsung), GFP_KERNEL); in samsung_init()
1570 if (!samsung) in samsung_init()
1573 mutex_init(&samsung->sabi_mutex); in samsung_init()
1574 samsung->handle_backlight = true; in samsung_init()
1575 samsung->quirks = quirks; in samsung_init()
1578 samsung->handle_backlight = false; in samsung_init()
1580 ret = samsung_platform_init(samsung); in samsung_init()
1584 ret = samsung_sabi_init(samsung); in samsung_init()
1588 ret = samsung_sysfs_init(samsung); in samsung_init()
1592 ret = samsung_backlight_init(samsung); in samsung_init()
1596 ret = samsung_rfkill_init(samsung); in samsung_init()
1600 ret = samsung_leds_init(samsung); in samsung_init()
1604 ret = samsung_lid_handling_init(samsung); in samsung_init()
1608 samsung_debugfs_init(samsung); in samsung_init()
1610 samsung->pm_nb.notifier_call = samsung_pm_notification; in samsung_init()
1611 register_pm_notifier(&samsung->pm_nb); in samsung_init()
1613 samsung_platform_device = samsung->platform_device; in samsung_init()
1617 samsung_leds_exit(samsung); in samsung_init()
1619 samsung_rfkill_exit(samsung); in samsung_init()
1621 samsung_backlight_exit(samsung); in samsung_init()
1623 samsung_sysfs_exit(samsung); in samsung_init()
1625 samsung_sabi_exit(samsung); in samsung_init()
1627 samsung_platform_exit(samsung); in samsung_init()
1629 kfree(samsung); in samsung_init()
1635 struct samsung_laptop *samsung; in samsung_exit() local
1637 samsung = platform_get_drvdata(samsung_platform_device); in samsung_exit()
1638 unregister_pm_notifier(&samsung->pm_nb); in samsung_exit()
1640 samsung_debugfs_exit(samsung); in samsung_exit()
1641 samsung_lid_handling_exit(samsung); in samsung_exit()
1642 samsung_leds_exit(samsung); in samsung_exit()
1643 samsung_rfkill_exit(samsung); in samsung_exit()
1644 samsung_backlight_exit(samsung); in samsung_exit()
1645 samsung_sysfs_exit(samsung); in samsung_exit()
1646 samsung_sabi_exit(samsung); in samsung_exit()
1647 samsung_platform_exit(samsung); in samsung_exit()
1649 kfree(samsung); in samsung_exit()
1657 MODULE_DESCRIPTION("Samsung Backlight driver");