User:Rustmilian/subpage

From ArchWiki

This page describes the process to with one can create a Kernel patch for HP Laptop LED issues.

Comment: It's possible to expand this to other devices, consider expanding scope; see FIXUP_Enum_Table

Installation

Install the alsa-tools and alsa-utils package.

You can also use the hw-probeAUR instead of alsa-utils.

Gathering the necessary info

Note: HP Laptop 14-fq0xxx used in this example

The command below will help identify the codec of your sound card, needed for choosing the correct FIXUP enum.

$ grep Codec /proc/asound/card*/codec*

Example output :

/proc/asound/card0/codec#0:Codec: ATI R6xx HDMI
/proc/asound/card1/codec#0:Codec: Realtek ALC236

As you see in the example output the Codec is ALC236; see FIXUP_Enum_Table

This article or section needs expansion.

Reason: Add hda-verb, alsa-info.sh/hw-probe instructions; should probably link them (Discuss in User talk:Rustmilian/subpage)

Brute Force Script

This article or section needs expansion.

Reason: Add Brute Force Script details & look into possibly improving it. (Discuss in User talk:Rustmilian/subpage)
#!/bin/bash

read -p "What's your sound card? Form /dev/snd/hwCxDx": card

echo "Testing GPIO pins, polarity 0"
for i in 0x01 0x02 0x04 0x08 0x10 0x20 0x40;
do
 sudo hda-verb $card 0x01 0x716 $i
 sudo hda-verb $card 0x01 0x717 $i
 sudo hda-verb $card 0x01 0x715 $i
 sleep 0.2
done
echo "Testing GPIO pins, polarity 1"
for i in 0x01 0x02 0x04 0x08 0x10 0x20 0x40;
do
 sudo hda-verb $card 0x01 0x716 $i

FIXUP Enum Table

Comment: FIXUP Enum Table Will likely be very large if everything is added,

should probably keep it at the bottom and maybe limit size?
Keep it only for example purposes and not a complete list?

Else may need regular updating, consider linking to the Kernel Repo instead

In The Below table are the possible FIXUP enum options for each codec.

This article or section needs expansion.

Reason: The below table needs expansion (Discuss in User talk:Rustmilian/subpage)
Comment: Should probably only list HP related info to stay in scope.

If scope is expanded beyond HP, consider vendor specific tables,

The below table is designed with this possibility in mind.
HP
Codec FIXUP Enum
ALC236

ALC236_FIXUP_HP_MUTE_LED_COEFBIT2
ALC236_FIXUP_HP_GPIO_LED
ALC236_FIXUP_HP_MUTE_LED
ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF

ALC285

ALC285_FIXUP_HP_GPIO_LED
ALC285_FIXUP_HP_MUTE_LED
ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED

ALC269

ALC269_FIXUP_HP_MUTE_LED
ALC269_FIXUP_HP_MUTE_LED_MIC1
ALC269_FIXUP_HP_MUTE_LED_MIC2
ALC269_FIXUP_HP_MUTE_LED_MIC3
ALC269_FIXUP_HP_GPIO_LED
ALC269_FIXUP_HP_GPIO_MIC1_LED
ALC269_FIXUP_HP_LINE1_MIC1_LED
ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED