]> git.baikalelectronics.ru Git - kernel.git/commitdiff
media: i2c: video-i2c: Move defines to the top of the file
authorMoses Christopher Bollavarapu <mosescb.dev@gmail.com>
Tue, 19 Apr 2022 20:20:49 +0000 (22:20 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Tue, 17 May 2022 07:16:08 +0000 (09:16 +0200)
Currently, the defines in this driver are after some structs and
functions, it makes more sense to move them up to the top of the file,
so that the constants can be named together with other defines.

Signed-off-by: Moses Christopher Bollavarapu <mosescb.dev@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/i2c/video-i2c.c

index cb660b4bfd4badacd862b78d596975217496e8f6..b3fe9a507f7f438793d2746d96ab3d00c4ccad0e 100644 (file)
 
 #define VIDEO_I2C_DRIVER       "video-i2c"
 
+/* Power control register */
+#define AMG88XX_REG_PCTL       0x00
+#define AMG88XX_PCTL_NORMAL            0x00
+#define AMG88XX_PCTL_SLEEP             0x10
+
+/* Reset register */
+#define AMG88XX_REG_RST                0x01
+#define AMG88XX_RST_FLAG               0x30
+#define AMG88XX_RST_INIT               0x3f
+
+/* Frame rate register */
+#define AMG88XX_REG_FPSC       0x02
+#define AMG88XX_FPSC_1FPS              BIT(0)
+
+/* Thermistor register */
+#define AMG88XX_REG_TTHL       0x0e
+
+/* Temperature register */
+#define AMG88XX_REG_T01L       0x80
+
+/* Control register */
+#define MLX90640_REG_CTL1              0x800d
+#define MLX90640_REG_CTL1_MASK         0x0380
+#define MLX90640_REG_CTL1_MASK_SHIFT   7
+
 struct video_i2c_chip;
 
 struct video_i2c_buffer {
@@ -135,31 +160,6 @@ static struct nvmem_config mlx90640_nvram_config = {
        .reg_read = mlx90640_nvram_read,
 };
 
-/* Power control register */
-#define AMG88XX_REG_PCTL       0x00
-#define AMG88XX_PCTL_NORMAL            0x00
-#define AMG88XX_PCTL_SLEEP             0x10
-
-/* Reset register */
-#define AMG88XX_REG_RST                0x01
-#define AMG88XX_RST_FLAG               0x30
-#define AMG88XX_RST_INIT               0x3f
-
-/* Frame rate register */
-#define AMG88XX_REG_FPSC       0x02
-#define AMG88XX_FPSC_1FPS              BIT(0)
-
-/* Thermistor register */
-#define AMG88XX_REG_TTHL       0x0e
-
-/* Temperature register */
-#define AMG88XX_REG_T01L       0x80
-
-/* Control register */
-#define MLX90640_REG_CTL1              0x800d
-#define MLX90640_REG_CTL1_MASK         0x0380
-#define MLX90640_REG_CTL1_MASK_SHIFT   7
-
 static int amg88xx_xfer(struct video_i2c_data *data, char *buf)
 {
        return regmap_bulk_read(data->regmap, AMG88XX_REG_T01L, buf,