Esempio n. 1
0
static int bluetooth_close(snd_pcm_ioplug_t *io)
{
	struct bluetooth_data *data = io->private_data;

	DBG("%p", io);

	bluetooth_exit(data);

	return 0;
}
static void __exit lenovo_sl_laptop_exit(void)
{
	lenovo_sl_procfs_exit();
	hwmon_exit();
	hkey_poll_stop();
	led_exit();
	backlight_exit();
	bluetooth_exit();
	hkey_inputdev_exit();
	if (lensl_pdev)
		platform_device_unregister(lensl_pdev);
	destroy_workqueue(lensl_wq);
	vdbg_printk(LENSL_INFO, "Unloaded Lenovo ThinkPad SL Series driver\n");
}
static int bluetooth_init(void)
{
	int value, res;
	bluetooth_present = 0;
	if (!hkey_handle)
		return -ENODEV;
	if (get_gbdc(&value))
		return -EIO;
	if (!(value & TP_ACPI_BLUETOOTH_HWPRESENT))
		return -ENODEV;
	bluetooth_present = 1;

	res = sysfs_create_group(&lensl_pdev->dev.kobj,
				&bluetooth_attr_group);
	if (res) {
		vdbg_printk(LENSL_ERR,
			"Failed to register bluetooth sysfs group\n");
		return res;
	}

	bluetooth_pretend_blocked = !bluetooth_auto_enable;
	res = lensl_new_rfkill(LENSL_RFK_BLUETOOTH_SW_ID,
				&bluetooth_rfkill,
				RFKILL_TYPE_BLUETOOTH,
				"lensl_bluetooth_sw",
				bluetooth_rfk_set,
				bluetooth_rfk_get);
	bluetooth_pretend_blocked = 0;
	if (res) {
		bluetooth_exit();
		return res;
	}
	vdbg_printk(LENSL_DEBUG, "Initialized bluetooth subdriver\n");

	return 0;
}