Lines Matching +full:powered +full:- +full:off
1 // SPDX-License-Identifier: GPL-2.0-only
9 * normal people aren't meant to understand :-)
35 bool powered; member
79 return -ENXIO; in toshiba_bluetooth_present()
84 return -ENODEV; in toshiba_bluetooth_present()
98 return -ENXIO; in toshiba_bluetooth_status()
111 return -ENXIO; in toshiba_bluetooth_enable()
117 return -ENXIO; in toshiba_bluetooth_enable()
129 pr_err("Could not power OFF Bluetooth device\n"); in toshiba_bluetooth_disable()
130 return -ENXIO; in toshiba_bluetooth_disable()
136 return -ENXIO; in toshiba_bluetooth_disable()
147 status = toshiba_bluetooth_status(bt_dev->acpi_dev->handle); in toshiba_bluetooth_sync_status()
153 bt_dev->killswitch = (status & BT_KILLSWITCH_MASK) ? true : false; in toshiba_bluetooth_sync_status()
154 bt_dev->plugged = (status & BT_PLUGGED_MASK) ? true : false; in toshiba_bluetooth_sync_status()
155 bt_dev->powered = (status & BT_POWER_MASK) ? true : false; in toshiba_bluetooth_sync_status()
157 pr_debug("Bluetooth status %d killswitch %d plugged %d powered %d\n", in toshiba_bluetooth_sync_status()
158 status, bt_dev->killswitch, bt_dev->plugged, bt_dev->powered); in toshiba_bluetooth_sync_status()
173 if (!bt_dev->killswitch) in bt_rfkill_set_block()
177 ret = toshiba_bluetooth_disable(bt_dev->acpi_dev->handle); in bt_rfkill_set_block()
179 ret = toshiba_bluetooth_enable(bt_dev->acpi_dev->handle); in bt_rfkill_set_block()
194 * the 'on' position. When flipping it to 'off', the USB device is in bt_rfkill_poll()
198 rfkill_set_hw_state(bt_dev->rfk, !bt_dev->killswitch); in bt_rfkill_poll()
214 rfkill_set_hw_state(bt_dev->rfk, !bt_dev->killswitch); in toshiba_bt_rfkill_notify()
229 rfkill_set_hw_state(bt_dev->rfk, !bt_dev->killswitch); in toshiba_bt_resume()
240 result = toshiba_bluetooth_present(device->handle); in toshiba_bt_rfkill_add()
248 return -ENOMEM; in toshiba_bt_rfkill_add()
249 bt_dev->acpi_dev = device; in toshiba_bt_rfkill_add()
250 device->driver_data = bt_dev; in toshiba_bt_rfkill_add()
251 dev_set_drvdata(&device->dev, bt_dev); in toshiba_bt_rfkill_add()
259 bt_dev->rfk = rfkill_alloc("Toshiba Bluetooth", in toshiba_bt_rfkill_add()
260 &device->dev, in toshiba_bt_rfkill_add()
264 if (!bt_dev->rfk) { in toshiba_bt_rfkill_add()
267 return -ENOMEM; in toshiba_bt_rfkill_add()
270 rfkill_set_hw_state(bt_dev->rfk, !bt_dev->killswitch); in toshiba_bt_rfkill_add()
272 result = rfkill_register(bt_dev->rfk); in toshiba_bt_rfkill_add()
275 rfkill_destroy(bt_dev->rfk); in toshiba_bt_rfkill_add()
287 if (bt_dev->rfk) { in toshiba_bt_rfkill_remove()
288 rfkill_unregister(bt_dev->rfk); in toshiba_bt_rfkill_remove()
289 rfkill_destroy(bt_dev->rfk); in toshiba_bt_rfkill_remove()
294 toshiba_bluetooth_disable(device->handle); in toshiba_bt_rfkill_remove()