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
78 return -ENXIO; in toshiba_bluetooth_present()
83 return -ENODEV; in toshiba_bluetooth_present()
97 return -ENXIO; in toshiba_bluetooth_status()
110 return -ENXIO; in toshiba_bluetooth_enable()
116 return -ENXIO; in toshiba_bluetooth_enable()
128 pr_err("Could not power OFF Bluetooth device\n"); in toshiba_bluetooth_disable()
129 return -ENXIO; in toshiba_bluetooth_disable()
135 return -ENXIO; in toshiba_bluetooth_disable()
146 status = toshiba_bluetooth_status(bt_dev->acpi_dev->handle); in toshiba_bluetooth_sync_status()
152 bt_dev->killswitch = (status & BT_KILLSWITCH_MASK) ? true : false; in toshiba_bluetooth_sync_status()
153 bt_dev->plugged = (status & BT_PLUGGED_MASK) ? true : false; in toshiba_bluetooth_sync_status()
154 bt_dev->powered = (status & BT_POWER_MASK) ? true : false; in toshiba_bluetooth_sync_status()
156 pr_debug("Bluetooth status %d killswitch %d plugged %d powered %d\n", in toshiba_bluetooth_sync_status()
157 status, bt_dev->killswitch, bt_dev->plugged, bt_dev->powered); in toshiba_bluetooth_sync_status()
172 if (!bt_dev->killswitch) in bt_rfkill_set_block()
176 ret = toshiba_bluetooth_disable(bt_dev->acpi_dev->handle); in bt_rfkill_set_block()
178 ret = toshiba_bluetooth_enable(bt_dev->acpi_dev->handle); in bt_rfkill_set_block()
193 * the 'on' position. When flipping it to 'off', the USB device is in bt_rfkill_poll()
197 rfkill_set_hw_state(bt_dev->rfk, !bt_dev->killswitch); in bt_rfkill_poll()
213 rfkill_set_hw_state(bt_dev->rfk, !bt_dev->killswitch); in toshiba_bt_rfkill_notify()
228 rfkill_set_hw_state(bt_dev->rfk, !bt_dev->killswitch); in toshiba_bt_resume()
239 result = toshiba_bluetooth_present(device->handle); in toshiba_bt_rfkill_add()
247 return -ENOMEM; in toshiba_bt_rfkill_add()
248 bt_dev->acpi_dev = device; in toshiba_bt_rfkill_add()
249 device->driver_data = bt_dev; in toshiba_bt_rfkill_add()
250 dev_set_drvdata(&device->dev, bt_dev); in toshiba_bt_rfkill_add()
258 bt_dev->rfk = rfkill_alloc("Toshiba Bluetooth", in toshiba_bt_rfkill_add()
259 &device->dev, in toshiba_bt_rfkill_add()
263 if (!bt_dev->rfk) { in toshiba_bt_rfkill_add()
266 return -ENOMEM; in toshiba_bt_rfkill_add()
269 rfkill_set_hw_state(bt_dev->rfk, !bt_dev->killswitch); in toshiba_bt_rfkill_add()
271 result = rfkill_register(bt_dev->rfk); in toshiba_bt_rfkill_add()
274 rfkill_destroy(bt_dev->rfk); in toshiba_bt_rfkill_add()
286 if (bt_dev->rfk) { in toshiba_bt_rfkill_remove()
287 rfkill_unregister(bt_dev->rfk); in toshiba_bt_rfkill_remove()
288 rfkill_destroy(bt_dev->rfk); in toshiba_bt_rfkill_remove()
293 toshiba_bluetooth_disable(device->handle); in toshiba_bt_rfkill_remove()