| @@ -47,7 +47,7 @@ static irqreturn_t vsp1_irq_handler(int irq, void *data) · 46 unmodified lines |
| 47 | unsigned int i; | 47 | unsigned int i; |
| 48 | u32 status; | 48 | u32 status; |
| 49 | | 49 | |
| 50 | for (i = 0; i < vsp1->pdata.wpf_count; ++i) { | 50 | for (i = 0; i < vsp1->info->wpf_count; ++i) { |
| 51 | struct vsp1_rwpf *wpf = vsp1->wpf[i]; | 51 | struct vsp1_rwpf *wpf = vsp1->wpf[i]; |
| 52 | struct vsp1_pipeline *pipe; | 52 | struct vsp1_pipeline *pipe; |
| 53 | | 53 | |
| @@ -153,7 +153,7 @@ static int vsp1_uapi_create_links(struct vsp1_device *vsp1) · 99 unmodified lines |
| 153 | return ret; | 153 | return ret; |
| 154 | } | 154 | } |
| 155 | | 155 | |
| 156 | if (vsp1->pdata.features & VSP1_HAS_LIF) { | 156 | if (vsp1->info->features & VSP1_HAS_LIF) { |
| 157 | ret = media_create_pad_link(&vsp1->wpf[0]->entity.subdev.entity, | 157 | ret = media_create_pad_link(&vsp1->wpf[0]->entity.subdev.entity, |
| 158 | RWPF_PAD_SOURCE, | 158 | RWPF_PAD_SOURCE, |
| 159 | &vsp1->lif->entity.subdev.entity, | 159 | &vsp1->lif->entity.subdev.entity, |
| @@ -162,7 +162,7 @@ static int vsp1_uapi_create_links(struct vsp1_device *vsp1) · 2 unmodified lines |
| 162 | return ret; | 162 | return ret; |
| 163 | } | 163 | } |
| 164 | | 164 | |
| 165 | for (i = 0; i < vsp1->pdata.rpf_count; ++i) { | 165 | for (i = 0; i < vsp1->info->rpf_count; ++i) { |
| 166 | struct vsp1_rwpf *rpf = vsp1->rpf[i]; | 166 | struct vsp1_rwpf *rpf = vsp1->rpf[i]; |
| 167 | | 167 | |
| 168 | ret = media_create_pad_link(&rpf->video->video.entity, 0, | 168 | ret = media_create_pad_link(&rpf->video->video.entity, 0, |
| @@ -174,7 +174,7 @@ static int vsp1_uapi_create_links(struct vsp1_device *vsp1) · 5 unmodified lines |
| 174 | return ret; | 174 | return ret; |
| 175 | } | 175 | } |
| 176 | | 176 | |
| 177 | for (i = 0; i < vsp1->pdata.wpf_count; ++i) { | 177 | for (i = 0; i < vsp1->info->wpf_count; ++i) { |
| 178 | /* Connect the video device to the WPF. All connections are | 178 | /* Connect the video device to the WPF. All connections are |
| 179 | * immutable except for the WPF0 source link if a LIF is | 179 | * immutable except for the WPF0 source link if a LIF is |
| 180 | * present. | 180 | * present. |
| @@ -182,7 +182,7 @@ static int vsp1_uapi_create_links(struct vsp1_device *vsp1) · 1 unmodified line |
| 182 | struct vsp1_rwpf *wpf = vsp1->wpf[i]; | 182 | struct vsp1_rwpf *wpf = vsp1->wpf[i]; |
| 183 | unsigned int flags = MEDIA_LNK_FL_ENABLED; | 183 | unsigned int flags = MEDIA_LNK_FL_ENABLED; |
| 184 | | 184 | |
| 185 | if (!(vsp1->pdata.features & VSP1_HAS_LIF) || i != 0) | 185 | if (!(vsp1->info->features & VSP1_HAS_LIF) || i != 0) |
| 186 | flags |= MEDIA_LNK_FL_IMMUTABLE; | 186 | flags |= MEDIA_LNK_FL_IMMUTABLE; |
| 187 | | 187 | |
| 188 | ret = media_create_pad_link(&wpf->entity.subdev.entity, | 188 | ret = media_create_pad_link(&wpf->entity.subdev.entity, |
| @@ -215,7 +215,7 @@ static void vsp1_destroy_entities(struct vsp1_device *vsp1) · 26 unmodified lines |
| 215 | media_device_unregister(&vsp1->media_dev); | 215 | media_device_unregister(&vsp1->media_dev); |
| 216 | media_device_cleanup(&vsp1->media_dev); | 216 | media_device_cleanup(&vsp1->media_dev); |
| 217 | | 217 | |
| 218 | if (!vsp1->pdata.uapi) | 218 | if (!vsp1->info->uapi) |
| 219 | vsp1_drm_cleanup(vsp1); | 219 | vsp1_drm_cleanup(vsp1); |
| 220 | } | 220 | } |
| 221 | | 221 | |
| @@ -238,7 +238,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1) · 16 unmodified lines |
| 238 | * the pipeline is configured internally by the driver in that case, and | 238 | * the pipeline is configured internally by the driver in that case, and |
| 239 | * its configuration can thus be trusted. | 239 | * its configuration can thus be trusted. |
| 240 | */ | 240 | */ |
| 241 | if (vsp1->pdata.uapi) | 241 | if (vsp1->info->uapi) |
| 242 | vsp1->media_ops.link_validate = v4l2_subdev_link_validate; | 242 | vsp1->media_ops.link_validate = v4l2_subdev_link_validate; |
| 243 | | 243 | |
| 244 | vdev->mdev = mdev; | 244 | vdev->mdev = mdev; |
| @@ -250,7 +250,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1) · 5 unmodified lines |
| 250 | } | 250 | } |
| 251 | | 251 | |
| 252 | /* Instantiate all the entities. */ | 252 | /* Instantiate all the entities. */ |
| 253 | if (vsp1->pdata.features & VSP1_HAS_BRU) { | 253 | if (vsp1->info->features & VSP1_HAS_BRU) { |
| 254 | vsp1->bru = vsp1_bru_create(vsp1); | 254 | vsp1->bru = vsp1_bru_create(vsp1); |
| 255 | if (IS_ERR(vsp1->bru)) { | 255 | if (IS_ERR(vsp1->bru)) { |
| 256 | ret = PTR_ERR(vsp1->bru); | 256 | ret = PTR_ERR(vsp1->bru); |
| @@ -276,7 +276,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1) · 19 unmodified lines |
| 276 | | 276 | |
| 277 | list_add_tail(&vsp1->hst->entity.list_dev, &vsp1->entities); | 277 | list_add_tail(&vsp1->hst->entity.list_dev, &vsp1->entities); |
| 278 | | 278 | |
| 279 | if (vsp1->pdata.features & VSP1_HAS_LIF) { | 279 | if (vsp1->info->features & VSP1_HAS_LIF) { |
| 280 | vsp1->lif = vsp1_lif_create(vsp1); | 280 | vsp1->lif = vsp1_lif_create(vsp1); |
| 281 | if (IS_ERR(vsp1->lif)) { | 281 | if (IS_ERR(vsp1->lif)) { |
| 282 | ret = PTR_ERR(vsp1->lif); | 282 | ret = PTR_ERR(vsp1->lif); |
| @@ -286,7 +286,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1) · 3 unmodified lines |
| 286 | list_add_tail(&vsp1->lif->entity.list_dev, &vsp1->entities); | 286 | list_add_tail(&vsp1->lif->entity.list_dev, &vsp1->entities); |
| 287 | } | 287 | } |
| 288 | | 288 | |
| 289 | if (vsp1->pdata.features & VSP1_HAS_LUT) { | 289 | if (vsp1->info->features & VSP1_HAS_LUT) { |
| 290 | vsp1->lut = vsp1_lut_create(vsp1); | 290 | vsp1->lut = vsp1_lut_create(vsp1); |
| 291 | if (IS_ERR(vsp1->lut)) { | 291 | if (IS_ERR(vsp1->lut)) { |
| 292 | ret = PTR_ERR(vsp1->lut); | 292 | ret = PTR_ERR(vsp1->lut); |
| @@ -296,7 +296,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1) · 3 unmodified lines |
| 296 | list_add_tail(&vsp1->lut->entity.list_dev, &vsp1->entities); | 296 | list_add_tail(&vsp1->lut->entity.list_dev, &vsp1->entities); |
| 297 | } | 297 | } |
| 298 | | 298 | |
| 299 | for (i = 0; i < vsp1->pdata.rpf_count; ++i) { | 299 | for (i = 0; i < vsp1->info->rpf_count; ++i) { |
| 300 | struct vsp1_rwpf *rpf; | 300 | struct vsp1_rwpf *rpf; |
| 301 | | 301 | |
| 302 | rpf = vsp1_rpf_create(vsp1, i); | 302 | rpf = vsp1_rpf_create(vsp1, i); |
| @@ -308,7 +308,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1) · 5 unmodified lines |
| 308 | vsp1->rpf[i] = rpf; | 308 | vsp1->rpf[i] = rpf; |
| 309 | list_add_tail(&rpf->entity.list_dev, &vsp1->entities); | 309 | list_add_tail(&rpf->entity.list_dev, &vsp1->entities); |
| 310 | | 310 | |
| 311 | if (vsp1->pdata.uapi) { | 311 | if (vsp1->info->uapi) { |
| 312 | struct vsp1_video *video = vsp1_video_create(vsp1, rpf); | 312 | struct vsp1_video *video = vsp1_video_create(vsp1, rpf); |
| 313 | | 313 | |
| 314 | if (IS_ERR(video)) { | 314 | if (IS_ERR(video)) { |
| @@ -320,7 +320,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1) · 5 unmodified lines |
| 320 | } | 320 | } |
| 321 | } | 321 | } |
| 322 | | 322 | |
| 323 | if (vsp1->pdata.features & VSP1_HAS_SRU) { | 323 | if (vsp1->info->features & VSP1_HAS_SRU) { |
| 324 | vsp1->sru = vsp1_sru_create(vsp1); | 324 | vsp1->sru = vsp1_sru_create(vsp1); |
| 325 | if (IS_ERR(vsp1->sru)) { | 325 | if (IS_ERR(vsp1->sru)) { |
| 326 | ret = PTR_ERR(vsp1->sru); | 326 | ret = PTR_ERR(vsp1->sru); |
| @@ -330,7 +330,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1) · 3 unmodified lines |
| 330 | list_add_tail(&vsp1->sru->entity.list_dev, &vsp1->entities); | 330 | list_add_tail(&vsp1->sru->entity.list_dev, &vsp1->entities); |
| 331 | } | 331 | } |
| 332 | | 332 | |
| 333 | for (i = 0; i < vsp1->pdata.uds_count; ++i) { | 333 | for (i = 0; i < vsp1->info->uds_count; ++i) { |
| 334 | struct vsp1_uds *uds; | 334 | struct vsp1_uds *uds; |
| 335 | | 335 | |
| 336 | uds = vsp1_uds_create(vsp1, i); | 336 | uds = vsp1_uds_create(vsp1, i); |
| @@ -343,7 +343,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1) · 6 unmodified lines |
| 343 | list_add_tail(&uds->entity.list_dev, &vsp1->entities); | 343 | list_add_tail(&uds->entity.list_dev, &vsp1->entities); |
| 344 | } | 344 | } |
| 345 | | 345 | |
| 346 | for (i = 0; i < vsp1->pdata.wpf_count; ++i) { | 346 | for (i = 0; i < vsp1->info->wpf_count; ++i) { |
| 347 | struct vsp1_rwpf *wpf; | 347 | struct vsp1_rwpf *wpf; |
| 348 | | 348 | |
| 349 | wpf = vsp1_wpf_create(vsp1, i); | 349 | wpf = vsp1_wpf_create(vsp1, i); |
| @@ -355,7 +355,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1) · 5 unmodified lines |
| 355 | vsp1->wpf[i] = wpf; | 355 | vsp1->wpf[i] = wpf; |
| 356 | list_add_tail(&wpf->entity.list_dev, &vsp1->entities); | 356 | list_add_tail(&wpf->entity.list_dev, &vsp1->entities); |
| 357 | | 357 | |
| 358 | if (vsp1->pdata.uapi) { | 358 | if (vsp1->info->uapi) { |
| 359 | struct vsp1_video *video = vsp1_video_create(vsp1, wpf); | 359 | struct vsp1_video *video = vsp1_video_create(vsp1, wpf); |
| 360 | | 360 | |
| 361 | if (IS_ERR(video)) { | 361 | if (IS_ERR(video)) { |
| @@ -377,7 +377,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1) · 15 unmodified lines |
| 377 | } | 377 | } |
| 378 | | 378 | |
| 379 | /* Create links. */ | 379 | /* Create links. */ |
| 380 | if (vsp1->pdata.uapi) | 380 | if (vsp1->info->uapi) |
| 381 | ret = vsp1_uapi_create_links(vsp1); | 381 | ret = vsp1_uapi_create_links(vsp1); |
| 382 | else | 382 | else |
| 383 | ret = vsp1_drm_create_links(vsp1); | 383 | ret = vsp1_drm_create_links(vsp1); |
| @@ -387,7 +387,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1) · 3 unmodified lines |
| 387 | /* Register subdev nodes if the userspace API is enabled or initialize | 387 | /* Register subdev nodes if the userspace API is enabled or initialize |
| 388 | * the DRM pipeline otherwise. | 388 | * the DRM pipeline otherwise. |
| 389 | */ | 389 | */ |
| 390 | if (vsp1->pdata.uapi) { | 390 | if (vsp1->info->uapi) { |
| 391 | vsp1->use_dl = false; | 391 | vsp1->use_dl = false; |
| 392 | ret = v4l2_device_register_subdev_nodes(&vsp1->v4l2_dev); | 392 | ret = v4l2_device_register_subdev_nodes(&vsp1->v4l2_dev); |
| 393 | } else { | 393 | } else { |
| @@ -438,7 +438,7 @@ static int vsp1_device_init(struct vsp1_device *vsp1) · 44 unmodified lines |
| 438 | int ret; | 438 | int ret; |
| 439 | | 439 | |
| 440 | /* Reset any channel that might be running. */ | 440 | /* Reset any channel that might be running. */ |
| 441 | for (i = 0; i < vsp1->pdata.wpf_count; ++i) { | 441 | for (i = 0; i < vsp1->info->wpf_count; ++i) { |
| 442 | ret = vsp1_reset_wpf(vsp1, i); | 442 | ret = vsp1_reset_wpf(vsp1, i); |
| 443 | if (ret < 0) | 443 | if (ret < 0) |
| 444 | return ret; | 444 | return ret; |
| @@ -447,10 +447,10 @@ static int vsp1_device_init(struct vsp1_device *vsp1) · 2 unmodified lines |
| 447 | vsp1_write(vsp1, VI6_CLK_DCSWT, (8 << VI6_CLK_DCSWT_CSTPW_SHIFT) | | 447 | vsp1_write(vsp1, VI6_CLK_DCSWT, (8 << VI6_CLK_DCSWT_CSTPW_SHIFT) | |
| 448 | (8 << VI6_CLK_DCSWT_CSTRW_SHIFT)); | 448 | (8 << VI6_CLK_DCSWT_CSTRW_SHIFT)); |
| 449 | | 449 | |
| 450 | for (i = 0; i < vsp1->pdata.rpf_count; ++i) | 450 | for (i = 0; i < vsp1->info->rpf_count; ++i) |
| 451 | vsp1_write(vsp1, VI6_DPR_RPF_ROUTE(i), VI6_DPR_NODE_UNUSED); | 451 | vsp1_write(vsp1, VI6_DPR_RPF_ROUTE(i), VI6_DPR_NODE_UNUSED); |
| 452 | | 452 | |
| 453 | for (i = 0; i < vsp1->pdata.uds_count; ++i) | 453 | for (i = 0; i < vsp1->info->uds_count; ++i) |
| 454 | vsp1_write(vsp1, VI6_DPR_UDS_ROUTE(i), VI6_DPR_NODE_UNUSED); | 454 | vsp1_write(vsp1, VI6_DPR_UDS_ROUTE(i), VI6_DPR_NODE_UNUSED); |
| 455 | | 455 | |
| 456 | vsp1_write(vsp1, VI6_DPR_SRU_ROUTE, VI6_DPR_NODE_UNUSED); | 456 | vsp1_write(vsp1, VI6_DPR_SRU_ROUTE, VI6_DPR_NODE_UNUSED); |
| @@ -567,52 +567,75 @@ static const struct dev_pm_ops vsp1_pm_ops = { · 110 unmodified lines |
| 567 | * Platform Driver | 567 | * Platform Driver |
| 568 | */ | 568 | */ |
| 569 | | 569 | |
| 570 | static int vsp1_parse_dt(struct vsp1_device *vsp1) | 570 | static const struct vsp1_device_info vsp1_device_infos[] = { |
| 571 | { | 571 | { |
| 572 | struct device_node *np = vsp1->dev->of_node; | 572 | .version = VI6_IP_VERSION_MODEL_VSPS_H2, |
| 573 | struct vsp1_platform_data *pdata = &vsp1->pdata; | 573 | .features = VSP1_HAS_BRU | VSP1_HAS_LUT | VSP1_HAS_SRU, |
| 574 | | 574 | .rpf_count = 5, |
| 575 | if (of_property_read_bool(np, "renesas,has-lif")) | 575 | .uds_count = 3, |
| 576 | pdata->features |= VSP1_HAS_LIF; | 576 | .wpf_count = 4, |
| 577 | if (of_property_read_bool(np, "renesas,has-lut")) | 577 | .num_bru_inputs = 4, |
| 578 | pdata->features |= VSP1_HAS_LUT; | 578 | .uapi = true, |
| 579 | if (of_property_read_bool(np, "renesas,has-sru")) | 579 | }, { |
| 580 | pdata->features |= VSP1_HAS_SRU; | 580 | .version = VI6_IP_VERSION_MODEL_VSPR_H2, |
| 581 | | 581 | .features = VSP1_HAS_BRU | VSP1_HAS_SRU, |
| 582 | of_property_read_u32(np, "renesas,#rpf", &pdata->rpf_count); | 582 | .rpf_count = 5, |
| 583 | of_property_read_u32(np, "renesas,#uds", &pdata->uds_count); | 583 | .uds_count = 1, |
| 584 | of_property_read_u32(np, "renesas,#wpf", &pdata->wpf_count); | 584 | .wpf_count = 4, |
| 585 | | 585 | .num_bru_inputs = 4, |
| 586 | if (pdata->rpf_count <= 0 || pdata->rpf_count > VSP1_MAX_RPF) { | 586 | .uapi = true, |
| 587 | dev_err(vsp1->dev, "invalid number of RPF (%u)\n", | 587 | }, { |
| 588 | pdata->rpf_count); | 588 | .version = VI6_IP_VERSION_MODEL_VSPD_GEN2, |
| 589 | return -EINVAL; | 589 | .features = VSP1_HAS_BRU | VSP1_HAS_LIF | VSP1_HAS_LUT, |
| 590 | } | 590 | .rpf_count = 4, |
| 591 | | 591 | .uds_count = 1, |
| 592 | if (pdata->uds_count > VSP1_MAX_UDS) { | 592 | .wpf_count = 4, |
| 593 | dev_err(vsp1->dev, "invalid number of UDS (%u)\n", | 593 | .num_bru_inputs = 4, |
| 594 | pdata->uds_count); | 594 | .uapi = true, |
| 595 | return -EINVAL; | 595 | }, { |
| 596 | } | 596 | .version = VI6_IP_VERSION_MODEL_VSPS_M2, |
| 597 | | 597 | .features = VSP1_HAS_BRU | VSP1_HAS_LUT | VSP1_HAS_SRU, |
| 598 | if (pdata->wpf_count <= 0 || pdata->wpf_count > VSP1_MAX_WPF) { | 598 | .rpf_count = 5, |
| 599 | dev_err(vsp1->dev, "invalid number of WPF (%u)\n", | 599 | .uds_count = 3, |
| 600 | pdata->wpf_count); | 600 | .wpf_count = 4, |
| 601 | return -EINVAL; | 601 | .num_bru_inputs = 4, |
| 602 | } | 602 | .uapi = true, |
| 603 | | 603 | }, { |
| 604 | pdata->features |= VSP1_HAS_BRU; | 604 | .version = VI6_IP_VERSION_MODEL_VSPI_GEN3, |
| 605 | pdata->num_bru_inputs = 4; | 605 | .features = VSP1_HAS_LUT | VSP1_HAS_SRU, |
| 606 | pdata->uapi = true; | 606 | .rpf_count = 1, |
| 607 | | 607 | .uds_count = 1, |
| 608 | return 0; | 608 | .wpf_count = 1, |
| 609 | } | 609 | .uapi = true, |
| | 610 | }, { |
| | 611 | .version = VI6_IP_VERSION_MODEL_VSPBD_GEN3, |
| | 612 | .features = VSP1_HAS_BRU, |
| | 613 | .rpf_count = 5, |
| | 614 | .wpf_count = 1, |
| | 615 | .num_bru_inputs = 5, |
| | 616 | .uapi = true, |
| | 617 | }, { |
| | 618 | .version = VI6_IP_VERSION_MODEL_VSPBC_GEN3, |
| | 619 | .features = VSP1_HAS_BRU | VSP1_HAS_LUT, |
| | 620 | .rpf_count = 5, |
| | 621 | .wpf_count = 1, |
| | 622 | .num_bru_inputs = 5, |
| | 623 | .uapi = true, |
| | 624 | }, { |
| | 625 | .version = VI6_IP_VERSION_MODEL_VSPD_GEN3, |
| | 626 | .features = VSP1_HAS_BRU | VSP1_HAS_LIF | VSP1_HAS_LUT, |
| | 627 | .rpf_count = 5, |
| | 628 | .wpf_count = 2, |
| | 629 | .num_bru_inputs = 5, |
| | 630 | }, |
| | 631 | }; |
| 610 | | 632 | |
| 611 | static int vsp1_probe(struct platform_device *pdev) | 633 | static int vsp1_probe(struct platform_device *pdev) |
| 612 | { | 634 | { |
| 613 | struct vsp1_device *vsp1; | 635 | struct vsp1_device *vsp1; |
| 614 | struct resource *irq; | 636 | struct resource *irq; |
| 615 | struct resource *io; | 637 | struct resource *io; |
| | 638 | unsigned int i; |
| 616 | u32 version; | 639 | u32 version; |
| 617 | int ret; | 640 | int ret; |
| 618 | | 641 | |
| @@ -625,10 +648,6 @@ static int vsp1_probe(struct platform_device *pdev) · 6 unmodified lines |
| 625 | INIT_LIST_HEAD(&vsp1->entities); | 648 | INIT_LIST_HEAD(&vsp1->entities); |
| 626 | INIT_LIST_HEAD(&vsp1->videos); | 649 | INIT_LIST_HEAD(&vsp1->videos); |
| 627 | | 650 | |
| 628 | ret = vsp1_parse_dt(vsp1); | | |
| 629 | if (ret < 0) | | |
| 630 | return ret; | | |
| 631 | | | |
| 632 | /* I/O, IRQ and clock resources */ | 651 | /* I/O, IRQ and clock resources */ |
| 633 | io = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 652 | io = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 634 | vsp1->mmio = devm_ioremap_resource(&pdev->dev, io); | 653 | vsp1->mmio = devm_ioremap_resource(&pdev->dev, io); |
| @@ -662,21 +681,21 @@ static int vsp1_probe(struct platform_device *pdev) · 27 unmodified lines |
| 662 | version = vsp1_read(vsp1, VI6_IP_VERSION); | 681 | version = vsp1_read(vsp1, VI6_IP_VERSION); |
| 663 | clk_disable_unprepare(vsp1->clock); | 682 | clk_disable_unprepare(vsp1->clock); |
| 664 | | 683 | |
| 665 | dev_dbg(&pdev->dev, "IP version 0x%08x\n", version); | 684 | for (i = 0; i < ARRAY_SIZE(vsp1_device_infos); ++i) { |
| | 685 | if ((version & VI6_IP_VERSION_MODEL_MASK) == |
| | 686 | vsp1_device_infos[i].version) { |
| | 687 | vsp1->info = &vsp1_device_infos[i]; |
| | 688 | break; |
| | 689 | } |
| | 690 | } |
| 666 | | 691 | |
| 667 | switch (version & VI6_IP_VERSION_MODEL_MASK) { | 692 | if (!vsp1->info) { |
| 668 | case VI6_IP_VERSION_MODEL_VSPD_GEN3: | 693 | dev_err(&pdev->dev, "unsupported IP version 0x%08x\n", version); |
| 669 | vsp1->pdata.num_bru_inputs = 5; | 694 | return -ENXIO; |
| 670 | vsp1->pdata.uapi = false; | | |
| 671 | break; | | |
| 672 | | | |
| 673 | case VI6_IP_VERSION_MODEL_VSPI_GEN3: | | |
| 674 | case VI6_IP_VERSION_MODEL_VSPBD_GEN3: | | |
| 675 | case VI6_IP_VERSION_MODEL_VSPBC_GEN3: | | |
| 676 | vsp1->pdata.features &= ~VSP1_HAS_BRU; | | |
| 677 | break; | | |
| 678 | } | 695 | } |
| 679 | | 696 | |
| | 697 | dev_dbg(&pdev->dev, "IP version 0x%08x\n", version); |
| | 698 | |
| 680 | /* Instanciate entities */ | 699 | /* Instanciate entities */ |
| 681 | ret = vsp1_create_entities(vsp1); | 700 | ret = vsp1_create_entities(vsp1); |
| 682 | if (ret < 0) { | 701 | if (ret < 0) { |