Message ID | 20250217231747.1656228-2-superm1@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Commit | c893ee3f95f16fcb98da934d61483d0b7d8ed568 |
Headers | show |
Series | Adjust all AMD audio drivers to use AMD_NODE | expand |
diff --git a/arch/x86/include/asm/amd_node.h b/arch/x86/include/asm/amd_node.h index 113ad3e8ee40a..9f3f613366f7d 100644 --- a/arch/x86/include/asm/amd_node.h +++ b/arch/x86/include/asm/amd_node.h @@ -33,4 +33,15 @@ static inline u16 amd_num_nodes(void) int __must_check amd_smn_read(u16 node, u32 address, u32 *value); int __must_check amd_smn_write(u16 node, u32 address, u32 value); +/* helper for use with read_poll_timeout */ +static inline int smn_read_register(u32 reg) +{ + int data, rc; + + rc = amd_smn_read(0, reg, &data); + if (rc) + return rc; + + return data; +} #endif /*_ASM_X86_AMD_NODE_H_*/