Commit 64149deb authored by Kassey Li's avatar Kassey Li Committed by Mauro Carvalho Chehab

[media] V4L: soc-camera: add JPEG support

Signed-off-by: default avatarQing Xu <qingx@marvell.com>
Signed-off-by: default avatarKassey Lee <ygli@marvell.com>
[g.liakhovetski@gmx.de: fixed compiler warning]
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 3dac322d
......@@ -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;
}
......
......@@ -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,
};
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment