johnfanv2 / LenovoLegionLinux

Driver and tools for controlling Lenovo Legion laptops in Linux including fan control and power mode.
https://github.com/johnfanv2/LenovoLegionLinux
GNU General Public License v2.0
1.71k stars 59 forks source link

Lenovo IdeaPad Gaming 3 15ARH05 #44

Closed danayer closed 1 year ago

danayer commented 1 year ago

Is it possible to get support for my laptop?

Model and Debug Info

Model name: Lenovo IdeaPad Gaming 3 15ARH05

AMD Ryzen™ 7 4800H with Radeon™ Graphics × 16 NVIDIA GeForce GTX 1650 Ti / AMD Radeon™ Graphics

Output of sudo dmidecode -t system. Please remove Serial Number and UUID for privacy:

# dmidecode 3.4
Getting SMBIOS data from sysfs.
SMBIOS 3.2.0 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
    Manufacturer: LENOVO
    Product Name: 82EY
    Version: IdeaPad Gaming 3 15ARH05
    Wake-up Type: Power Switch
    SKU Number: LENOVO_MT_82EY_BU_idea_FM_IdeaPad Gaming 3 15ARH05
    Family: IdeaPad Gaming 3 15ARH05

Handle 0x0020, DMI type 12, 5 bytes
System Configuration Options
    Option 1: String1 for Type12 Equipment Manufacturer
    Option 2: String2 for Type12 Equipment Manufacturer
    Option 3: String3 for Type12 Equipment Manufacturer
    Option 4: String4 for Type12 Equipment Manufacturer

Handle 0x0030, DMI type 32, 20 bytes
System Boot Information
    Status: No errors detected

Output of sudo dmidecode -t bios:

# dmidecode 3.4
Getting SMBIOS data from sysfs.
SMBIOS 3.2.0 present.

Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
    Vendor: LENOVO
    Version: FCCN19WW
    Release Date: 05/30/2022
    Address: 0xE0000
    Runtime Size: 128 kB
    ROM Size: 15488 kB
    Characteristics:
        PCI is supported
        BIOS is upgradeable
        BIOS shadowing is allowed
        Boot from CD is supported
        Selectable boot is supported
        EDD is supported
        Japanese floppy for NEC 9800 1.2 MB is supported (int 13h)
        Japanese floppy for Toshiba 1.2 MB is supported (int 13h)
        5.25"/360 kB floppy services are supported (int 13h)
        5.25"/1.2 MB floppy services are supported (int 13h)
        3.5"/720 kB floppy services are supported (int 13h)
        3.5"/2.88 MB floppy services are supported (int 13h)
        8042 keyboard services are supported (int 9h)
        CGA/mono video services are supported (int 10h)
        ACPI is supported
        USB legacy is supported
        BIOS boot specification is supported
        Targeted content distribution is supported
        UEFI is supported
    BIOS Revision: 1.19
    Firmware Revision: 1.19

Handle 0x0021, DMI type 13, 22 bytes
BIOS Language Information
    Language Description Format: Long
    Installable Languages: 4
        en|US|iso8859-1
        fr|FR|iso8859-1
        ja|JP|unicode
        zh|TW|unicode
    Currently Installed Language: en|US|iso8859-1
johnfanv2 commented 1 year ago

@danayer Hmm. Writing works but the value is overwritten a few milliseconds later again. Please try my new version again, run ./setmyfancurve.sh instead and provide the same outputs again.

danayer commented 1 year ago
MODEL
IdeaPad Gaming 3 15ARH05
BIOS
FCCN19WW

