From: Randy Li Date: Tue, 25 Apr 2017 03:06:06 +0000 (+0800) Subject: video: rockchip: vpu: only use the dev_mode for combo X-Git-Tag: release-20171130_firefly~4^2~669 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a551def232f23f6310efcc2ebb1bdb966875e093;p=firefly-linux-kernel-4.4.55.git video: rockchip: vpu: only use the dev_mode for combo The most of device can get this its running type from the compatible. This property becomes unnecessary. Change-Id: I40ec41b130fac2cadd47d92332d27c58a8c2c9f7 Signed-off-by: Randy Li --- diff --git a/drivers/video/rockchip/vcodec/vcodec_service.c b/drivers/video/rockchip/vcodec/vcodec_service.c index f8b6760e1de9..176514a54109 100644 --- a/drivers/video/rockchip/vcodec/vcodec_service.c +++ b/drivers/video/rockchip/vcodec/vcodec_service.c @@ -2276,7 +2276,22 @@ static int vcodec_subdev_probe(struct platform_device *pdev, data->dev = dev; INIT_WORK(&data->set_work, vpu_set_register_work); - of_property_read_u32(np, "dev_mode", (u32 *)&data->mode); + + switch (pservice->dev_id) { + case VCODEC_DEVICE_ID_VPU: + data->mode = VCODEC_RUNNING_MODE_VPU; + break; + case VCODEC_DEVICE_ID_HEVC: + data->mode = VCODEC_RUNNING_MODE_HEVC; + break; + case VCODEC_DEVICE_ID_RKVDEC: + data->mode = VCODEC_RUNNING_MODE_RKVDEC; + break; + case VCODEC_DEVICE_ID_COMBO: + default: + of_property_read_u32(np, "dev_mode", (u32 *)&data->mode); + break; + } if (pservice->reg_base == 0) { res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -2369,6 +2384,7 @@ static int vcodec_subdev_probe(struct platform_device *pdev, goto err; } } + data->irq_dec = platform_get_irq_byname(pdev, "irq_dec"); if (data->irq_dec > 0) { ret = devm_request_threaded_irq(dev, data->irq_dec,