drivers/platform/x86/panasonic-laptop.c
Source file repositories/reference/linux-study-clean/drivers/platform/x86/panasonic-laptop.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/x86/panasonic-laptop.c- Extension
.c- Size
- 30296 bytes
- Lines
- 1151
- Domain
- Driver Families
- Bucket
- drivers/platform
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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/acpi.hlinux/backlight.hlinux/bits.hlinux/ctype.hlinux/i8042.hlinux/init.hlinux/input.hlinux/input/sparse-keymap.hlinux/kernel.hlinux/module.hlinux/platform_device.hlinux/seq_file.hlinux/serio.hlinux/slab.hlinux/types.hlinux/uaccess.hacpi/video.h
Detected Declarations
struct pcc_acpienum SINF_BITSfunction panasonic_i8042_filterfunction acpi_pcc_write_ssetfunction acpi_pcc_get_sqtyfunction acpi_pcc_retrieve_biosdatafunction bl_getfunction bl_set_statusfunction check_optd_presentfunction get_optd_power_statefunction set_optd_power_statefunction numbatt_showfunction lcdtype_showfunction mute_showfunction mute_storefunction sticky_key_showfunction sticky_key_storefunction eco_mode_showfunction eco_mode_storefunction ac_brightness_showfunction ac_brightness_storefunction dc_brightness_showfunction dc_brightness_storefunction current_brightness_showfunction current_brightness_storefunction cdpower_showfunction cdpower_storefunction pcc_sysfs_is_visiblefunction acpi_pcc_generate_keyinputfunction acpi_pcc_hotkey_notifyfunction pcc_optd_notifyfunction pcc_register_optd_notifierfunction pcc_unregister_optd_notifierfunction acpi_pcc_init_inputfunction acpi_pcc_hotkey_resumefunction acpi_pcc_hotkey_probefunction acpi_pcc_hotkey_remove
Annotated Snippet
struct pcc_acpi {
acpi_handle handle;
unsigned long num_sifr;
int sticky_key;
int eco_mode;
int mute;
int ac_brightness;
int dc_brightness;
int current_brightness;
u32 *sinf;
struct acpi_device *device;
struct input_dev *input_dev;
struct backlight_device *backlight;
struct platform_device *platform;
};
/*
* On some Panasonic models the volume up / down / mute keys send duplicate
* keypress events over the PS/2 kbd interface, filter these out.
*/
static bool panasonic_i8042_filter(unsigned char data, unsigned char str,
struct serio *port, void *context)
{
static bool extended;
if (str & I8042_STR_AUXDATA)
return false;
if (data == 0xe0) {
extended = true;
return true;
} else if (extended) {
extended = false;
switch (data & 0x7f) {
case 0x20: /* e0 20 / e0 a0, Volume Mute press / release */
case 0x2e: /* e0 2e / e0 ae, Volume Down press / release */
case 0x30: /* e0 30 / e0 b0, Volume Up press / release */
return true;
default:
/*
* Report the previously filtered e0 before continuing
* with the next non-filtered byte.
*/
serio_interrupt(port, 0xe0, 0);
return false;
}
}
return false;
}
/* method access functions */
static int acpi_pcc_write_sset(struct pcc_acpi *pcc, int func, int val)
{
union acpi_object in_objs[] = {
{ .integer.type = ACPI_TYPE_INTEGER,
.integer.value = func, },
{ .integer.type = ACPI_TYPE_INTEGER,
.integer.value = val, },
};
struct acpi_object_list params = {
.count = ARRAY_SIZE(in_objs),
.pointer = in_objs,
};
acpi_status status = AE_OK;
status = acpi_evaluate_object(pcc->handle, METHOD_HKEY_SSET,
¶ms, NULL);
return (status == AE_OK) ? 0 : -EIO;
}
static inline int acpi_pcc_get_sqty(struct acpi_device *device)
{
unsigned long long s;
acpi_status status;
status = acpi_evaluate_integer(device->handle, METHOD_HKEY_SQTY,
NULL, &s);
if (ACPI_SUCCESS(status))
return s;
else {
pr_err("evaluation error HKEY.SQTY\n");
return -EINVAL;
}
}
static int acpi_pcc_retrieve_biosdata(struct pcc_acpi *pcc)
{
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/backlight.h`, `linux/bits.h`, `linux/ctype.h`, `linux/i8042.h`, `linux/init.h`, `linux/input.h`, `linux/input/sparse-keymap.h`.
- Detected declarations: `struct pcc_acpi`, `enum SINF_BITS`, `function panasonic_i8042_filter`, `function acpi_pcc_write_sset`, `function acpi_pcc_get_sqty`, `function acpi_pcc_retrieve_biosdata`, `function bl_get`, `function bl_set_status`, `function check_optd_present`, `function get_optd_power_state`.
- Atlas domain: Driver Families / drivers/platform.
- Implementation status: source implementation candidate.
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.