Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /* Helper functions for Thinkpad LED control;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  * to be included from codec driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) #if IS_ENABLED(CONFIG_THINKPAD_ACPI)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) #include <linux/acpi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) #include <linux/leds.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) static bool is_thinkpad(struct hda_codec *codec)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 	return (codec->core.subsystem_id >> 16 == 0x17aa) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) 	       (acpi_dev_found("LEN0068") || acpi_dev_found("LEN0268") ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) 		acpi_dev_found("IBM0068"));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) static void hda_fixup_thinkpad_acpi(struct hda_codec *codec,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) 				    const struct hda_fixup *fix, int action)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 	if (action == HDA_FIXUP_ACT_PROBE) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 		if (!is_thinkpad(codec))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 			return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 		snd_hda_gen_add_mute_led_cdev(codec, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 		snd_hda_gen_add_micmute_led_cdev(codec, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #else /* CONFIG_THINKPAD_ACPI */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) static void hda_fixup_thinkpad_acpi(struct hda_codec *codec,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 				    const struct hda_fixup *fix, int action)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #endif /* CONFIG_THINKPAD_ACPI */