Using hwmon directory: /sys/module/legion_laptop/drivers/platform:legion/PNP0C09:00/hwmon/hwmon5
Writing fancurve succesful!
EC Chip ID: 8227
EC Chip Version: 2a4
legion_laptop features: fancurve powermode platformprofile platformprofilenotify minifancurve
legion_laptop ec_readonly: 0
ACPI CFG error: 0
ACPI CFG: 2081289494
temperature access method: 2
CPU temperature error: 0
CPU temperature: 43
CPU temperature EC error: 0
CPU temperature EC: 39
CPU temperature ACPI error: 0
CPU temperature ACPI: 43
CPU temperature WMI error: 0
CPU temperature WMI: 0
CPU temperature WMI2 error: -14
CPU temperature WMI2: 0
GPU temperature error: 0
GPU temperature: 41
GPU temperature EC error: 0
GPU temperature EC: 46
GPU temperature ACPI error: 0
GPU temperature ACPI: 41
GPU temperature WMI error: 0
GPU temperature WMI: 0
GPU temperature WMI2 error: -14
GPU temperature WMI2: 0
fan speed access method: 3
1 fanspeed error: 0
1 fanspeed: 2500
1 fanspeed EC error: 0
1 fanspeed EC: 0
1 fanspeed ACPI error: 0
1 fanspeed ACPI: 2500
1 fanspeed WMI error: 0
1 fanspeed WMI: 2500
1 fanspeed WMI2 error: -14
1 fanspeed WMI2: 2500
2 fanspeed error: 0
2 fanspeed: 2200
2 fanspeed EC error: 0
2 fanspeed EC: 0
2 fanspeed ACPI error: 0
2 fanspeed ACPI: 2200
2 fanspeed WMI error: 0
2 fanspeed WMI: 2200
2 fanspeed WMI2 error: -14
2 fanspeed WMI2: 2200
powermode access method: 3
powermode error: 0
powermode: 3
powermode EC error: 0
powermode EC: 0
powermode ACPI error: -5
powermode ACPI: 0
powermode WMI error: 0
powermode WMI: 3
has custom powermode: 1
ACPI rapidcharge error: 0
ACPI rapidcharge: 0
WMI backlight 2 state: 0
WMI backlight 3 state: -5
EC minifancurve feature enabled: 0
EC minifancurve on cool: error
EC lockfancontroller error: 0
EC lockfancontroller: false
EC fanfullspeed error: false
EC fanfullspeed status: 0
EC fan curve current point id: 0
EC fan curve points size: 8
Current fan curve in hardware (embedded controller):
rpm1|rpm2|acceleration|deceleration|cpu_min_temp|cpu_max_temp|gpu_min_temp|gpu_max_temp|ic_min_temp|ic_max_temp
0    0   0   0   0   44  0   56  0   0
1600     1400    0   0   41  50  52  56  0   0
2600     2200    0   0   47  56  52  56  0   0
2800     2600    0   0   52  66  52  56  0   0
3100     2300    0   0   62  78  52  56  0   0
3500     2500    0   0   74  81  52  59  0   0
3900     3700    0   0   77  84  55  62  0   0
4600     4400    0   0   80  93  58  71  0   0
=====================
Writing fancurve succesful!
MODEL
IdeaPad Gaming 3 15ARH05
BIOS
FCCN19WW

dmesg.txt

johnfanv2 commented 1 year ago

There might be a way to prevent the the firmware in the embedded controller from overwriting it again with the default values. I might be disassemble it the the future but not now. So I guess setting the fan curve will not be implemented now.

Is there any other features needed by you?

There are some additional features implemented that are not in the GUI yet. They are in folder /sys/module/legion_laptop/drivers/platform\:legion/PNP0C09\:00/

ls /sys/module/legion_laptop/drivers/platform\:legion/PNP0C09\:00

aslcodeversion            gpu_ctgp2_powerlimit  leds               rapidcharge
cpu_longterm_powerlimit   gpu_ctgp_powerlimit   lockfancontroller  subsystem
cpumaxfrequency           gpu_ppab_powerlimit   modalias           thermalmode
cpu_shortterm_powerlimit  gsync                 overdrive          touchpad
driver                    hwmon                 PNP0C0A:00         uevent
driver_override           isacfitforoc          power              VPC2004:00
fan_fullspeed             issupportcpuoc        powerchargemode    winkey
firmware_node             issupportgpuoc        powermode

You can read and write to most of these files to read and set properties, e.g.

# read rapidcharge status
cat /sys/module/legion_laptop/drivers/platform\:legion/PNP0C09\:00/rapidcharge
# enable rapidcharge status (as root)
echo 1 > /sys/module/legion_laptop/drivers/platform\:legion/PNP0C09\:00/rapidcharge

If it returns an error, then it is not available for your model. Otherwise, you can test if it has an effect. You can check all these features if they might work for you model.