media: v4l2-cci: Add support for little-endian encoded registers
[linux-2.6-microblaze.git] / include / media / v4l2-cci.h
index 406772a..4e96e90 100644 (file)
@@ -43,12 +43,17 @@ struct cci_reg_sequence {
 #define CCI_REG_WIDTH_BYTES(x)         FIELD_GET(CCI_REG_WIDTH_MASK, x)
 #define CCI_REG_WIDTH(x)               (CCI_REG_WIDTH_BYTES(x) << 3)
 #define CCI_REG_ADDR(x)                        FIELD_GET(CCI_REG_ADDR_MASK, x)
+#define CCI_REG_LE                     BIT(20)
 
 #define CCI_REG8(x)                    ((1 << CCI_REG_WIDTH_SHIFT) | (x))
 #define CCI_REG16(x)                   ((2 << CCI_REG_WIDTH_SHIFT) | (x))
 #define CCI_REG24(x)                   ((3 << CCI_REG_WIDTH_SHIFT) | (x))
 #define CCI_REG32(x)                   ((4 << CCI_REG_WIDTH_SHIFT) | (x))
 #define CCI_REG64(x)                   ((8 << CCI_REG_WIDTH_SHIFT) | (x))
+#define CCI_REG16_LE(x)                        (CCI_REG_LE | (2U << CCI_REG_WIDTH_SHIFT) | (x))
+#define CCI_REG24_LE(x)                        (CCI_REG_LE | (3U << CCI_REG_WIDTH_SHIFT) | (x))
+#define CCI_REG32_LE(x)                        (CCI_REG_LE | (4U << CCI_REG_WIDTH_SHIFT) | (x))
+#define CCI_REG64_LE(x)                        (CCI_REG_LE | (8U << CCI_REG_WIDTH_SHIFT) | (x))
 
 /**
  * cci_read() - Read a value from a single CCI register