drivers/platform/x86/toshiba_acpi.c
Source file repositories/reference/linux-study-clean/drivers/platform/x86/toshiba_acpi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/x86/toshiba_acpi.c- Extension
.c- Size
- 92143 bytes
- Lines
- 3675
- Domain
- Driver Families
- Bucket
- drivers/platform
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/compiler.hlinux/dmi.hlinux/kernel.hlinux/module.hlinux/moduleparam.hlinux/init.hlinux/types.hlinux/proc_fs.hlinux/seq_file.hlinux/backlight.hlinux/input.hlinux/input/sparse-keymap.hlinux/leds.hlinux/slab.hlinux/workqueue.hlinux/i8042.hlinux/acpi.hlinux/uaccess.hlinux/miscdevice.hlinux/rfkill.hlinux/hwmon.hlinux/iio/iio.hlinux/platform_device.hlinux/toshiba.hacpi/battery.hacpi/video.h
Detected Declarations
struct toshiba_acpi_devenum toshiba_iio_accel_chanfunction _set_bitfunction write_acpi_intfunction tci_rawfunction usefulfunction hci_readfunction sci_openfunction sci_closefunction sci_readfunction sci_writefunction toshiba_illumination_availablefunction toshiba_illumination_setfunction toshiba_illumination_getfunction toshiba_kbd_illum_availablefunction toshiba_kbd_illum_status_setfunction toshiba_kbd_illum_status_getfunction toshiba_kbd_backlight_getfunction toshiba_kbd_backlight_setfunction toshiba_touchpad_setfunction toshiba_touchpad_getfunction toshiba_eco_mode_availablefunction toshiba_eco_mode_get_statusfunction toshiba_eco_mode_set_statusfunction toshiba_accelerometer_availablefunction toshiba_accelerometer_getfunction toshiba_usb_sleep_charge_availablefunction toshiba_usb_sleep_charge_getfunction toshiba_usb_sleep_charge_setfunction toshiba_sleep_functions_status_getfunction toshiba_sleep_functions_status_setfunction toshiba_usb_rapid_charge_getfunction toshiba_usb_rapid_charge_setfunction toshiba_usb_sleep_music_getfunction toshiba_usb_sleep_music_setfunction toshiba_function_keys_getfunction toshiba_function_keys_setfunction toshiba_panel_power_on_getfunction toshiba_panel_power_on_setfunction toshiba_usb_three_getfunction toshiba_usb_three_setfunction toshiba_hotkey_event_type_getfunction toshiba_wireless_statusfunction toshiba_wwan_availablefunction toshiba_wwan_setfunction toshiba_cooling_method_availablefunction toshiba_cooling_method_getfunction toshiba_cooling_method_set
Annotated Snippet
static const struct file_operations toshiba_acpi_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = toshiba_acpi_ioctl,
.llseek = noop_llseek,
};
/*
* WWAN RFKill handlers
*/
static int toshiba_acpi_wwan_set_block(void *data, bool blocked)
{
struct toshiba_acpi_dev *dev = data;
int ret;
ret = toshiba_wireless_status(dev);
if (ret)
return ret;
if (!dev->killswitch)
return 0;
return toshiba_wwan_set(dev, !blocked);
}
static void toshiba_acpi_wwan_poll(struct rfkill *rfkill, void *data)
{
struct toshiba_acpi_dev *dev = data;
if (toshiba_wireless_status(dev))
return;
rfkill_set_hw_state(dev->wwan_rfk, !dev->killswitch);
}
static const struct rfkill_ops wwan_rfk_ops = {
.set_block = toshiba_acpi_wwan_set_block,
.poll = toshiba_acpi_wwan_poll,
};
static int toshiba_acpi_setup_wwan_rfkill(struct toshiba_acpi_dev *dev)
{
int ret = toshiba_wireless_status(dev);
if (ret)
return ret;
dev->wwan_rfk = rfkill_alloc("Toshiba WWAN",
&dev->acpi_dev->dev,
RFKILL_TYPE_WWAN,
&wwan_rfk_ops,
dev);
if (!dev->wwan_rfk) {
pr_err("Unable to allocate WWAN rfkill device\n");
return -ENOMEM;
}
rfkill_set_hw_state(dev->wwan_rfk, !dev->killswitch);
ret = rfkill_register(dev->wwan_rfk);
if (ret) {
pr_err("Unable to register WWAN rfkill device\n");
rfkill_destroy(dev->wwan_rfk);
}
return ret;
}
/*
* Hotkeys
*/
static int toshiba_acpi_enable_hotkeys(struct toshiba_acpi_dev *dev)
{
acpi_status status;
u32 result;
status = acpi_evaluate_object(dev->acpi_dev->handle,
"ENAB", NULL, NULL);
if (ACPI_FAILURE(status))
return -ENODEV;
/*
* Enable quickstart buttons if supported.
*
* Enable the "Special Functions" mode only if they are
* supported and if they are activated.
*/
if (hci_hotkey_quickstart)
result = hci_write(dev, HCI_HOTKEY_EVENT,
HCI_HOTKEY_ENABLE_QUICKSTART);
else if (dev->kbd_function_keys_supported && dev->special_functions)
Annotation
- Immediate include surface: `linux/compiler.h`, `linux/dmi.h`, `linux/kernel.h`, `linux/module.h`, `linux/moduleparam.h`, `linux/init.h`, `linux/types.h`, `linux/proc_fs.h`.
- Detected declarations: `struct toshiba_acpi_dev`, `enum toshiba_iio_accel_chan`, `function _set_bit`, `function write_acpi_int`, `function tci_raw`, `function useful`, `function hci_read`, `function sci_open`, `function sci_close`, `function sci_read`.
- Atlas domain: Driver Families / drivers/platform.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.