From patchwork Thu Jan 24 18:07:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10779817 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D7A0513BF for ; Thu, 24 Jan 2019 18:08:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6178325C3 for ; Thu, 24 Jan 2019 18:08:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B99A632629; Thu, 24 Jan 2019 18:08:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65B9D325C3 for ; Thu, 24 Jan 2019 18:08:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729379AbfAXSIX (ORCPT ); Thu, 24 Jan 2019 13:08:23 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:44370 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729378AbfAXSIW (ORCPT ); Thu, 24 Jan 2019 13:08:22 -0500 Received: by mail-pl1-f196.google.com with SMTP id e11so3234960plt.11 for ; Thu, 24 Jan 2019 10:08:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wXbv4EStlt/WSU+EIZH0OlN5Zo9WGSHjVKnuaGSJ7JI=; b=RXlY0lhBeHHAfn1ZoEusdajsMhzMKtu8DlU+tEnR82ZIZCqeXz6LcVt1IHozsnbtKp afu/I4bhUGnXxfMDmRxvGmplqN8cQw6gBwXY3YE9GMDpdT11tVyftqCsYuE3CLzia+wK JGevvUAuOr8KTHXi/HWznqW37CXxuwGWLsdCE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wXbv4EStlt/WSU+EIZH0OlN5Zo9WGSHjVKnuaGSJ7JI=; b=FjwGwVwBiYR4VFQTzlc3FLqG6L4PlWF4/3jM/uxm8DDkhzI63fD1HPNDXnpj/YcTZl hEHJI+9QMDnouVMDo9Ocsq9NkfgpkZeV7ChHLbc2Zbs2V/6WpAZaoL/x2w41K2576EwI FXPNNhoXYvruWGJiGTE0gDrdOiCF5frxU3+6bOTfUOSyXfYHQOHr5YyNJ31LOgjNZP4x KM9wZIyKKMIxcLZv/Ie8dNy1S8Jj1wJkLw0hr+47h1avBkHImFLaBRsOpnf2R6TXHfSf ZX2G1SCQ0oBMAVBO7YPy7y55DwnTP917KlJT9O5G4yxhXjtX80VsGkCrOcydv02fR+oO Z5YQ== X-Gm-Message-State: AJcUukfYGg3cHKCwyXqznuIOr2KDwtoRcEuUDFkjhNCkzoQUkRwueTiu Imq3eezFlJk9YeUDAvDkIZ3Eng== X-Google-Smtp-Source: ALg8bN5bdO/M10wWvWnvl5qVQWRmF2XjjMq2zxObQuRH7GwYHUUTnLpTB1Sr481ExOEyNaw7/hrmqw== X-Received: by 2002:a17:902:654a:: with SMTP id d10mr7393226pln.324.1548353302040; Thu, 24 Jan 2019 10:08:22 -0800 (PST) Received: from localhost.localdomain ([115.97.179.75]) by smtp.gmail.com with ESMTPSA id k15sm36141551pfb.147.2019.01.24.10.08.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 10:08:21 -0800 (PST) From: Jagan Teki To: Yong Deng , Mauro Carvalho Chehab , Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Rutland Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, devicetree@vger.kernel.org, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v7 1/5] dt-bindings: media: sun6i: Add A64 CSI compatible Date: Thu, 24 Jan 2019 23:37:32 +0530 Message-Id: <20190124180736.28408-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190124180736.28408-1-jagan@amarulasolutions.com> References: <20190124180736.28408-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Allwinner A64 CSI is a single channel time-multiplexed BT.656 protocol interface. Add separate compatible string for A64 since it require explicit change in sun6i_csi driver to update default CSI_SCLK rate. Reviewed-by: Rob Herring Signed-off-by: Jagan Teki Acked-by: Maxime Ripard --- Documentation/devicetree/bindings/media/sun6i-csi.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/media/sun6i-csi.txt b/Documentation/devicetree/bindings/media/sun6i-csi.txt index cc37cf7fd051..0dd540bb03db 100644 --- a/Documentation/devicetree/bindings/media/sun6i-csi.txt +++ b/Documentation/devicetree/bindings/media/sun6i-csi.txt @@ -8,6 +8,7 @@ Required properties: * "allwinner,sun6i-a31-csi" * "allwinner,sun8i-h3-csi" * "allwinner,sun8i-v3s-csi" + * "allwinner,sun50i-a64-csi" - reg: base address and size of the memory-mapped region. - interrupts: interrupt associated to this IP - clocks: phandles to the clocks feeding the CSI From patchwork Thu Jan 24 18:07:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10779819 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F98613BF for ; Thu, 24 Jan 2019 18:08:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82407325C3 for ; Thu, 24 Jan 2019 18:08:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 730CA32629; Thu, 24 Jan 2019 18:08:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11836325C3 for ; Thu, 24 Jan 2019 18:08:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729408AbfAXSIa (ORCPT ); Thu, 24 Jan 2019 13:08:30 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:35764 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729377AbfAXSI2 (ORCPT ); Thu, 24 Jan 2019 13:08:28 -0500 Received: by mail-pl1-f196.google.com with SMTP id p8so3253857plo.2 for ; Thu, 24 Jan 2019 10:08:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UF0ie0AFcUOJKnp5dQnoc9GbuzcXmNAC6ctNdvT/vFI=; b=NDnnVVg9N0w5j1eh1QJCTCPhT7lwbq9Ao11qqMbunE5BM5940dxN0lbptZCCdXzKU5 Z+Fkc6FcGLYcT/+cPt7sbICMX5UtfFR5j+Ie4Sdx+0YKgPE4+2fyzU8QTKl9ZDNFYbZZ wNgxqaNhvZdfWWIGu16fr+eEZkIyMttuBGx+w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UF0ie0AFcUOJKnp5dQnoc9GbuzcXmNAC6ctNdvT/vFI=; b=eyszLWokv0D4Uoz20ehqp698Vl7kF8S27ZMGKgiVLaxnROsu1dER7bdwPZ20MhJaRI JCMYES/H796tpc6O5+xkPZAk8mnTX1h/HVcRVmCKML5/eiBVoyMcP25pCEc8alqm1cpe afRFVyJ2r6hO4paZaWNQN8lXbsuXIR+v6QVUYE9nvkMZHbd7puqJh+wkB/NlVIv2/ccm p9t3sAPqKSZlIr35UFRVDrRF/7yrb8gu+hQzlGBjhAAhyhoztdy/CGy68eD5dDlsqIMV 2mIw8fJrgZo02fAnB+CZjcEgzkPvrjNXR5mkAC0fVJi1KkXH3pk8non+6oPQoWnDvEI8 qOSA== X-Gm-Message-State: AJcUukdNX7bsPnFpQj0bx12hrlDq52Uu57nxq+yDz338BI8sA0SBBlwO V3q6mWwkc35Dy8RaqNHwJQj3MQ== X-Google-Smtp-Source: ALg8bN6gvz0ooTP/Bgag/ZsaxzHTDVYxLlAJYp+VPyEO8INABlTb5oDJjjG601prTqUveq9BY1KhUA== X-Received: by 2002:a17:902:9a07:: with SMTP id v7mr2332887plp.247.1548353308049; Thu, 24 Jan 2019 10:08:28 -0800 (PST) Received: from localhost.localdomain ([115.97.179.75]) by smtp.gmail.com with ESMTPSA id k15sm36141551pfb.147.2019.01.24.10.08.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 10:08:27 -0800 (PST) From: Jagan Teki To: Yong Deng , Mauro Carvalho Chehab , Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Rutland Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, devicetree@vger.kernel.org, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v7 2/5] media: sun6i: Add A64 CSI block support Date: Thu, 24 Jan 2019 23:37:33 +0530 Message-Id: <20190124180736.28408-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190124180736.28408-1-jagan@amarulasolutions.com> References: <20190124180736.28408-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP CSI block in Allwinner A64 has similar features as like in H3, but the default CSI_SCLK rate cannot work properly to drive the connected sensor interface. The tested mod cock rate is 300 MHz and BSP vfe media driver is also using the same rate. Unfortunately there is no valid information about clock rate in manual or any other sources except the BSP driver. so more faith on BSP code, because same has tested in mainline. So, add support for A64 CSI block by setting updated mod clock rate. Signed-off-by: Jagan Teki --- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c index ee882b66a5ea..cd2d33242c17 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -154,6 +155,7 @@ bool sun6i_csi_is_format_supported(struct sun6i_csi *csi, int sun6i_csi_set_power(struct sun6i_csi *csi, bool enable) { struct sun6i_csi_dev *sdev = sun6i_csi_to_dev(csi); + struct device *dev = sdev->dev; struct regmap *regmap = sdev->regmap; int ret; @@ -161,15 +163,20 @@ int sun6i_csi_set_power(struct sun6i_csi *csi, bool enable) regmap_update_bits(regmap, CSI_EN_REG, CSI_EN_CSI_EN, 0); clk_disable_unprepare(sdev->clk_ram); + if (of_device_is_compatible(dev->of_node, "allwinner,sun50i-a64-csi")) + clk_rate_exclusive_put(sdev->clk_mod); clk_disable_unprepare(sdev->clk_mod); reset_control_assert(sdev->rstc_bus); return 0; } + if (of_device_is_compatible(dev->of_node, "allwinner,sun50i-a64-csi")) + clk_set_rate_exclusive(sdev->clk_mod, 300000000); + ret = clk_prepare_enable(sdev->clk_mod); if (ret) { dev_err(sdev->dev, "Enable csi clk err %d\n", ret); - return ret; + goto clk_mod_put; } ret = clk_prepare_enable(sdev->clk_ram); @@ -192,6 +199,9 @@ int sun6i_csi_set_power(struct sun6i_csi *csi, bool enable) clk_disable_unprepare(sdev->clk_ram); clk_mod_disable: clk_disable_unprepare(sdev->clk_mod); +clk_mod_put: + if (of_device_is_compatible(dev->of_node, "allwinner,sun50i-a64-csi")) + clk_rate_exclusive_put(sdev->clk_mod); return ret; } @@ -895,6 +905,7 @@ static const struct of_device_id sun6i_csi_of_match[] = { { .compatible = "allwinner,sun6i-a31-csi", }, { .compatible = "allwinner,sun8i-h3-csi", }, { .compatible = "allwinner,sun8i-v3s-csi", }, + { .compatible = "allwinner,sun50i-a64-csi", }, {}, }; MODULE_DEVICE_TABLE(of, sun6i_csi_of_match); From patchwork Thu Jan 24 18:07:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10779825 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 849AC13B5 for ; Thu, 24 Jan 2019 18:08:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78AD3325C3 for ; Thu, 24 Jan 2019 18:08:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CD093267B; Thu, 24 Jan 2019 18:08:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0138F325C3 for ; Thu, 24 Jan 2019 18:08:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729422AbfAXSIf (ORCPT ); Thu, 24 Jan 2019 13:08:35 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:36749 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729229AbfAXSIe (ORCPT ); Thu, 24 Jan 2019 13:08:34 -0500 Received: by mail-pl1-f195.google.com with SMTP id g9so3250186plo.3 for ; Thu, 24 Jan 2019 10:08:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NEU2q7n4hfFLUiueQNI1eh+ct5ZyqUAqwbpoXVCvd3w=; b=DmmYfIN+j9ZEn9AycYhh+oQLaiMR+WzLL6ulCg8pbm+6zc5hWK3SnV745n8gpHX5yI aWXPeS9W76canA/iD6sWdIDGOidx4AoConbrLTc8kAA+Hzl+jPokuq1XeTTJqd7YQGri fwpq2odXSNDCmVn75UxdLTbuN3oliSA0ZYhYE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NEU2q7n4hfFLUiueQNI1eh+ct5ZyqUAqwbpoXVCvd3w=; b=mQAZTfvXK5v7Q1M+Er9PiQWlw/JoOU3JYmZXfdkCkzbisC0lMpj7TMfauGi2euP8Wc uss52CCZWq5E/BPpkuMlJRcHdp3DcK9qP6WUpbSG+TNHWo64Tvk7VAKF9oqTU5IQK+Qs P/8VeBy5s0DmiLNjKCXZZeEolIqN5NXYVtVe60YNjJ0T8l1p8CnpVHQCjTbDQVNoBs+x soQXsLL/jPGq2mLEkk/gURenLJ3yOcj6GtuRGI+7gEyoHRPd7OfCtTBRvwhEFj/r2qWe ZNC8/cboYnCSRKMwmuz6x5nYxMz1Jg4ocoYatbJHOByjxHr8Nz99MENPekDhgy/0+nB5 UPdA== X-Gm-Message-State: AJcUukdwMwFkheWD89pdIdIcElrQV4Va+aWWjPUR0n4hK4FKv3JDeJfu zlMR7p0BIbbXcscxugpXpvrVrg== X-Google-Smtp-Source: ALg8bN5m1LCpFgDwm/rki6V7Cb60EEp+UcVRffG3MI8h8p1Nqbwy+jaBiydaG6pEp2rSv+/zh5ZrEw== X-Received: by 2002:a17:902:e08b:: with SMTP id cb11mr7603740plb.263.1548353313969; Thu, 24 Jan 2019 10:08:33 -0800 (PST) Received: from localhost.localdomain ([115.97.179.75]) by smtp.gmail.com with ESMTPSA id k15sm36141551pfb.147.2019.01.24.10.08.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 10:08:33 -0800 (PST) From: Jagan Teki To: Yong Deng , Mauro Carvalho Chehab , Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Rutland Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, devicetree@vger.kernel.org, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v7 3/5] arm64: dts: allwinner: a64: Add A64 CSI controller Date: Thu, 24 Jan 2019 23:37:34 +0530 Message-Id: <20190124180736.28408-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190124180736.28408-1-jagan@amarulasolutions.com> References: <20190124180736.28408-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add dts node details for Allwinner A64 CSI controller. A64 CSI has similar features as like in H3, but the CSI_SCLK need to update it to 300MHz than default clock rate. Signed-off-by: Jagan Teki Acked-by: Maxime Ripard --- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi index 839b2ae88583..62fdf850e9e5 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi @@ -558,6 +558,12 @@ interrupt-controller; #interrupt-cells = <3>; + csi_pins: csi-pins { + pins = "PE0", "PE2", "PE3", "PE4", "PE5", "PE6", + "PE7", "PE8", "PE9", "PE10", "PE11"; + function = "csi"; + }; + i2c0_pins: i2c0_pins { pins = "PH0", "PH1"; function = "i2c0"; @@ -925,6 +931,20 @@ status = "disabled"; }; + csi: csi@1cb0000 { + compatible = "allwinner,sun50i-a64-csi"; + reg = <0x01cb0000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_CSI>, + <&ccu CLK_CSI_SCLK>, + <&ccu CLK_DRAM_CSI>; + clock-names = "bus", "mod", "ram"; + resets = <&ccu RST_BUS_CSI>; + pinctrl-names = "default"; + pinctrl-0 = <&csi_pins>; + status = "disabled"; + }; + hdmi: hdmi@1ee0000 { compatible = "allwinner,sun50i-a64-dw-hdmi", "allwinner,sun8i-a83t-dw-hdmi"; From patchwork Thu Jan 24 18:07:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10779823 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 29A4213BF for ; Thu, 24 Jan 2019 18:08:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19B56325C3 for ; Thu, 24 Jan 2019 18:08:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D3EC32629; Thu, 24 Jan 2019 18:08:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5AB5325C3 for ; Thu, 24 Jan 2019 18:08:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729446AbfAXSIk (ORCPT ); Thu, 24 Jan 2019 13:08:40 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:36609 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729421AbfAXSIj (ORCPT ); Thu, 24 Jan 2019 13:08:39 -0500 Received: by mail-pg1-f193.google.com with SMTP id n2so3002295pgm.3 for ; Thu, 24 Jan 2019 10:08:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OOQ/q0ycl2Vhbvj/n8EVpYC4IVJK5DjscGBSfNzrl+U=; b=MBuene0c4uUHb8+Bp3wEZ/+UgAl0anWc87gdaXyJdhvM4FS9sjReofRVil356wMbpl FGat6d4s59SnIDRICsqYL5q5vXvAAbftKuj0X3zBOyfzBwcwp0KQonwmKcR5o+EaF8p4 dpv1LmS3LhFOt+SkdBFRY56ng6FSAQLripWP0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OOQ/q0ycl2Vhbvj/n8EVpYC4IVJK5DjscGBSfNzrl+U=; b=Dve2kP0TEYSj/h6enh/VdQ2kOuceUotLU6mxfL0Ndl3rHJ/M7Rvxv26JewgVaZYd9P Aweoe7xoTjwjTRggivfph5LRci9TDPFvpZNfPopMSgMVsAY0JjoGYCs6KRuMorMhezA6 ubjhOekVTQce8M/BcT8ztf3/PRjDsv/JOFT7n6T/Gd0rrYit5cSGE2KOHTVtoww0CBB7 U2Rn6N0Uc2X/1AcpVB2twatQzRXaQER8LgEbDMVJXVXdA5TXtzbvi8c0VjBUf4XtV8rQ ttxg4+2f8jIR5mPDhNRt5cwTBnPtbfaHRuEyWQm8sEr9/eT0410S8iCw7RWijAxbP0+W 5rzw== X-Gm-Message-State: AJcUukeMjd8pP881aCD77yyiaNlQiBRMpgZPpyWqp2xgojEz04ne9d8x H+mhg3T8vCUnT0XfHBLLnKibfg== X-Google-Smtp-Source: ALg8bN7CyOInddhg3QutLK5b0/l+R6UdRyH0k8FBbS2b83cE70Ch/dT/6+aBiIyPOJ3ccOjd2f/MqA== X-Received: by 2002:a62:32c4:: with SMTP id y187mr7758031pfy.195.1548353319192; Thu, 24 Jan 2019 10:08:39 -0800 (PST) Received: from localhost.localdomain ([115.97.179.75]) by smtp.gmail.com with ESMTPSA id k15sm36141551pfb.147.2019.01.24.10.08.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 10:08:38 -0800 (PST) From: Jagan Teki To: Yong Deng , Mauro Carvalho Chehab , Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Rutland Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, devicetree@vger.kernel.org, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v7 4/5] arm64: dts: allwinner: a64: Add pinmux setting for CSI MCLK on PE1 Date: Thu, 24 Jan 2019 23:37:35 +0530 Message-Id: <20190124180736.28408-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190124180736.28408-1-jagan@amarulasolutions.com> References: <20190124180736.28408-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some camera modules have the SoC feeding a master clock to the sensor instead of having a standalone crystal. This clock signal is generated from the clock control unit and output from the CSI MCLK function of pin PE1. Add a pinmux setting for it for camera sensors to reference. Signed-off-by: Jagan Teki --- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi index 62fdf850e9e5..6e5a608f56f2 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi @@ -564,6 +564,11 @@ function = "csi"; }; + csi_mclk_pin: csi-mclk { + pins = "PE1"; + function = "csi"; + }; + i2c0_pins: i2c0_pins { pins = "PH0", "PH1"; function = "i2c0"; From patchwork Thu Jan 24 18:07:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10779829 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 631581823 for ; Thu, 24 Jan 2019 18:08:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5626A29754 for ; Thu, 24 Jan 2019 18:08:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 492CA306C5; Thu, 24 Jan 2019 18:08:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFB7530696 for ; Thu, 24 Jan 2019 18:08:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729462AbfAXSIq (ORCPT ); Thu, 24 Jan 2019 13:08:46 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:40534 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729459AbfAXSIp (ORCPT ); Thu, 24 Jan 2019 13:08:45 -0500 Received: by mail-pg1-f193.google.com with SMTP id z10so2992612pgp.7 for ; Thu, 24 Jan 2019 10:08:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4/D2cAWnRzrJOJe1TanX2r7wfgl9u+SIbHxZ8xAtowY=; b=Oj30xNCXACwjON7pD0Bgw7Au2iw7v1jMHRdbIy8hx7JhUUGjKhUIHiBQTlRwog6Z4C C1HAgPAPyVaU9BzW531tXzwC5Ti5lmsz47SYdloJMAFsTU+ecMUqXtTMQO81izpEjXYy cbUm/mbqwjj9KilvecdtOlCRc3RJ+N42M+j7w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4/D2cAWnRzrJOJe1TanX2r7wfgl9u+SIbHxZ8xAtowY=; b=XrsGjvLFhqkZeNk399kJgTowSNMkQ+ejdFIKd05fhO49Yc1+6A/M0GtwYVbIfbWrKA /WaG0MryMW1MCZxxmtdkKOe7e6wI30yL4mjXs4HDKWRB+ab2UqSz+H+buOUU+mzTVpQu owpeOtHv7xYYzyeSfBTulyJU/ywHtblxQxdZarLHhtFPHD2M4AXoOefGsSTcNOlLt4HY EuZCLrX/GczdaL1tg8cCZK7JjQjH5E4jzWsLNGUVsAHe9bO9WLfWt0c2SFtZVS0+ys6W vKz4ywnHp7H6NXRdcDwHDrJoB+fChfa9L/2CQ6E1MIynkv58x4U7plucYnMy110An0ty 7Isw== X-Gm-Message-State: AJcUukf90n1Iz4iZYIVBQJkFukC0MdcjN3HahPfPr+cNqRulhpq3ifsT bhWF/fC+pNNP1h9vyBGTmwNMFA== X-Google-Smtp-Source: ALg8bN6jX3zIxrphpAJdpuzJfSXAW87U5y3pOGjqqs4aZnsi2ozeVQfCI4IQpvET60uLq/1DQdj/fA== X-Received: by 2002:a63:2054:: with SMTP id r20mr6808062pgm.328.1548353324624; Thu, 24 Jan 2019 10:08:44 -0800 (PST) Received: from localhost.localdomain ([115.97.179.75]) by smtp.gmail.com with ESMTPSA id k15sm36141551pfb.147.2019.01.24.10.08.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 10:08:43 -0800 (PST) From: Jagan Teki To: Yong Deng , Mauro Carvalho Chehab , Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Rutland Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, devicetree@vger.kernel.org, linux-sunxi@googlegroups.com, Jagan Teki Subject: [DO NOT MERGE] [PATCH v7 5/5] arm64: dts: allwinner: bananapi-m64: Add HDF5640 camera module Date: Thu, 24 Jan 2019 23:37:36 +0530 Message-Id: <20190124180736.28408-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190124180736.28408-1-jagan@amarulasolutions.com> References: <20190124180736.28408-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Bananapi M64 comes with an optional sensor based on the ov5640, add support for it with below pin information. - PE13, PE12 via i2c-gpio bitbanging - CLK_CSI_MCLK as external clock - PE1 as external clock pin muxing - DLDO3 as AVDD supply - ALDO1 as DOVDD supply - ELDO3 as DVDD supply - PE16 gpio for reset pin - PE17 gpio for powerdown pin Signed-off-by: Jagan Teki --- .../dts/allwinner/sun50i-a64-bananapi-m64.dts | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts index 9d0afd7d50ec..c99f66271287 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts @@ -60,6 +60,41 @@ stdout-path = "serial0:115200n8"; }; + i2c-csi { + compatible = "i2c-gpio"; + sda-gpios = <&pio 4 13 GPIO_ACTIVE_HIGH>; /* CSI0-SDA: PE13 */ + scl-gpios = <&pio 4 12 GPIO_ACTIVE_HIGH>; /* CSI0-SCK: PE12 */ + i2c-gpio,delay-us = <5>; + #address-cells = <1>; + #size-cells = <0>; + + ov5640: camera@3c { + compatible = "ovti,ov5640"; + reg = <0x3c>; + pinctrl-names = "default"; + pinctrl-0 = <&csi_mclk_pin>; + clocks = <&ccu CLK_CSI_MCLK>; + clock-names = "xclk"; + + AVDD-supply = <®_dldo3>; + DOVDD-supply = <®_aldo1>; + DVDD-supply = <®_eldo3>; + reset-gpios = <&pio 4 16 GPIO_ACTIVE_LOW>; /* CSI0-RST: PE16 */ + powerdown-gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* CSI0-PWDN: PE17 */ + + port { + ov5640_ep: endpoint { + remote-endpoint = <&csi_ep>; + bus-width = <8>; + hsync-active = <1>; /* Active high */ + vsync-active = <0>; /* Active low */ + data-active = <1>; /* Active high */ + pclk-sample = <1>; /* Rising */ + }; + }; + }; + }; + hdmi-connector { compatible = "hdmi-connector"; type = "a"; @@ -108,6 +143,24 @@ status = "okay"; }; +&csi { + status = "okay"; + + port { + #address-cells = <1>; + #size-cells = <0>; + + csi_ep: endpoint { + remote-endpoint = <&ov5640_ep>; + bus-width = <8>; + hsync-active = <1>; /* Active high */ + vsync-active = <0>; /* Active low */ + data-active = <1>; /* Active high */ + pclk-sample = <1>; /* Rising */ + }; + }; +}; + &dai { status = "okay"; }; @@ -298,6 +351,12 @@ regulator-name = "vcc-wifi"; }; +®_dldo3 { + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-name = "avdd-csi"; +}; + ®_dldo4 { regulator-min-microvolt = <1800000>; regulator-max-microvolt = <3300000>; @@ -315,6 +374,12 @@ regulator-name = "cpvdd"; }; +®_eldo3 { + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-name = "dvdd-csi"; +}; + ®_fldo1 { regulator-min-microvolt = <1200000>; regulator-max-microvolt = <1200000>;