From patchwork Fri Jun 14 19:08:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2723861 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4C9B9C0AB1 for ; Fri, 14 Jun 2013 19:40:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5D05520381 for ; Fri, 14 Jun 2013 19:40:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 328E820369 for ; Fri, 14 Jun 2013 19:40:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752216Ab3FNTj7 (ORCPT ); Fri, 14 Jun 2013 15:39:59 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:58138 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751699Ab3FNTj6 (ORCPT ); Fri, 14 Jun 2013 15:39:58 -0400 Received: from axis700.grange (dslb-188-109-039-013.pools.arcor-ip.net [188.109.39.13]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0Lio4j-1UD8DK2EI9-00cw1M; Fri, 14 Jun 2013 21:09:28 +0200 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id 10CAB40BCA; Fri, 14 Jun 2013 21:08:46 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1UnZMb-0003x7-TX; Fri, 14 Jun 2013 21:08:45 +0200 From: Guennadi Liakhovetski To: linux-media@vger.kernel.org Cc: Laurent Pinchart , Sylwester Nawrocki , Hans Verkuil , linux-sh@vger.kernel.org, Magnus Damm , Sakari Ailus , Prabhakar Lad , Sascha Hauer , Guennadi Liakhovetski Subject: [PATCH v11 13/21] sh-mobile-ceu-driver: support max width and height in DT Date: Fri, 14 Jun 2013 21:08:23 +0200 Message-Id: <1371236911-15131-14-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1371236911-15131-1-git-send-email-g.liakhovetski@gmx.de> References: <1371236911-15131-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:QlFzuaDgnmCgz/5navi3cVmzdiMMLFwEwTlZIEDz+iM LpVsr2vedkYs00yDUaNMWWb0jAfCTBeIytL7pxvOJ+KujZjL/w huCYGLJPDwQyMc0vm9cayN0+H2xei8bELaD00l44qzpbbm+krq 43h+vOS+wKdsC0n1Hr7nVRAuUQR59bgRKBd1dc45WBahT2HIt2 DfMoYaH5oOshuQ+yppC+Ow3rQW9liqTaPUyyltGrfwTlHj2/av OQm+fXGakorNIoRPjvHhqoPF8Dtt4YyQcsv8d2zrZQeMUyzEsA d7OQpli7PGjNb2QO2Yr5vRWwDP7eWglh2vtXLnPC2C8x9BRzqe DWQxjonbvBnDRemG+uGSR97EJzeqf9QPHfySzo7O6Lpnm0RwL3 C3fcmIEUFbHA1+AJNCxxnmNSCax7znkS7M= Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- .../devicetree/bindings/media/sh_mobile_ceu.txt | 18 +++++++++++++++ .../platform/soc_camera/sh_mobile_ceu_camera.c | 23 ++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/sh_mobile_ceu.txt 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 0000000..1ce4e46 --- /dev/null +++ b/Documentation/devicetree/bindings/media/sh_mobile_ceu.txt @@ -0,0 +1,18 @@ +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>; +}; 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 fcc13d8..b0f0995 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) /* TODO: implement per-device bus flags */ if (pcdev->pdata) { - pcdev->max_width = pcdev->pdata->max_width ? : 2560; - pcdev->max_height = pcdev->pdata->max_height ? : 1920; + pcdev->max_width = pcdev->pdata->max_width; + pcdev->max_height = pcdev->pdata->max_height; 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); if (IS_ERR(base)) return PTR_ERR(base);