aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2012-09-17 06:48:33 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-21 15:25:08 -0400
commit812e8b22ea55218449de310a666dd1ce16f924ed (patch)
tree02a82ccee3b390bb4aeceb9b51f861fbb61af7fe
parentf146e4e79a6f5d457553dfe2ac66b93c7a39f676 (diff)
[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: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--Documentation/devicetree/bindings/media/sh_mobile_ceu.txt18
-rw-r--r--drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c23
2 files changed, 39 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/media/sh_mobile_ceu.txt b/Documentation/devicetree/bindings/media/sh_mobile_ceu.txt
new file mode 100644
index 000000000000..1ce4e46bcbb7
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/sh_mobile_ceu.txt
@@ -0,0 +1,18 @@
1Bindings, specific for the sh_mobile_ceu_camera.c driver:
2 - compatible: Should be "renesas,sh-mobile-ceu"
3 - reg: register base and size
4 - interrupts: the interrupt number
5 - interrupt-parent: the interrupt controller
6 - renesas,max-width: maximum image width, supported on this SoC
7 - renesas,max-height: maximum image height, supported on this SoC
8
9Example:
10
11ceu0: ceu@0xfe910000 {
12 compatible = "renesas,sh-mobile-ceu";
13 reg = <0xfe910000 0xa0>;
14 interrupt-parent = <&intcs>;
15 interrupts = <0x880>;
16 renesas,max-width = <8188>;
17 renesas,max-height = <8188>;
18};
diff --git a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
index fcc13d8eb070..b0f0995fc80b 100644
--- a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
+++ b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
@@ -2116,11 +2116,30 @@ static int sh_mobile_ceu_probe(struct platform_device *pdev)
2116 2116
2117 /* TODO: implement per-device bus flags */ 2117 /* TODO: implement per-device bus flags */
2118 if (pcdev->pdata) { 2118 if (pcdev->pdata) {
2119 pcdev->max_width = pcdev->pdata->max_width ? : 2560; 2119 pcdev->max_width = pcdev->pdata->max_width;
2120 pcdev->max_height = pcdev->pdata->max_height ? : 1920; 2120 pcdev->max_height = pcdev->pdata->max_height;
2121 pcdev->flags = pcdev->pdata->flags; 2121 pcdev->flags = pcdev->pdata->flags;
2122 } 2122 }
2123 2123
2124 if (!pcdev->max_width) {
2125 unsigned int v;
2126 err = of_property_read_u32(pdev->dev.of_node, "renesas,max-width", &v);
2127 if (!err)
2128 pcdev->max_width = v;
2129
2130 if (!pcdev->max_width)
2131 pcdev->max_width = 2560;
2132 }
2133 if (!pcdev->max_height) {
2134 unsigned int v;
2135 err = of_property_read_u32(pdev->dev.of_node, "renesas,max-height", &v);
2136 if (!err)
2137 pcdev->max_height = v;
2138
2139 if (!pcdev->max_height)
2140 pcdev->max_height = 1920;
2141 }
2142
2124 base = devm_ioremap_resource(&pdev->dev, res); 2143 base = devm_ioremap_resource(&pdev->dev, res);
2125 if (IS_ERR(base)) 2144 if (IS_ERR(base))
2126 return PTR_ERR(base); 2145 return PTR_ERR(base);