Merge tag 'mmc-v4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
[cascardo/linux.git] / drivers / media / platform / vsp1 / vsp1_drv.c
index cc316d2..57c713a 100644 (file)
@@ -60,7 +60,7 @@ static irqreturn_t vsp1_irq_handler(int irq, void *data)
                status = vsp1_read(vsp1, VI6_WPF_IRQ_STA(i));
                vsp1_write(vsp1, VI6_WPF_IRQ_STA(i), ~status & mask);
 
-               if (status & VI6_WFP_IRQ_STA_FRE) {
+               if (status & VI6_WFP_IRQ_STA_DFE) {
                        vsp1_pipeline_frame_end(wpf->pipe);
                        ret = IRQ_HANDLED;
                }
@@ -220,7 +220,8 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
        int ret;
 
        mdev->dev = vsp1->dev;
-       strlcpy(mdev->model, "VSP1", sizeof(mdev->model));
+       mdev->hw_revision = vsp1->version;
+       strlcpy(mdev->model, vsp1->info->model, sizeof(mdev->model));
        snprintf(mdev->bus_info, sizeof(mdev->bus_info), "platform:%s",
                 dev_name(mdev->dev));
        media_device_init(mdev);
@@ -559,6 +560,7 @@ static const struct dev_pm_ops vsp1_pm_ops = {
 static const struct vsp1_device_info vsp1_device_infos[] = {
        {
                .version = VI6_IP_VERSION_MODEL_VSPS_H2,
+               .model = "VSP1-S",
                .gen = 2,
                .features = VSP1_HAS_BRU | VSP1_HAS_CLU | VSP1_HAS_LUT
                          | VSP1_HAS_SRU | VSP1_HAS_WPF_VFLIP,
@@ -569,6 +571,7 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
                .uapi = true,
        }, {
                .version = VI6_IP_VERSION_MODEL_VSPR_H2,
+               .model = "VSP1-R",
                .gen = 2,
                .features = VSP1_HAS_BRU | VSP1_HAS_SRU | VSP1_HAS_WPF_VFLIP,
                .rpf_count = 5,
@@ -578,6 +581,7 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
                .uapi = true,
        }, {
                .version = VI6_IP_VERSION_MODEL_VSPD_GEN2,
+               .model = "VSP1-D",
                .gen = 2,
                .features = VSP1_HAS_BRU | VSP1_HAS_LIF | VSP1_HAS_LUT,
                .rpf_count = 4,
@@ -587,6 +591,7 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
                .uapi = true,
        }, {
                .version = VI6_IP_VERSION_MODEL_VSPS_M2,
+               .model = "VSP1-S",
                .gen = 2,
                .features = VSP1_HAS_BRU | VSP1_HAS_CLU | VSP1_HAS_LUT
                          | VSP1_HAS_SRU | VSP1_HAS_WPF_VFLIP,
@@ -595,8 +600,31 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
                .wpf_count = 4,
                .num_bru_inputs = 4,
                .uapi = true,
+       }, {
+               .version = VI6_IP_VERSION_MODEL_VSPS_V2H,
+               .model = "VSP1V-S",
+               .gen = 2,
+               .features = VSP1_HAS_BRU | VSP1_HAS_CLU | VSP1_HAS_LUT
+                         | VSP1_HAS_SRU | VSP1_HAS_WPF_VFLIP,
+               .rpf_count = 4,
+               .uds_count = 1,
+               .wpf_count = 4,
+               .num_bru_inputs = 4,
+               .uapi = true,
+       }, {
+               .version = VI6_IP_VERSION_MODEL_VSPD_V2H,
+               .model = "VSP1V-D",
+               .gen = 2,
+               .features = VSP1_HAS_BRU | VSP1_HAS_CLU | VSP1_HAS_LUT
+                         | VSP1_HAS_LIF,
+               .rpf_count = 4,
+               .uds_count = 1,
+               .wpf_count = 1,
+               .num_bru_inputs = 4,
+               .uapi = true,
        }, {
                .version = VI6_IP_VERSION_MODEL_VSPI_GEN3,
+               .model = "VSP2-I",
                .gen = 3,
                .features = VSP1_HAS_CLU | VSP1_HAS_LUT | VSP1_HAS_SRU
                          | VSP1_HAS_WPF_HFLIP | VSP1_HAS_WPF_VFLIP,
@@ -606,6 +634,7 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
                .uapi = true,
        }, {
                .version = VI6_IP_VERSION_MODEL_VSPBD_GEN3,
+               .model = "VSP2-BD",
                .gen = 3,
                .features = VSP1_HAS_BRU | VSP1_HAS_WPF_VFLIP,
                .rpf_count = 5,
@@ -614,6 +643,7 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
                .uapi = true,
        }, {
                .version = VI6_IP_VERSION_MODEL_VSPBC_GEN3,
+               .model = "VSP2-BC",
                .gen = 3,
                .features = VSP1_HAS_BRU | VSP1_HAS_CLU | VSP1_HAS_LUT
                          | VSP1_HAS_WPF_VFLIP,
@@ -623,6 +653,7 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
                .uapi = true,
        }, {
                .version = VI6_IP_VERSION_MODEL_VSPD_GEN3,
+               .model = "VSP2-D",
                .gen = 3,
                .features = VSP1_HAS_BRU | VSP1_HAS_LIF | VSP1_HAS_WPF_VFLIP,
                .rpf_count = 5,
@@ -638,7 +669,6 @@ static int vsp1_probe(struct platform_device *pdev)
        struct resource *irq;
        struct resource *io;
        unsigned int i;
-       u32 version;
        int ret;
 
        vsp1 = devm_kzalloc(&pdev->dev, sizeof(*vsp1), GFP_KERNEL);
@@ -689,11 +719,11 @@ static int vsp1_probe(struct platform_device *pdev)
        if (ret < 0)
                goto done;
 
-       version = vsp1_read(vsp1, VI6_IP_VERSION);
+       vsp1->version = vsp1_read(vsp1, VI6_IP_VERSION);
        pm_runtime_put_sync(&pdev->dev);
 
        for (i = 0; i < ARRAY_SIZE(vsp1_device_infos); ++i) {
-               if ((version & VI6_IP_VERSION_MODEL_MASK) ==
+               if ((vsp1->version & VI6_IP_VERSION_MODEL_MASK) ==
                    vsp1_device_infos[i].version) {
                        vsp1->info = &vsp1_device_infos[i];
                        break;
@@ -701,12 +731,13 @@ static int vsp1_probe(struct platform_device *pdev)
        }
 
        if (!vsp1->info) {
-               dev_err(&pdev->dev, "unsupported IP version 0x%08x\n", version);
+               dev_err(&pdev->dev, "unsupported IP version 0x%08x\n",
+                       vsp1->version);
                ret = -ENXIO;
                goto done;
        }
 
-       dev_dbg(&pdev->dev, "IP version 0x%08x\n", version);
+       dev_dbg(&pdev->dev, "IP version 0x%08x\n", vsp1->version);
 
        /* Instanciate entities */
        ret = vsp1_create_entities(vsp1);