[media] smiapp: Access flash capabilities through limits
authorSakari Ailus <sakari.ailus@linux.intel.com>
Fri, 3 Oct 2014 14:21:52 +0000 (11:21 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 23 Dec 2014 13:42:56 +0000 (11:42 -0200)
The flash capability register is already read as part of the limit
registers. Do no access it separately; instead use the value from the
limits.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/i2c/smiapp/smiapp-core.c
drivers/media/i2c/smiapp/smiapp.h

index 91ab71c3280e9027f694177c3003e452597f0fb9..22eddd6f92fc35fa39c7750037138a3d867014d7 100644 (file)
@@ -1483,7 +1483,7 @@ static int smiapp_start_streaming(struct smiapp_sensor *sensor)
        if (rval < 0)
                goto out;
 
-       if ((sensor->flash_capability &
+       if ((sensor->limits[SMIAPP_LIMIT_FLASH_MODE_CAPABILITY] &
             (SMIAPP_FLASH_MODE_CAPABILITY_SINGLE_STROBE |
              SMIAPP_FLASH_MODE_CAPABILITY_MULTIPLE_STROBE)) &&
            sensor->platform_data->strobe_setup != NULL &&
@@ -2529,7 +2529,6 @@ static int smiapp_init(struct smiapp_sensor *sensor)
        struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd);
        struct smiapp_pll *pll = &sensor->pll;
        struct smiapp_subdev *last = NULL;
-       u32 tmp;
        unsigned int i;
        int rval;
 
@@ -2785,12 +2784,6 @@ static int smiapp_init(struct smiapp_sensor *sensor)
        sensor->streaming = false;
        sensor->dev_init_done = true;
 
-       /* check flash capability */
-       rval = smiapp_read(sensor, SMIAPP_REG_U8_FLASH_MODE_CAPABILITY, &tmp);
-       sensor->flash_capability = tmp;
-       if (rval)
-               goto out_cleanup;
-
        smiapp_power_off(sensor);
 
        return 0;
index 8fded46ac5846026d64dcf23778dce11eb7fb78c..ed010a8a49d717b7c19e3ec97b8a7c2d2466659b 100644 (file)
@@ -216,7 +216,6 @@ struct smiapp_sensor {
        u8 scaling_mode;
 
        u8 hvflip_inv_mask; /* H/VFLIP inversion due to sensor orientation */
-       u8 flash_capability;
        u8 frame_skip;
 
        int power_count;