aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/soc_mediabus.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/soc_mediabus.c')
-rw-r--r--drivers/media/video/soc_mediabus.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/media/video/soc_mediabus.c b/drivers/media/video/soc_mediabus.c
index 91391214c682..ed77aa055b63 100644
--- a/drivers/media/video/soc_mediabus.c
+++ b/drivers/media/video/soc_mediabus.c
@@ -88,7 +88,7 @@ static const struct soc_mbus_pixelfmt mbus_fmt[] = {
88 .packing = SOC_MBUS_PACKING_EXTEND16, 88 .packing = SOC_MBUS_PACKING_EXTEND16,
89 .order = SOC_MBUS_ORDER_LE, 89 .order = SOC_MBUS_ORDER_LE,
90 }, 90 },
91 [MBUS_IDX(GREY8_1X8)] = { 91 [MBUS_IDX(Y8_1X8)] = {
92 .fourcc = V4L2_PIX_FMT_GREY, 92 .fourcc = V4L2_PIX_FMT_GREY,
93 .name = "Grey", 93 .name = "Grey",
94 .bits_per_sample = 8, 94 .bits_per_sample = 8,
@@ -132,6 +132,20 @@ static const struct soc_mbus_pixelfmt mbus_fmt[] = {
132 }, 132 },
133}; 133};
134 134
135int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf)
136{
137 switch (mf->packing) {
138 case SOC_MBUS_PACKING_NONE:
139 case SOC_MBUS_PACKING_EXTEND16:
140 return 1;
141 case SOC_MBUS_PACKING_2X8_PADHI:
142 case SOC_MBUS_PACKING_2X8_PADLO:
143 return 2;
144 }
145 return -EINVAL;
146}
147EXPORT_SYMBOL(soc_mbus_samples_per_pixel);
148
135s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf) 149s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf)
136{ 150{
137 switch (mf->packing) { 151 switch (mf->packing) {