mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-19 07:49:02 -05:00
gpu: nova-core: register: add missing doccomments for fixed registers I/O accessors
Add the missing doccomments for these accessors, as having a bit of inline documentation is always helpful. Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Link: https://lore.kernel.org/r/20250718-nova-regs-v2-9-7b6a762aa1cd@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
This commit is contained in:
@@ -300,6 +300,7 @@ pub(crate) fn [<set_ $field>](mut self, value: $to_type) -> Self {
|
||||
impl $name {
|
||||
pub(crate) const OFFSET: usize = $offset;
|
||||
|
||||
/// Read the register from its address in `io`.
|
||||
#[inline]
|
||||
pub(crate) fn read<const SIZE: usize, T>(io: &T) -> Self where
|
||||
T: ::core::ops::Deref<Target = ::kernel::io::Io<SIZE>>,
|
||||
@@ -307,6 +308,7 @@ pub(crate) fn read<const SIZE: usize, T>(io: &T) -> Self where
|
||||
Self(io.read32($offset))
|
||||
}
|
||||
|
||||
/// Write the value contained in `self` to the register address in `io`.
|
||||
#[inline]
|
||||
pub(crate) fn write<const SIZE: usize, T>(self, io: &T) where
|
||||
T: ::core::ops::Deref<Target = ::kernel::io::Io<SIZE>>,
|
||||
@@ -314,6 +316,8 @@ pub(crate) fn write<const SIZE: usize, T>(self, io: &T) where
|
||||
io.write32(self.0, $offset)
|
||||
}
|
||||
|
||||
/// Read the register from its address in `io` and run `f` on its value to obtain a new
|
||||
/// value to write back.
|
||||
#[inline]
|
||||
pub(crate) fn alter<const SIZE: usize, T, F>(
|
||||
io: &T,
|
||||
|
||||
Reference in New Issue
Block a user