drm/tyr: Remove custom register struct

Now that Tyr uses the register! macro, it no longer needs to define a
custom register struct or read/write functions, so delete them.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Co-developed-by: Daniel Almeida <daniel.almeida@collabora.com>
Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Link: https://patch.msgid.link/20260409-b4-tyr-use-register-macro-v5-v5-5-8abfff8a0204@collabora.com
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
This commit is contained in:
Deborah Brouwer 2026-04-09 10:51:28 -07:00 committed by Alice Ryhl
parent bc8dd92ec6
commit 4cae5d9b3a

View File

@ -27,39 +27,6 @@
// does.
#![allow(dead_code)]
use kernel::{
device::{
Bound,
Device, //
},
devres::Devres,
io::Io,
prelude::*, //
};
use crate::driver::IoMem;
/// Represents a register in the Register Set
///
/// TODO: Replace this with the Nova `register!()` macro when it is available.
/// In particular, this will automatically give us 64bit register reads and
/// writes.
pub(crate) struct Register<const OFFSET: usize>;
impl<const OFFSET: usize> Register<OFFSET> {
#[inline]
pub(crate) fn read(&self, dev: &Device<Bound>, iomem: &Devres<IoMem>) -> Result<u32> {
let value = (*iomem).access(dev)?.read32(OFFSET);
Ok(value)
}
#[inline]
pub(crate) fn write(&self, dev: &Device<Bound>, iomem: &Devres<IoMem>, value: u32) -> Result {
(*iomem).access(dev)?.write32(value, OFFSET);
Ok(())
}
}
/// Combine two 32-bit values into a single 64-bit value.
pub(crate) fn join_u64(lo: u32, hi: u32) -> u64 {
(u64::from(lo)) | ((u64::from(hi)) << 32)