Samsung Galaxy Book DriverÂķ
Joshua Grisham <josh@joshuagrisham.com>
This is a Linux x86 platform driver for Samsung Galaxy Book series notebook
devices which utilizes Samsungâs SCAI ACPI device in order to control
extra features and receive various notifications.
Supported devicesÂķ
Any device with one of the supported ACPI device IDs should be supported. This covers most of the âSamsung Galaxy Bookâ series notebooks that are currently available as of this writing, and could include other Samsung notebook devices as well.
StatusÂķ
The following features are currently supported:
Keyboard backlight control
Performance mode control implemented using the platform profile interface
Battery charge control end threshold (stop charging battery at given percentage value) implemented as a battery hook
Firmware Attributes to allow control of various device settings
Handling of Fn hotkeys for various actions
Because different models of these devices can vary in their features, there is logic built within the driver which attempts to test each implemented feature for a valid response before enabling its support (registering additional devices or extensions, adding sysfs attributes, etc). Therefore, it can be important to note that not all features may be supported for your particular device.
The following features might be possible to implement but will require additional investigation and are therefore not supported at this time:
âDolby Atmosâ mode for the speakers
âOutdoor Modeâ for increasing screen brightness on models with
SAM0427âSilent Modeâ on models with
SAM0427
Keyboard backlightÂķ
A new LED class named samsung-galaxybook::kbd_backlight is created which
will then expose the device using the standard sysfs-based LED interface at
/sys/class/leds/samsung-galaxybook::kbd_backlight. Brightness can be
controlled by writing the desired value to the brightness sysfs attribute or
with any other desired userspace utility.
Note
Most of these devices have an ambient light sensor which also turns off the keyboard backlight under well-lit conditions. This behavior does not seem possible to control at this time, but can be good to be aware of.
Performance modeÂķ
This driver implements the Platform Profile Selection (e.g. /sys/firmware/acpi/platform_profile) interface for working with the âperformance modeâ function of the Samsung ACPI device.
Mapping of each Samsung âperformance modeâ to its respective platform profile is performed dynamically by the driver, as not all models support all of the same performance modes. Your device might have one or more of the following mappings:
âSilentâ maps to
low-powerâQuietâ maps to
quietâOptimizedâ maps to
balancedâHigh performanceâ maps to
performance
The result of the mapping can be printed in the kernel log when the module is
loaded. Supported profiles can also be retrieved from
/sys/firmware/acpi/platform_profile_choices, while
/sys/firmware/acpi/platform_profile can be used to read or write the
currently selected profile.
The balanced platform profile will be set during module load if no profile
has been previously set.
Battery charge control end thresholdÂķ
This platform driver will add the ability to set the batteryâs charge control end threshold, but does not have the ability to set a start threshold.
This feature is typically called âBattery Saverâ by the various Samsung applications in Windows, but in Linux we have implemented the standardized âcharge control thresholdâ sysfs interface on the battery device to allow for controlling this functionality from the userspace.
The sysfs attribute
/sys/class/power_supply/BAT1/charge_control_end_threshold can be used to
read or set the desired charge end threshold.
If you wish to maintain interoperability with the Samsung Settings application in Windows, then you should set the value to 100 to represent âoffâ, or enable the feature using only one of the following values: 50, 60, 70, 80, or 90. Otherwise, the driver will accept any value between 1 and 100 as the percentage that you wish the battery to stop charging at.
Note
Some devices have been observed as automatically âturning offâ the charge control end threshold if an input value of less than 30 is given.
Firmware AttributesÂķ
The following enumeration-typed firmware attributes are set up by this driver
and should be accessible under
/sys/class/firmware-attributes/samsung-galaxybook/attributes/ if your device
supports them:
power_on_lid_open(device should power on when the lid is opened)usb_charging(USB ports can deliver power to connected devices even when the device is powered off or in a low sleep state)block_recording(blocks access to camera and microphone)
All of these attributes are simple boolean-like enumeration values which use 0
to represent âoffâ and 1 to represent âonâ. Use the current_value attribute
to get or change the setting on the device.
Note that when block_recording is updated, the input device âSamsung Galaxy
Book Lens Coverâ will receive a SW_CAMERA_LENS_COVER switch event which
reflects the current state.
Keyboard hotkey actions (i8042 filter)Âķ
The i8042 filter will swallow the keyboard events for the Fn+F9 hotkey (Multi- level keyboard backlight toggle) and Fn+F10 hotkey (Block recording toggle) and instead execute their actions within the driver itself.
Fn+F9 will cycle through the brightness levels of the keyboard backlight. A
notification will be sent using led_classdev_notify_brightness_hw_changed
so that the userspace can be aware of the change. This mimics the behavior of
other existing devices where the brightness level is cycled internally by the
embedded controller and then reported via a notification.
Fn+F10 will toggle the value of the âblock recordingâ setting, which blocks or allows usage of the built-in camera and microphone (and generates the same Lens Cover switch event mentioned above).
ACPI notifications and hotkey actionsÂķ
ACPI notifications will generate ACPI netlink events under the device class
samsung-galaxybook and bus ID matching the Samsung ACPI device ID found on
your device. The events can be received using userspace tools such as
acpi_listen and acpid.
The Fn+F11 Performance mode hotkey will be handled by the driver; each keypress will cycle to the next available platform profile.