diff options
Diffstat (limited to 'drivers/gpu/drm/arm/display/include')
-rw-r--r-- | drivers/gpu/drm/arm/display/include/malidp_io.h | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/arm/display/include/malidp_utils.h | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/arm/display/include/malidp_io.h b/drivers/gpu/drm/arm/display/include/malidp_io.h index 4fb3caf864ce..9440dff94212 100644 --- a/drivers/gpu/drm/arm/display/include/malidp_io.h +++ b/drivers/gpu/drm/arm/display/include/malidp_io.h @@ -22,6 +22,13 @@ malidp_write32(u32 __iomem *base, u32 offset, u32 v) } static inline void +malidp_write64(u32 __iomem *base, u32 offset, u64 v) +{ + writel(lower_32_bits(v), (base + (offset >> 2))); + writel(upper_32_bits(v), (base + (offset >> 2) + 1)); +} + +static inline void malidp_write32_mask(u32 __iomem *base, u32 offset, u32 m, u32 v) { u32 tmp = malidp_read32(base, offset); diff --git a/drivers/gpu/drm/arm/display/include/malidp_utils.h b/drivers/gpu/drm/arm/display/include/malidp_utils.h index 8cfd91196e15..3bc383d5bf73 100644 --- a/drivers/gpu/drm/arm/display/include/malidp_utils.h +++ b/drivers/gpu/drm/arm/display/include/malidp_utils.h @@ -8,6 +8,7 @@ #define _MALIDP_UTILS_ #include <linux/delay.h> +#include <linux/errno.h> #define has_bit(nr, mask) (BIT(nr) & (mask)) #define has_bits(bits, mask) (((bits) & (mask)) == (bits)) @@ -20,11 +21,9 @@ int num_tries = __tries; \ while (!__cond && (num_tries > 0)) { \ usleep_range(__min_range, __max_range); \ - if (__cond) \ - break; \ num_tries--; \ } \ - num_tries; \ + (__cond) ? 0 : -ETIMEDOUT; \ }) /* the restriction of range is [start, end] */ |