Skip to content

Commit

Permalink
[media] m5mols: Do not reset the configured pixel format when unexpected
Browse files Browse the repository at this point in the history
Initialize default pixel format in driver probe() rather than in
s_power handler. This also prevents resetting the configuration
applied before the device was powered on.

Acked-by: HeungJun Kim <riverful.kim@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Sylwester Nawrocki authored and Mauro Carvalho Chehab committed Dec 30, 2011
1 parent aa1f460 commit f428948
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/media/video/m5mols/m5mols_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -864,13 +864,6 @@ static int m5mols_s_power(struct v4l2_subdev *sd, int on)
ret = m5mols_sensor_power(info, true);
if (!ret)
ret = m5mols_fw_start(sd);
if (ret)
return ret;

info->ffmt[M5MOLS_RESTYPE_MONITOR] =
m5mols_default_ffmt[M5MOLS_RESTYPE_MONITOR];
info->ffmt[M5MOLS_RESTYPE_CAPTURE] =
m5mols_default_ffmt[M5MOLS_RESTYPE_CAPTURE];
return ret;
}

Expand Down Expand Up @@ -1007,6 +1000,8 @@ static int __devinit m5mols_probe(struct i2c_client *client,
goto out_me;
}
info->res_type = M5MOLS_RESTYPE_MONITOR;
info->ffmt[0] = m5mols_default_ffmt[0];
info->ffmt[1] = m5mols_default_ffmt[1];

ret = m5mols_sensor_power(info, true);
if (ret)
Expand Down

0 comments on commit f428948

Please sign in to comment.