Commit 812e8b22 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mauro Carvalho Chehab

[media] sh-mobile-ceu-driver: support max width and height in DT

Some CEU implementations have non-standard (larger) maximum supported
width and height values. Add two OF properties to specify them.
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f146e4e7
Bindings, specific for the sh_mobile_ceu_camera.c driver:
- compatible: Should be "renesas,sh-mobile-ceu"
- reg: register base and size
- interrupts: the interrupt number
- interrupt-parent: the interrupt controller
- renesas,max-width: maximum image width, supported on this SoC
- renesas,max-height: maximum image height, supported on this SoC
Example:
ceu0: ceu@0xfe910000 {
compatible = "renesas,sh-mobile-ceu";
reg = <0xfe910000 0xa0>;
interrupt-parent = <&intcs>;
interrupts = <0x880>;
renesas,max-width = <8188>;
renesas,max-height = <8188>;
};
...@@ -2116,11 +2116,30 @@ static int sh_mobile_ceu_probe(struct platform_device *pdev) ...@@ -2116,11 +2116,30 @@ static int sh_mobile_ceu_probe(struct platform_device *pdev)
/* TODO: implement per-device bus flags */ /* TODO: implement per-device bus flags */
if (pcdev->pdata) { if (pcdev->pdata) {
pcdev->max_width = pcdev->pdata->max_width ? : 2560; pcdev->max_width = pcdev->pdata->max_width;
pcdev->max_height = pcdev->pdata->max_height ? : 1920; pcdev->max_height = pcdev->pdata->max_height;
pcdev->flags = pcdev->pdata->flags; pcdev->flags = pcdev->pdata->flags;
} }
if (!pcdev->max_width) {
unsigned int v;
err = of_property_read_u32(pdev->dev.of_node, "renesas,max-width", &v);
if (!err)
pcdev->max_width = v;
if (!pcdev->max_width)
pcdev->max_width = 2560;
}
if (!pcdev->max_height) {
unsigned int v;
err = of_property_read_u32(pdev->dev.of_node, "renesas,max-height", &v);
if (!err)
pcdev->max_height = v;
if (!pcdev->max_height)
pcdev->max_height = 1920;
}
base = devm_ioremap_resource(&pdev->dev, res); base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base)) if (IS_ERR(base))
return PTR_ERR(base); return PTR_ERR(base);
......
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