Lines Matching refs:topstar

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