From patchwork Mon Jan 28 08:58:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10783411 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 BDAA913B4 for ; Mon, 28 Jan 2019 08:59:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADA532A023 for ; Mon, 28 Jan 2019 08:59:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A175F2A025; Mon, 28 Jan 2019 08:59:17 +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 1ED9E2A023 for ; Mon, 28 Jan 2019 08:59:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726672AbfA1I7L (ORCPT ); Mon, 28 Jan 2019 03:59:11 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:44634 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726804AbfA1I7L (ORCPT ); Mon, 28 Jan 2019 03:59:11 -0500 Received: by mail-pl1-f193.google.com with SMTP id e11so7448486plt.11 for ; Mon, 28 Jan 2019 00:59:10 -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=R80ISGMVnhZRl2upLFe3I27brJHngys9Q8b/N3uhZ/M=; b=MOsr+9/dZrj2r3qjZ81FfEyec6T5ulVkdZiXhvyLn7o0S+uiJThV3PH//yyGSA+e52 IcNpd4ktDhmYdArDsxD6tInv8X3YmrxCfS96jzOQFtdvOzMw5+lASERl1hnKParMz2Aj jIYXZhGqD5VqMv+C6r11JdRfTYTgNuYIk1UKc= 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=R80ISGMVnhZRl2upLFe3I27brJHngys9Q8b/N3uhZ/M=; b=ibcTuFQYFn2xUAKlhwmJcFHxClQeUKbDnRR4ljaCu9uLdEO9lie7L21bMX25JDkrIA ABpNZLy6oSh/rm4xBgu8o7TUN6qbC+ox1u29T0sC4KvSfvoaF3r6ryPyXY/eBbiPQmaT Ds3mcWXM+F9k4LWW/z/lwUdzrMzugN+YPtm01eeLlivOHy9h7mOWnEcnO4sXcFJp4xTk 9jiGlB9u67U9j4v4muimFYyavNEkcL4Y8bEasLWCc+adDUmI6lh2U/VzZZjBongDpTBb zZZdOy6WwLRA9zEVNl4XBhmgtMz9hBG1K9nfVKN57AIrcWYAtqe0MTr7JEVhV5on+9Ha 2XTQ== X-Gm-Message-State: AJcUuke7OJ1peB9XT070ZOky49jKZAlMd+dVKg1w8ulq7aVOOS7v7hax AlSc/Fa8zyUgz17GEdXZKc9Kqw== X-Google-Smtp-Source: ALg8bN4De1+KO0yStI4VWCLLvIMbH3xzhX2YVcCCkmA86K9Bl6JrLZrJpwhuY/2Jwjx4zZIqz22IbQ== X-Received: by 2002:a17:902:2a89:: with SMTP id j9mr21296667plb.296.1548665950321; Mon, 28 Jan 2019 00:59:10 -0800 (PST) Received: from localhost.localdomain ([115.97.179.75]) by smtp.gmail.com with ESMTPSA id o189sm60746245pfg.117.2019.01.28.00.59.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 00:59:09 -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 v8 1/5] dt-bindings: media: sun6i: Add A64 CSI compatible Date: Mon, 28 Jan 2019 14:28:43 +0530 Message-Id: <20190128085847.7217-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190128085847.7217-1-jagan@amarulasolutions.com> References: <20190128085847.7217-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. Signed-off-by: Jagan Teki Reviewed-by: Rob Herring 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 Mon Jan 28 08:58:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10783421 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 06CD414E1 for ; Mon, 28 Jan 2019 08:59:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA62B2A080 for ; Mon, 28 Jan 2019 08:59:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEB0E2A082; Mon, 28 Jan 2019 08:59:49 +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 7CEAB2A081 for ; Mon, 28 Jan 2019 08:59:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726852AbfA1I7R (ORCPT ); Mon, 28 Jan 2019 03:59:17 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:47038 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726689AbfA1I7R (ORCPT ); Mon, 28 Jan 2019 03:59:17 -0500 Received: by mail-pf1-f193.google.com with SMTP id c73so7691164pfe.13 for ; Mon, 28 Jan 2019 00:59:16 -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=Z8VDizYWcDBY1PcHiFT6xo+JsUGwxuPfGjOUI9TV1l4=; b=err1FgtmG1fBSLcHxlRaz6SGJImdA51wKAt1OJwEKtO4t9tJyt0upcC1WHVW/0MHzy mHU7hdZ3+mNzWr3RKSL1E+xQrlxnDak4NU7bXWH2Rlf7iMBOEpQhb/rApAYPwILeQWhQ 4XYjp7tei45k0byTsx7cmsb/iOyUqALF3t/Nk= 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=Z8VDizYWcDBY1PcHiFT6xo+JsUGwxuPfGjOUI9TV1l4=; b=Kvj5ZPnX8tmkkvda704NiaqrGH9LWTCMVu3exLMpTTILCy/v6K9SyUAq0Me4lwNNQe uqhjcnwv+TjOlQiyD8a6Uq95BCaoi40f+m90lB1uUfRKb0Uz/nyGnxQhRFX7XPzAL40T hu215FW3u5sf8IY9NtKgqTjvA0Prgxl2YSfLL0+15uNsDLAFXjinucgNF2q+XH2WcRM+ Zmgtb45DNC00VcO0GQQ5WuUAJGnFSzrxzn7BFwS5n3X48J3XUMkWIPEgTFoxKOQc1ncS U6lhOd1/k8xn9HN89nuGFzOAd/ciqgaXlZbnXlP1wjJ1mEIBuOtFsECFJrtp/I5hAar4 FOIQ== X-Gm-Message-State: AJcUukca05W/8RyQGa3ux42RCSk0T/u8fBtREs1lL9Gqd/okefK9gqAZ KBJ2MWisb5iWw53shd6q05WAGw== X-Google-Smtp-Source: ALg8bN5X3V3qfLnvHQjRDN0ccoS2WDEODgCbo7QWrN8XrPBc4OHQ95aJY3DFGiUhN8TOhOhbdkJ41g== X-Received: by 2002:a62:5658:: with SMTP id k85mr20878597pfb.231.1548665956205; Mon, 28 Jan 2019 00:59:16 -0800 (PST) Received: from localhost.localdomain ([115.97.179.75]) by smtp.gmail.com with ESMTPSA id o189sm60746245pfg.117.2019.01.28.00.59.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 00:59:15 -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 v8 2/5] media: sun6i: Add A64 CSI block support Date: Mon, 28 Jan 2019 14:28:44 +0530 Message-Id: <20190128085847.7217-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190128085847.7217-1-jagan@amarulasolutions.com> References: <20190128085847.7217-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 Acked-by: Maxime Ripard --- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c index ee882b66a5ea..5ecdfbf9f6ae 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,6 +163,9 @@ 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; @@ -172,6 +177,9 @@ int sun6i_csi_set_power(struct sun6i_csi *csi, bool enable) return ret; } + 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_ram); if (ret) { dev_err(sdev->dev, "Enable clk_dram_csi clk err %d\n", ret); @@ -191,6 +199,8 @@ int sun6i_csi_set_power(struct sun6i_csi *csi, bool enable) clk_ram_disable: clk_disable_unprepare(sdev->clk_ram); clk_mod_disable: + 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); 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 Mon Jan 28 08:58:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10783413 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 B1B3213B4 for ; Mon, 28 Jan 2019 08:59:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D0052A082 for ; Mon, 28 Jan 2019 08:59:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8ED872A080; Mon, 28 Jan 2019 08:59:24 +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 398DD2A080 for ; Mon, 28 Jan 2019 08:59:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726872AbfA1I7X (ORCPT ); Mon, 28 Jan 2019 03:59:23 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:32825 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726766AbfA1I7W (ORCPT ); Mon, 28 Jan 2019 03:59:22 -0500 Received: by mail-pf1-f194.google.com with SMTP id c123so7735596pfb.0 for ; Mon, 28 Jan 2019 00:59: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=l1wfLgujgeuZczNshXAScoRmDfNsjZImKyg0sqbb6WQ=; b=D9kwqx0+n9UCEQOF57p+dnzkz1HptMTPz1SC40cEyM3KPhhGBbl6551yP3I0ZOa23T SX0gem8k9Ei9bbGuZnolmLw74DFmQCj2P6P/8kjz/Ar+1n1qAELjcfHyuHb69BMt0uKz RcGQyiA5NVQ7FRl6UKZVxSNHlE7zj/dbbnIq8= 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=l1wfLgujgeuZczNshXAScoRmDfNsjZImKyg0sqbb6WQ=; b=GKjmjvMycxL+DPjceFePZwiirUDZ0aBanNpdFz7R7DCOi+6+8EKkEoT+lZikrCUGMn lqbkBKdOpKSFeCT3l+yM50yRiJDgQXh2vlWh9pAdCT77Wy4i2E820LKXRSfz3ZUwrD4G AI63vccVFWYQzjCuV9o5LiZx7k/mm8/blUkuMyEujzBq1Tc8dAIW5X0FFaEOjQ6DidGd pNvU0VxQlEewsfmHcpVgpE2W49RdZdLW8wNRPtVCc8vwdS+BKvT22C0fNyd848MDuabo Y2ESL08rIRpVE303my9xfZqCesq350ia+kbDwtWAgc3OgzB9vsSXhbmh3bwU0myIXRSr C5BA== X-Gm-Message-State: AJcUukfDwL+FClLRdRHbb6LZQrrnVnNbDr3+EveQKU0U+KIi/V91+R6y Ay5pY/PLmimjWJkpzfXjDNR9LsDzwS8= X-Google-Smtp-Source: ALg8bN60G3iWcaN0qeakuA7SmJvk++xY3zrbUBvaL+dEVHIt8C+6GOkIidGzubH/4MW8HhOn5IiEPQ== X-Received: by 2002:a62:b9a:: with SMTP id 26mr21296962pfl.196.1548665961985; Mon, 28 Jan 2019 00:59:21 -0800 (PST) Received: from localhost.localdomain ([115.97.179.75]) by smtp.gmail.com with ESMTPSA id o189sm60746245pfg.117.2019.01.28.00.59.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 00:59: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 v8 3/5] arm64: dts: allwinner: a64: Add A64 CSI controller Date: Mon, 28 Jan 2019 14:28:45 +0530 Message-Id: <20190128085847.7217-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190128085847.7217-1-jagan@amarulasolutions.com> References: <20190128085847.7217-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 Mon Jan 28 08:58:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10783419 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 C9C2613B5 for ; Mon, 28 Jan 2019 08:59:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B94B92A080 for ; Mon, 28 Jan 2019 08:59:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD6942A082; Mon, 28 Jan 2019 08:59:46 +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 4D93E2A080 for ; Mon, 28 Jan 2019 08:59:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726905AbfA1I72 (ORCPT ); Mon, 28 Jan 2019 03:59:28 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:46285 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726682AbfA1I72 (ORCPT ); Mon, 28 Jan 2019 03:59:28 -0500 Received: by mail-pg1-f196.google.com with SMTP id w7so6929730pgp.13 for ; Mon, 28 Jan 2019 00:59:27 -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=HjAx/yy/syL7k3kg3Cnf0ViKI+mtZJZM73x1heLz1ROjdadKjZTw4nvJBRyfZ/GMsg 8RqBV6XpoUxMvQZkXDKugOLWUpUaAq/Y6qqVLH8dD1ULvDqJTNDkuFdzFGmljTaDBr7L esIrTucW7UKms99zqrPP9C4GsALhUGGoOTat4= 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=Ku/qgrJOWC5UbOtFlEmu8kUJjCkzLzAb5tfxm6m9WcuwKmfGIOH41ymWVE2zi7kJK3 jp9DxtZjciRqcJQ7ewvbsLdSV2KrDrA9nvYGXcr9WM5EIBjWus22jb5LaJcmEb1pHR6n 2eEETgJ1ltz9dnv0RmPru79t0yxIvNWOf9fsuGRoOesgUEFc1PiIoy4+FndefkC0wSPM CYw7NK3jTlHtfJ44zIYuL4wGUM+vBp/QYkhhxSf1uWPTnc9dpBSVHX2XHHiaSqtHLJ7c iRNOC3VlvJsbD3uqirqvmmHGx3Vw3ppph710xyL7G4htxZvBEtX69I5+x8uCc+3JjE9q Diyw== X-Gm-Message-State: AJcUukdeu2c/U1tXjEAnf5w5f9NAjoX/TAaMBYjfZ/7xJxhHj7yQcWGJ Zy+aaFgPb/x5wWKLlz+wE13H+w== X-Google-Smtp-Source: ALg8bN5WnA8/3Gmoe64gYSZH3o3zpx1Wuy2p6tBGMQgtlL5ke5xScNqdxLBkTOUXbFArsdzOgJaWaA== X-Received: by 2002:a65:4646:: with SMTP id k6mr18697741pgr.153.1548665967437; Mon, 28 Jan 2019 00:59:27 -0800 (PST) Received: from localhost.localdomain ([115.97.179.75]) by smtp.gmail.com with ESMTPSA id o189sm60746245pfg.117.2019.01.28.00.59.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 00:59:26 -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 v8 4/5] arm64: dts: allwinner: a64: Add pinmux setting for CSI MCLK on PE1 Date: Mon, 28 Jan 2019 14:28:46 +0530 Message-Id: <20190128085847.7217-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190128085847.7217-1-jagan@amarulasolutions.com> References: <20190128085847.7217-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 Mon Jan 28 08:58:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10783417 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 9861613B4 for ; Mon, 28 Jan 2019 08:59:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86C532A080 for ; Mon, 28 Jan 2019 08:59:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A3032A082; Mon, 28 Jan 2019 08:59:41 +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 16F732A080 for ; Mon, 28 Jan 2019 08:59:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726967AbfA1I7e (ORCPT ); Mon, 28 Jan 2019 03:59:34 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:40648 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726947AbfA1I7e (ORCPT ); Mon, 28 Jan 2019 03:59:34 -0500 Received: by mail-pg1-f193.google.com with SMTP id z10so6945107pgp.7 for ; Mon, 28 Jan 2019 00:59:33 -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=ihD3ewVrAikUTwMTeUJGAJABsNnidNEbAc7zA4fsIFN3XpwNpVxlQob/e96ewu93Dr 27vOgzZ5846K7inWW+KCkLeBeaDVaGxoMElWx/nvJNMnP/N61ZG1wlFzIlKw7eQHSrHV D/kbi2et4yXrEd6hpkP35BJJBBB+SizATlHWw= 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=HdIuWfNcEnEY8sTjGWtby74bikp2irLBV1r+OBeSzaN+8IaAx6xFAE3JKUFBDNF/tN jOO2dnN4+SwODLnd/AHH71KTKCQLr+lybmc+fbXNMzjSOxVwrXYGWFkykEfy4Ie1TMD1 RMhFHdnJyQTqFrO9YP0kJId+TjUhar5FYLWXjxkfPNgJez+ZVP4E78oN5HMIjuVH4qsD ugBNAw9BHTHnU8UBZ5dpykpITfZXM4nmm14pjB6+gcDE/7i6s7qErgMA4NnTzdRRDXty 0vuGRo3mkU/tfwQnDMy9vYcZLRokzYhDdemW91fixz9nev67RuW0mQrsS+ZOGdh2wmOG 9BQQ== X-Gm-Message-State: AJcUukehwrHCDvETdEJEtwq5/fn9deLwH+bYOKkV0F2eRBEDEV1+n9I1 uYmxgwexMy8s7e1zI302yc5J9CH+uBs= X-Google-Smtp-Source: ALg8bN6GomtSvg1HWUXrVFlC3Hci0yikM80dh/Ew8uDS1Jprxz1KlfmyABgTvhfLheNkQ5MEv6zMAw== X-Received: by 2002:a62:870e:: with SMTP id i14mr21554533pfe.41.1548665973235; Mon, 28 Jan 2019 00:59:33 -0800 (PST) Received: from localhost.localdomain ([115.97.179.75]) by smtp.gmail.com with ESMTPSA id o189sm60746245pfg.117.2019.01.28.00.59.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 00:59:32 -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 v8 5/5] arm64: dts: allwinner: bananapi-m64: Add HDF5640 camera module Date: Mon, 28 Jan 2019 14:28:47 +0530 Message-Id: <20190128085847.7217-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190128085847.7217-1-jagan@amarulasolutions.com> References: <20190128085847.7217-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>;