mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
coresight: Simplify sysfs accessors by using csdev_access abstraction
The coresight_device struct is available in the sysfs accessor, and this contains a csdev_access struct which can be used to access registers. Use this instead of passing in the type of each drvdata so that a common function can be shared between all the cs drivers. No functional changes. Signed-off-by: James Clark <james.clark@arm.com> Reviewed-by: Mike Leach <mike.leach@linaro.org> Link: https://lore.kernel.org/r/20220830172614.340962-3-james.clark@arm.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
This commit is contained in:
committed by
Mathieu Poirier
parent
3727f03e2b
commit
b6df1cbb41
@@ -372,6 +372,24 @@ static inline u32 csdev_access_relaxed_read32(struct csdev_access *csa,
|
||||
return csa->read(offset, true, false);
|
||||
}
|
||||
|
||||
static inline u64 csdev_access_relaxed_read_pair(struct csdev_access *csa,
|
||||
s32 lo_offset, s32 hi_offset)
|
||||
{
|
||||
u64 val;
|
||||
|
||||
if (likely(csa->io_mem)) {
|
||||
val = readl_relaxed(csa->base + lo_offset);
|
||||
val |= (hi_offset < 0) ? 0 :
|
||||
(u64)readl_relaxed(csa->base + hi_offset) << 32;
|
||||
return val;
|
||||
}
|
||||
|
||||
val = csa->read(lo_offset, true, false);
|
||||
val |= (hi_offset < 0) ? 0 :
|
||||
(u64)csa->read(hi_offset, true, false) << 32;
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline u32 csdev_access_read32(struct csdev_access *csa, u32 offset)
|
||||
{
|
||||
if (likely(csa->io_mem))
|
||||
|
||||
Reference in New Issue
Block a user