Commit Graph

31 Commits

Author SHA1 Message Date
Tim Crawford 03a5804847 Address feedback from upstream
Changes from v1:

- Set kbled_type for old ACPI logic
- Use kbled_type instead of kb_color for conditional logic
- Set common kb_led values before conditional logic
- Do not set color for white backlit keyboards
- Do not register kb_led device if keyboard has no backlight

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-07-19 12:05:19 -06:00
Tim Crawford aaf10e3dac Handle new KBLED ACPI methods
The EC has been updated to detect if a white or RGB backlit keyboard is
attached at run-time instead of being set at compile-time. The ACPI
methods in coreboot have been updated to handle this new functionality.

Check for the new ACPI method `GKBK` "Get Keyboard Kind" to determine if
the module should use the new logic or the old logic.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-05-30 14:59:07 -06:00
Jeremy Soller ed0112437f Fix system76_remove function on older kernels 2023-03-06 12:47:22 -07:00
leviport 7635129f22
Merge pull request #20 from pop-os/linux-6.2_jammy
Update from upstream, fix build on Linux 6.2
2023-03-06 11:59:53 -07:00
Jeremy Soller 0e535fbeb9
Update from upstream, fix build on Linux 6.2 2023-03-06 07:54:11 -07:00
Haowen Bai a88dcce08b platform/x86: system76_acpi: Use dev_get_drvdata
Eliminate direct accesses to the driver_data field.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1653989063-20180-1-git-send-email-baihaowen@meizu.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-08-03 17:20:31 -06:00
Tim Crawford 04145b8cb1 Guard System76 EC specific functionality
Certain functionality or its implementation in System76 EC firmware may
be different to the proprietary ODM EC firmware. Introduce a new bool,
`has_open_ec`, to guard our specific logic. Detect the use of this by
looking for a custom ACPI method name used in System76 firmware.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-12-21 14:39:15 -07:00
Tim Crawford a02b101be8 Fix input device error handling
Managed devices do not need to be explicitly unregistered or freed, as
this is handled by devres. Drop the call to input_free_device.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-12-21 14:39:15 -07:00
Tim Crawford b49caa557e Fix error handling for input device
input_free_device only needs to be called if input_register_device
failed, not in all error cases. Per devm_input_allocate_device
documentation, managed devices do not need to be explicitly unregistered
or freed, so do not add any other cleanup for the device.

Fixes: c169971892 ("Address feedback from upstream")

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-10-29 09:03:49 -06:00
Tim Crawford b82bcba7d9 Add attribute group for kb_led_color
Create the attribute groups for kb_led_color and set the `groups` field
in kb_led. While touching it, also change its show method to use
sysfs_emit() instead of sprintf().

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-10-21 12:07:59 -06:00
Tim Crawford c169971892 Address feedback from upstream
Link: https://lore.kernel.org/platform-driver-x86/20211006202202.7479-1-tcrawford@system76.com/
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-10-21 12:07:59 -06:00
Tim Crawford 0bc966cf8e Add battery charging thresholds 2020-09-22 16:07:37 -06:00
Jeremy Soller 6a65294a42 1.0.2 2020-09-09 13:26:52 -06:00
Jeremy Soller ce499988e8 Add input interface 2020-09-09 13:26:52 -06:00
Jeremy Soller 03aca3da39 Add hwmon interface 2020-09-09 13:26:52 -06:00
Jeremy Soller 6efb1dba70 Make initramfs-tools hook executable 2020-09-09 13:26:52 -06:00
Aaron Honeycutt 54ac52e611
Merge pull request #2 from pop-os/fix-led-airplain-mode
applies a patch from Nick Shipp per email
2020-07-06 14:41:41 -06:00
Aaron Honeycutt 0f0613d941 applies a patch from Nick Shipp per email 2020-07-01 15:25:14 -06:00
Jeremy Soller d625910c7b
1.0.1 2019-10-15 14:17:19 -06:00
Jeremy Soller 5ccd561cf8
Update system76_acpi.c to match upstream patch 2019-09-26 12:01:47 -06:00
Jeremy Soller 811c09c0a8
Change package from system76-coreboot-dkms to system76-acpi-dkms 2019-08-22 11:42:18 -06:00
Jeremy Soller 97cf15549d
system76-coreboot -> system76_acpi 2019-08-22 11:26:27 -06:00
Jeremy Soller d1ec9f4cff Remove lpc implementation, use safer kernel Ec system 2019-04-24 16:25:43 -06:00
Jeremy Soller 291223ea20 Print errors 2019-04-24 16:17:49 -06:00
Jeremy Soller dd180f6508 Fix compilation of color keyboard file, add lpc command to enable camera toggle 2019-04-24 16:14:59 -06:00
Jeremy Soller 290dbc4720 Add keyboard color 2019-04-24 15:50:38 -06:00
Jeremy Soller 0ef00d922e Support for darter keyboard 2019-03-04 13:56:11 -07:00
Jeremy Soller c3cff5fad2 Remove unused input device 2019-03-01 19:29:14 -07:00
Jeremy Soller 5cd21f7a6a Add hwdb information to catch touchpad toggle 2019-03-01 19:27:59 -07:00
Jeremy Soller f18f82dfed Add input device 2019-03-01 16:41:29 -07:00
Jeremy Soller e805888165 init 2019-03-01 16:22:51 -07:00