From 288d173617b2a97628a937776a16f41e14e6a121 Mon Sep 17 00:00:00 2001 From: Alberto Panizzo Date: Wed, 12 Jan 2011 08:16:19 -0300 Subject: [PATCH] --- yaml --- r: 241900 b: refs/heads/master c: 48a3c77338d725d4976fa792d822eb940ce5c296 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/media/video/soc_mediabus.c | 14 ++++++++++++++ trunk/include/media/soc_mediabus.h | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index bc8a9939df99..7c1a7282fb50 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7fdbd85bce033e2d0f74e5d326ab43906653cb81 +refs/heads/master: 48a3c77338d725d4976fa792d822eb940ce5c296 diff --git a/trunk/drivers/media/video/soc_mediabus.c b/trunk/drivers/media/video/soc_mediabus.c index 91391214c682..73b4138709e4 100644 --- a/trunk/drivers/media/video/soc_mediabus.c +++ b/trunk/drivers/media/video/soc_mediabus.c @@ -132,6 +132,20 @@ static const struct soc_mbus_pixelfmt mbus_fmt[] = { }, }; +int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf) +{ + switch (mf->packing) { + case SOC_MBUS_PACKING_NONE: + case SOC_MBUS_PACKING_EXTEND16: + return 1; + case SOC_MBUS_PACKING_2X8_PADHI: + case SOC_MBUS_PACKING_2X8_PADLO: + return 2; + } + return -EINVAL; +} +EXPORT_SYMBOL(soc_mbus_samples_per_pixel); + s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf) { switch (mf->packing) { diff --git a/trunk/include/media/soc_mediabus.h b/trunk/include/media/soc_mediabus.h index 037cd7be001e..f5522b3f175a 100644 --- a/trunk/include/media/soc_mediabus.h +++ b/trunk/include/media/soc_mediabus.h @@ -61,5 +61,6 @@ struct soc_mbus_pixelfmt { const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc( enum v4l2_mbus_pixelcode code); s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf); +int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf); #endif