diff options
author | Sakari Ailus <sakari.ailus@iki.fi> | 2014-09-17 01:08:30 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-10-28 18:42:55 +0300 |
commit | cd78b6afa7adb3aca9aa189ba5fb8a0adab647a2 (patch) | |
tree | 7b0c092d7cf25a34aa3140a74f89ee1ca2eb8dcb /drivers/media/i2c | |
parent | 38a833c7fd75dbbf97a5df25e1e04159693c2b1e (diff) | |
download | linux-cd78b6afa7adb3aca9aa189ba5fb8a0adab647a2.tar.xz |
[media] smiapp: Take valid link frequencies into account in supported mbus codes
Some media bus codes may be unavailable depending on the available media bus
codes.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r-- | drivers/media/i2c/smiapp/smiapp-core.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index d65521abf0cc..926f60c00ba1 100644 --- a/drivers/media/i2c/smiapp/smiapp-core.c +++ b/drivers/media/i2c/smiapp/smiapp-core.c @@ -806,14 +806,6 @@ static int smiapp_get_mbus_formats(struct smiapp_sensor *sensor) dev_dbg(&client->dev, "jolly good! %d\n", j); sensor->default_mbus_frame_fmts |= 1 << j; - if (!sensor->csi_format - || f->width > sensor->csi_format->width - || (f->width == sensor->csi_format->width - && f->compressed - > sensor->csi_format->compressed)) { - sensor->csi_format = f; - sensor->internal_csi_format = f; - } } } @@ -850,6 +842,22 @@ static int smiapp_get_mbus_formats(struct smiapp_sensor *sensor) set_bit(j, valid_link_freqs); } + + if (!*valid_link_freqs) { + dev_info(&client->dev, + "no valid link frequencies for %u bpp\n", + f->compressed); + sensor->default_mbus_frame_fmts &= ~BIT(i); + continue; + } + + if (!sensor->csi_format + || f->width > sensor->csi_format->width + || (f->width == sensor->csi_format->width + && f->compressed > sensor->csi_format->compressed)) { + sensor->csi_format = f; + sensor->internal_csi_format = f; + } } if (!sensor->csi_format) { |