]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] smiapp: Improve debug messages from frame layout reading
authorSakari Ailus <sakari.ailus@linux.intel.com>
Wed, 7 Sep 2016 12:53:42 +0000 (09:53 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 21 Oct 2016 17:09:40 +0000 (15:09 -0200)
Provide more debugging information on reading the frame layout.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/i2c/smiapp/smiapp-core.c

index a7afcea5a5c52ab988e4ccacc64227f54bf63a6f..1337b22e238065ca18233ee1a63200c6a6fa2b68 100644 (file)
@@ -100,12 +100,11 @@ static int smiapp_read_frame_fmt(struct smiapp_sensor *sensor)
                u32 pixels;
                char *which;
                char *what;
+               u32 reg;
 
                if (fmt_model_type == SMIAPP_FRAME_FORMAT_MODEL_TYPE_2BYTE) {
-                       rval = smiapp_read(
-                               sensor,
-                               SMIAPP_REG_U16_FRAME_FORMAT_DESCRIPTOR_2(i),
-                               &desc);
+                       reg = SMIAPP_REG_U16_FRAME_FORMAT_DESCRIPTOR_2(i);
+                       rval = smiapp_read(sensor, reg, &desc);
                        if (rval)
                                return rval;
 
@@ -116,10 +115,8 @@ static int smiapp_read_frame_fmt(struct smiapp_sensor *sensor)
                        pixels = desc & SMIAPP_FRAME_FORMAT_DESC_2_PIXELS_MASK;
                } else if (fmt_model_type
                           == SMIAPP_FRAME_FORMAT_MODEL_TYPE_4BYTE) {
-                       rval = smiapp_read(
-                               sensor,
-                               SMIAPP_REG_U32_FRAME_FORMAT_DESCRIPTOR_4(i),
-                               &desc);
+                       reg = SMIAPP_REG_U32_FRAME_FORMAT_DESCRIPTOR_4(i);
+                       rval = smiapp_read(sensor, reg, &desc);
                        if (rval)
                                return rval;
 
@@ -158,12 +155,12 @@ static int smiapp_read_frame_fmt(struct smiapp_sensor *sensor)
                        break;
                default:
                        what = "invalid";
-                       dev_dbg(&client->dev, "pixelcode %d\n", pixelcode);
                        break;
                }
 
-               dev_dbg(&client->dev, "%s pixels: %d %s\n",
-                       what, pixels, which);
+               dev_dbg(&client->dev,
+                       "0x%8.8x %s pixels: %d %s (pixelcode %u)\n", reg,
+                       what, pixels, which, pixelcode);
 
                if (i < ncol_desc) {
                        if (pixelcode ==