drivers/platform/x86/samsung-galaxybook.c
Source file repositories/reference/linux-study-clean/drivers/platform/x86/samsung-galaxybook.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/x86/samsung-galaxybook.c- Extension
.c- Size
- 40686 bytes
- Lines
- 1457
- 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/bits.hlinux/err.hlinux/i8042.hlinux/init.hlinux/input.hlinux/kernel.hlinux/leds.hlinux/module.hlinux/mutex.hlinux/platform_device.hlinux/platform_profile.hlinux/serio.hlinux/sysfs.hlinux/uuid.hlinux/workqueue.hacpi/battery.hfirmware_attributes_class.h
Detected Declarations
struct samsung_galaxybookstruct galaxybook_fw_attrstruct sawbenum galaxybook_fw_attr_idfunction galaxybook_acpi_methodfunction galaxybook_enable_acpi_featurefunction kbd_backlight_acpi_getfunction kbd_backlight_acpi_setfunction kbd_backlight_showfunction kbd_backlight_storefunction galaxybook_kbd_backlight_initfunction Extensionfunction charge_control_end_threshold_acpi_setfunction galaxybook_battery_ext_property_getfunction galaxybook_battery_ext_property_setfunction galaxybook_battery_ext_property_is_writeablefunction galaxybook_battery_addfunction galaxybook_battery_removefunction galaxybook_battery_threshold_initfunction performance_mode_acpi_getfunction performance_mode_acpi_setfunction get_performance_mode_profilefunction galaxybook_platform_profile_getfunction galaxybook_platform_profile_setfunction galaxybook_platform_profile_probefunction galaxybook_platform_profile_initfunction power_on_lid_open_acpi_getfunction power_on_lid_open_acpi_setfunction usb_charging_acpi_getfunction usb_charging_acpi_setfunction block_recording_acpi_getfunction block_recording_acpi_setfunction galaxybook_input_initfunction galaxybook_block_recording_initfunction type_showfunction default_value_showfunction possible_values_showfunction display_name_language_code_showfunction display_name_showfunction current_value_showfunction current_value_storefunction galaxybook_fw_attr_initfunction galaxybook_kset_unregisterfunction galaxybook_fw_attrs_dev_unregisterfunction galaxybook_fw_attrs_initfunction galaxybook_kbd_backlight_hotkey_workfunction galaxybook_block_recording_hotkey_workfunction galaxybook_i8042_filter
Annotated Snippet
struct samsung_galaxybook {
struct platform_device *platform;
struct acpi_device *acpi;
struct device *fw_attrs_dev;
struct kset *fw_attrs_kset;
/* block in case firmware attributes are updated in multiple threads */
struct mutex fw_attr_lock;
bool has_kbd_backlight;
bool has_block_recording;
bool has_performance_mode;
struct led_classdev kbd_backlight;
struct work_struct kbd_backlight_hotkey_work;
/* block in case brightness updated using hotkey and another thread */
struct mutex kbd_backlight_lock;
void *i8042_filter_ptr;
struct work_struct block_recording_hotkey_work;
struct input_dev *input;
struct acpi_battery_hook battery_hook;
u8 profile_performance_modes[PLATFORM_PROFILE_LAST];
};
enum galaxybook_fw_attr_id {
GB_ATTR_POWER_ON_LID_OPEN,
GB_ATTR_USB_CHARGING,
GB_ATTR_BLOCK_RECORDING,
};
static const char * const galaxybook_fw_attr_name[] = {
[GB_ATTR_POWER_ON_LID_OPEN] = "power_on_lid_open",
[GB_ATTR_USB_CHARGING] = "usb_charging",
[GB_ATTR_BLOCK_RECORDING] = "block_recording",
};
static const char * const galaxybook_fw_attr_desc[] = {
[GB_ATTR_POWER_ON_LID_OPEN] = "Power On Lid Open",
[GB_ATTR_USB_CHARGING] = "USB Charging",
[GB_ATTR_BLOCK_RECORDING] = "Block Recording",
};
#define GB_ATTR_LANGUAGE_CODE "en_US.UTF-8"
struct galaxybook_fw_attr {
struct samsung_galaxybook *galaxybook;
enum galaxybook_fw_attr_id fw_attr_id;
struct attribute_group attr_group;
struct kobj_attribute display_name;
struct kobj_attribute current_value;
int (*get_value)(struct samsung_galaxybook *galaxybook, bool *value);
int (*set_value)(struct samsung_galaxybook *galaxybook, const bool value);
};
struct sawb {
u16 safn;
u16 sasb;
u8 rflg;
union {
struct {
u8 gunm;
u8 guds[250];
} __packed;
struct {
u8 caid[16];
u8 fncn;
u8 subn;
u8 iob0;
u8 iob1;
u8 iob2;
u8 iob3;
u8 iob4;
u8 iob5;
u8 iob6;
u8 iob7;
u8 iob8;
u8 iob9;
} __packed;
struct {
u8 iob_prefix[18];
u8 iobs[10];
} __packed;
} __packed;
} __packed;
#define GB_SAWB_LEN_SETTINGS 0x15
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/bits.h`, `linux/err.h`, `linux/i8042.h`, `linux/init.h`, `linux/input.h`, `linux/kernel.h`, `linux/leds.h`.
- Detected declarations: `struct samsung_galaxybook`, `struct galaxybook_fw_attr`, `struct sawb`, `enum galaxybook_fw_attr_id`, `function galaxybook_acpi_method`, `function galaxybook_enable_acpi_feature`, `function kbd_backlight_acpi_get`, `function kbd_backlight_acpi_set`, `function kbd_backlight_show`, `function kbd_backlight_store`.
- 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.