summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKassey Li <ygli@marvell.com>2011-05-20 04:08:39 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-05-20 11:57:59 -0300
commit64149deb6a9ec35cc8a3ac3e7b5bc19d4a79ff44 (patch)
treea45d7ba4968944b5b2444d42fa7a5cba865724c7
parent3dac322db63473901ba9484690ee6864bb1292d0 (diff)
[media] V4L: soc-camera: add JPEG support
Signed-off-by: Qing Xu <qingx@marvell.com> Signed-off-by: Kassey Lee <ygli@marvell.com> [g.liakhovetski@gmx.de: fixed compiler warning] Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/soc_mediabus.c11
-rw-r--r--include/media/soc_mediabus.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/media/video/soc_mediabus.c b/drivers/media/video/soc_mediabus.c
index ed77aa055b6..13e86df78e5 100644
--- a/drivers/media/video/soc_mediabus.c
+++ b/drivers/media/video/soc_mediabus.c
@@ -130,6 +130,13 @@ static const struct soc_mbus_pixelfmt mbus_fmt[] = {
.packing = SOC_MBUS_PACKING_2X8_PADLO,
.order = SOC_MBUS_ORDER_BE,
},
+ [MBUS_IDX(JPEG_1X8)] = {
+ .fourcc = V4L2_PIX_FMT_JPEG,
+ .name = "JPEG",
+ .bits_per_sample = 8,
+ .packing = SOC_MBUS_PACKING_VARIABLE,
+ .order = SOC_MBUS_ORDER_LE,
+ },
};
int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf)
@@ -141,6 +148,8 @@ int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf)
case SOC_MBUS_PACKING_2X8_PADHI:
case SOC_MBUS_PACKING_2X8_PADLO:
return 2;
+ case SOC_MBUS_PACKING_VARIABLE:
+ return 0;
}
return -EINVAL;
}
@@ -155,6 +164,8 @@ s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf)
case SOC_MBUS_PACKING_2X8_PADLO:
case SOC_MBUS_PACKING_EXTEND16:
return width * 2;
+ case SOC_MBUS_PACKING_VARIABLE:
+ return 0;
}
return -EINVAL;
}
diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h
index b338108ec30..3b5a70b9752 100644
--- a/include/media/soc_mediabus.h
+++ b/include/media/soc_mediabus.h
@@ -28,6 +28,7 @@ enum soc_mbus_packing {
SOC_MBUS_PACKING_2X8_PADHI,
SOC_MBUS_PACKING_2X8_PADLO,
SOC_MBUS_PACKING_EXTEND16,
+ SOC_MBUS_PACKING_VARIABLE,
};
/**