summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx18/cx18-io.h
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/cx18/cx18-io.h')
-rw-r--r--linux/drivers/media/video/cx18/cx18-io.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-io.h b/linux/drivers/media/video/cx18/cx18-io.h
index 287a5e8bf..cb695a596 100644
--- a/linux/drivers/media/video/cx18/cx18-io.h
+++ b/linux/drivers/media/video/cx18/cx18-io.h
@@ -41,8 +41,8 @@ static inline void cx18_io_delay(struct cx18 *cx)
static inline
void cx18_log_write_retries(struct cx18 *cx, int i, const void __iomem *addr)
{
- if (i > CX18_MAX_MMIO_RETRIES)
- i = CX18_MAX_MMIO_RETRIES;
+ if (i > CX18_MAX_MMIO_WR_RETRIES)
+ i = CX18_MAX_MMIO_WR_RETRIES;
atomic_inc(&cx->mmio_stats.retried_write[i]);
return;
}
@@ -50,8 +50,8 @@ void cx18_log_write_retries(struct cx18 *cx, int i, const void __iomem *addr)
static inline
void cx18_log_read_retries(struct cx18 *cx, int i, const void __iomem *addr)
{
- if (i > CX18_MAX_MMIO_RETRIES)
- i = CX18_MAX_MMIO_RETRIES;
+ if (i > CX18_MAX_MMIO_RD_RETRIES)
+ i = CX18_MAX_MMIO_RD_RETRIES;
atomic_inc(&cx->mmio_stats.retried_read[i]);
return;
}
@@ -133,6 +133,8 @@ static inline void cx18_writel(struct cx18 *cx, u32 val, void __iomem *addr)
cx18_writel_noretry(cx, val, addr);
}
+void _cx18_writel_expect(struct cx18 *cx, u32 val, void __iomem *addr,
+ u32 eval, u32 mask);
static inline
void cx18_writew_noretry(struct cx18 *cx, u16 val, void __iomem *addr)
@@ -271,6 +273,21 @@ static inline void cx18_write_reg(struct cx18 *cx, u32 val, u32 reg)
cx18_write_reg_noretry(cx, val, reg);
}
+static inline void _cx18_write_reg_expect(struct cx18 *cx, u32 val, u32 reg,
+ u32 eval, u32 mask)
+{
+ _cx18_writel_expect(cx, val, cx->reg_mem + reg, eval, mask);
+}
+
+static inline void cx18_write_reg_expect(struct cx18 *cx, u32 val, u32 reg,
+ u32 eval, u32 mask)
+{
+ if (cx18_retry_mmio)
+ _cx18_write_reg_expect(cx, val, reg, eval, mask);
+ else
+ cx18_write_reg_noretry(cx, val, reg);
+}
+
static inline u32 cx18_read_reg_noretry(struct cx18 *cx, u32 reg)
{