Lines Matching refs:topstar
46 struct topstar_laptop *topstar = container_of(led, in topstar_led_set() local
63 status = acpi_evaluate_integer(topstar->device->handle, in topstar_led_set()
76 status = acpi_execute_simple_method(topstar->device->handle, in topstar_led_set()
85 static int topstar_led_init(struct topstar_laptop *topstar) in topstar_led_init() argument
87 topstar->led = (struct led_classdev) { in topstar_led_init()
94 return led_classdev_register(&topstar->platform->dev, &topstar->led); in topstar_led_init()
97 static void topstar_led_exit(struct topstar_laptop *topstar) in topstar_led_exit() argument
99 led_classdev_unregister(&topstar->led); in topstar_led_exit()
136 static void topstar_input_notify(struct topstar_laptop *topstar, int event) in topstar_input_notify() argument
138 if (!sparse_keymap_report_event(topstar->input, event, 1, true)) in topstar_input_notify()
142 static int topstar_input_init(struct topstar_laptop *topstar) in topstar_input_init() argument
154 input->dev.parent = &topstar->platform->dev; in topstar_input_init()
168 topstar->input = input; in topstar_input_init()
176 static void topstar_input_exit(struct topstar_laptop *topstar) in topstar_input_exit() argument
178 input_unregister_device(topstar->input); in topstar_input_exit()
191 static int topstar_platform_init(struct topstar_laptop *topstar) in topstar_platform_init() argument
195 topstar->platform = platform_device_alloc(TOPSTAR_LAPTOP_CLASS, PLATFORM_DEVID_NONE); in topstar_platform_init()
196 if (!topstar->platform) in topstar_platform_init()
199 platform_set_drvdata(topstar->platform, topstar); in topstar_platform_init()
201 err = platform_device_add(topstar->platform); in topstar_platform_init()
208 platform_device_put(topstar->platform); in topstar_platform_init()
212 static void topstar_platform_exit(struct topstar_laptop *topstar) in topstar_platform_exit() argument
214 platform_device_unregister(topstar->platform); in topstar_platform_exit()
237 struct topstar_laptop *topstar = acpi_driver_data(device); in topstar_acpi_notify() local
251 topstar_input_notify(topstar, event); in topstar_acpi_notify()
254 static int topstar_acpi_init(struct topstar_laptop *topstar) in topstar_acpi_init() argument
256 return topstar_acpi_fncx_switch(topstar->device, true); in topstar_acpi_init()
259 static void topstar_acpi_exit(struct topstar_laptop *topstar) in topstar_acpi_exit() argument
261 topstar_acpi_fncx_switch(topstar->device, false); in topstar_acpi_exit()
290 struct topstar_laptop *topstar; in topstar_acpi_add() local
295 topstar = kzalloc(sizeof(struct topstar_laptop), GFP_KERNEL); in topstar_acpi_add()
296 if (!topstar) in topstar_acpi_add()
301 device->driver_data = topstar; in topstar_acpi_add()
302 topstar->device = device; in topstar_acpi_add()
304 err = topstar_acpi_init(topstar); in topstar_acpi_add()
308 err = topstar_platform_init(topstar); in topstar_acpi_add()
312 err = topstar_input_init(topstar); in topstar_acpi_add()
317 err = topstar_led_init(topstar); in topstar_acpi_add()
325 topstar_input_exit(topstar); in topstar_acpi_add()
327 topstar_platform_exit(topstar); in topstar_acpi_add()
329 topstar_acpi_exit(topstar); in topstar_acpi_add()
331 kfree(topstar); in topstar_acpi_add()
337 struct topstar_laptop *topstar = acpi_driver_data(device); in topstar_acpi_remove() local
340 topstar_led_exit(topstar); in topstar_acpi_remove()
342 topstar_input_exit(topstar); in topstar_acpi_remove()
343 topstar_platform_exit(topstar); in topstar_acpi_remove()
344 topstar_acpi_exit(topstar); in topstar_acpi_remove()
346 kfree(topstar); in topstar_acpi_remove()