app-admin/ryzen_smu: Add support for kernel 7.2

Signed-off-by: Patrick Lauer <patrick@gentoo.org>
This commit is contained in:
Patrick Lauer
2026-08-23 06:01:08 +00:00
parent 22fa95693d
commit 2fc73c2a8e
2 changed files with 64 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
From d2983668300dd2a598e5a7dc40e71ce0678cc270 Mon Sep 17 00:00:00 2001
From: Kyle Gospodnetich <me@kylegospodneti.ch>
Date: Sat, 15 Aug 2026 10:43:41 -0700
Subject: [PATCH] Fix cpuid include on 7.2+ kernels (#53)
---
smu.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/smu.c b/smu.c
index 3636bb6..e6bf768 100755
--- a/smu.c
+++ b/smu.c
@@ -8,6 +8,18 @@
#include <linux/pci.h>
#include <linux/time.h>
+#ifdef __has_include
+#if __has_include(<asm/cpuid/api.h>)
+#include <asm/cpuid/api.h>
+#elif __has_include(<asm/cpuid.h>)
+#include <asm/cpuid.h>
+#else
+#include <asm/processor.h>
+#endif
+#else
+#include <asm/processor.h>
+#endif
+
#include "smu.h"
static struct {

View File

@@ -0,0 +1,32 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit linux-mod-r1
DESCRIPTION="Kernel driver for AMD Ryzen's System Management Unit"
HOMEPAGE="https://gitlab.com/leogx9r/ryzen_smu"
SRC_URI="https://gitlab.com/leogx9r/${PN}/-/archive/v${PV}/${PN}-v${PV}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
S="${WORKDIR}/${PN}-v${PV}"
PATCHES=( "${FILESDIR}/ryzen_smu-kernel7.2.patch" )
src_compile() {
local modlist=( ryzen_smu )
local modargs=( KERNEL_BUILD="${KV_OUT_DIR}" )
linux-mod-r1_src_compile
}
src_install() {
linux-mod-r1_src_install
insinto /usr/lib/modules-load.d
doins "${FILESDIR}"/ryzen_smu.conf
}