提交 df1e74cc 编写于 作者: P Philipp Zabel 提交者: Mauro Carvalho Chehab

[media] media: coda: add i.MX53 / CODA7541 platform support

Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de>
Tested-by: NJavier Martin <javier.martin@vista-silicon.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 87048bb4
...@@ -84,6 +84,7 @@ enum coda_inst_type { ...@@ -84,6 +84,7 @@ enum coda_inst_type {
enum coda_product { enum coda_product {
CODA_DX6 = 0xf001, CODA_DX6 = 0xf001,
CODA_7541 = 0xf012,
}; };
struct coda_fmt { struct coda_fmt {
...@@ -261,6 +262,24 @@ static struct coda_fmt codadx6_formats[] = { ...@@ -261,6 +262,24 @@ static struct coda_fmt codadx6_formats[] = {
}, },
}; };
static struct coda_fmt coda7_formats[] = {
{
.name = "YUV 4:2:0 Planar",
.fourcc = V4L2_PIX_FMT_YUV420,
.type = CODA_FMT_RAW,
},
{
.name = "H264 Encoded Stream",
.fourcc = V4L2_PIX_FMT_H264,
.type = CODA_FMT_ENC,
},
{
.name = "MPEG4 Encoded Stream",
.fourcc = V4L2_PIX_FMT_MPEG4,
.type = CODA_FMT_ENC,
},
};
static struct coda_fmt *find_format(struct coda_dev *dev, struct v4l2_format *f) static struct coda_fmt *find_format(struct coda_dev *dev, struct v4l2_format *f)
{ {
struct coda_fmt *formats = dev->devtype->formats; struct coda_fmt *formats = dev->devtype->formats;
...@@ -1488,6 +1507,7 @@ static irqreturn_t coda_irq_handler(int irq, void *data) ...@@ -1488,6 +1507,7 @@ static irqreturn_t coda_irq_handler(int irq, void *data)
static u32 coda_supported_firmwares[] = { static u32 coda_supported_firmwares[] = {
CODA_FIRMWARE_VERNUM(CODA_DX6, 2, 2, 5), CODA_FIRMWARE_VERNUM(CODA_DX6, 2, 2, 5),
CODA_FIRMWARE_VERNUM(CODA_7541, 13, 4, 29),
}; };
static bool coda_firmware_supported(u32 vernum) static bool coda_firmware_supported(u32 vernum)
...@@ -1507,6 +1527,8 @@ static char *coda_product_name(int product) ...@@ -1507,6 +1527,8 @@ static char *coda_product_name(int product)
switch (product) { switch (product) {
case CODA_DX6: case CODA_DX6:
return "CodaDx6"; return "CodaDx6";
case CODA_7541:
return "CODA7541";
default: default:
snprintf(buf, sizeof(buf), "(0x%04x)", product); snprintf(buf, sizeof(buf), "(0x%04x)", product);
return buf; return buf;
...@@ -1699,6 +1721,7 @@ static int coda_firmware_request(struct coda_dev *dev) ...@@ -1699,6 +1721,7 @@ static int coda_firmware_request(struct coda_dev *dev)
enum coda_platform { enum coda_platform {
CODA_IMX27, CODA_IMX27,
CODA_IMX53,
}; };
static const struct coda_devtype coda_devdata[] = { static const struct coda_devtype coda_devdata[] = {
...@@ -1708,10 +1731,17 @@ static const struct coda_devtype coda_devdata[] = { ...@@ -1708,10 +1731,17 @@ static const struct coda_devtype coda_devdata[] = {
.formats = codadx6_formats, .formats = codadx6_formats,
.num_formats = ARRAY_SIZE(codadx6_formats), .num_formats = ARRAY_SIZE(codadx6_formats),
}, },
[CODA_IMX53] = {
.firmware = "v4l-coda7541-imx53.bin",
.product = CODA_7541,
.formats = coda7_formats,
.num_formats = ARRAY_SIZE(coda7_formats),
},
}; };
static struct platform_device_id coda_platform_ids[] = { static struct platform_device_id coda_platform_ids[] = {
{ .name = "coda-imx27", .driver_data = CODA_IMX27 }, { .name = "coda-imx27", .driver_data = CODA_IMX27 },
{ .name = "coda-imx53", .driver_data = CODA_7541 },
{ /* sentinel */ } { /* sentinel */ }
}; };
MODULE_DEVICE_TABLE(platform, coda_platform_ids); MODULE_DEVICE_TABLE(platform, coda_platform_ids);
...@@ -1719,6 +1749,7 @@ MODULE_DEVICE_TABLE(platform, coda_platform_ids); ...@@ -1719,6 +1749,7 @@ MODULE_DEVICE_TABLE(platform, coda_platform_ids);
#ifdef CONFIG_OF #ifdef CONFIG_OF
static const struct of_device_id coda_dt_ids[] = { static const struct of_device_id coda_dt_ids[] = {
{ .compatible = "fsl,imx27-vpu", .data = &coda_platform_ids[CODA_IMX27] }, { .compatible = "fsl,imx27-vpu", .data = &coda_platform_ids[CODA_IMX27] },
{ .compatible = "fsl,imx53-vpu", .data = &coda_devdata[CODA_IMX53] },
{ /* sentinel */ } { /* sentinel */ }
}; };
MODULE_DEVICE_TABLE(of, coda_dt_ids); MODULE_DEVICE_TABLE(of, coda_dt_ids);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册