Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed driver module for kernel 6.2+ #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/faustus.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,11 @@ static ssize_t charge_control_end_threshold_show(struct device *device,

static DEVICE_ATTR_RW(charge_control_end_threshold);

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,2,0)
static int asus_wmi_battery_add(struct power_supply *battery, struct acpi_battery_hook *hook)
#else
static int asus_wmi_battery_add(struct power_supply *battery)
#endif
{
/* The WMI method does not provide a way to specific a battery, so we
* just assume it is the first battery.
Expand All @@ -557,7 +561,11 @@ static int asus_wmi_battery_add(struct power_supply *battery)
return 0;
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,2,0)
static int asus_wmi_battery_remove(struct power_supply *battery, struct acpi_battery_hook *hook)
#else
static int asus_wmi_battery_remove(struct power_supply *battery)
#endif
{
device_remove_file(&battery->dev,
&dev_attr_charge_control_end_threshold);
Expand Down Expand Up @@ -3311,7 +3319,9 @@ static struct asus_wmi_driver asus_nb_wmi_driver = {
static int asus_wmi_add(struct platform_device *pdev)
{
struct asus_wmi *asus;
#if LINUX_VERSION_CODE < KERNEL_VERSION(6,1,1)
const char *chassis_type;
#endif
acpi_status status;
int err;
u32 result;
Expand Down Expand Up @@ -3377,6 +3387,7 @@ static int asus_wmi_add(struct platform_device *pdev)

/* Some Asus desktop boards export an acpi-video backlight interface,
stop this from showing up */
#if LINUX_VERSION_CODE < KERNEL_VERSION(6,1,1)
chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);
if (chassis_type && !strcmp(chassis_type, "3"))
acpi_video_set_dmi_backlight_type(acpi_backlight_vendor);
Expand All @@ -3386,6 +3397,7 @@ static int asus_wmi_add(struct platform_device *pdev)

if (asus->driver->quirks->wmi_backlight_native)
acpi_video_set_dmi_backlight_type(acpi_backlight_native);
#endif

if (asus->driver->quirks->xusb2pr)
asus_wmi_set_xusb2pr(asus);
Expand Down