From patchwork Thu Dec 20 12:54:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10738863 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 3172B13BF for ; Thu, 20 Dec 2018 12:56:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DCAC287A7 for ; Thu, 20 Dec 2018 12:56:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 119AF28824; Thu, 20 Dec 2018 12:56:16 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B7481287A7 for ; Thu, 20 Dec 2018 12:56:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iJkVrAbakoBZGYa4GZGoYhzeVjlFTZAjchsV3RPdVfw=; b=q614HRfA4IT9K4 mKIMfFdPorKCVW1Z2JsOl3ZO0ZMBTijAz37LjKDo0Z0sFNyOhqf//W/k8RPDxRJRjEDwD9eOpSM7J ojwQ40AweaZpvRnfdt58s7Pq07ROlRm30D8lE0As80aH0sOCJFYxmuUHtz6PH/hvuy1VqEeURdZDm rkNJuh3SEMcXiigJk8CMStUPj2pnsQTBj83qVJy19Su9MThzfXjnXxRkVk/QD4RDCKvsUus427PyC 36M+GLso42jdFeX5EZv8pMqOdw20cQ059r8bIK8FxNAV/hj+x2A8njTv6o9coJCXniXFg7dYWnDyC Gd8Tw7+UqhkIeVrcfSUw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZxrz-0004sc-HJ; Thu, 20 Dec 2018 12:56:07 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZxqv-0002ef-Q8 for linux-arm-kernel@lists.infradead.org; Thu, 20 Dec 2018 12:55:05 +0000 Received: by mail-wm1-x342.google.com with SMTP id m1so1919338wml.2 for ; Thu, 20 Dec 2018 04:54:51 -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=ijpQewihuTYkryQcGkcJM6bC77RlvFBJu2BOUrCOX7wpmLZtlxWifNYRR0lUzzU0ja KOQQVbn4G4RUt/HDMWlzZE4CHNvoYLVU1UEKBwkESj8O7wDrTmPDbEWF40S6leMErK1C 4t/vpBTxsZdwZy4VYe/++247zoVSvvDpJGzsA= 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=JAMfaWZIlLJZPPjU3P9jB6vF7saEeMR3FrG35Dlerd2b5Tj/dwyGIbC3mJ88teqd+i jK9aZ95wFM1BXGx/hK5ErgRilP/Rip3RJxUEXQ7f7bfW9cdE37vAJVKJ2vSRi9koSXCB kINErMJwebSqsAzZ0cd61jnT/jgnAhRNvnDqmwOHWI+fBf/h82TX945oujcwD21nk9fW P1M0IF/S7PcAkFieyGiNIzWDD0g07keakZoYZ9+byQHFGfvBSE92E/IjXk2FEmpFMtEj dNrhptZU5HSmt+O4d+B0n48Iqqu5MKmhYS9Pg8aXP/sff2w7jmr48jFC1SNKZFlI/gHr VSyg== X-Gm-Message-State: AA+aEWZBAQHfjj/G65hGZlpca4VP0xSgELN8PzYJnj16CVAT5FRsxjwJ zTUCtGfnqqofY5a24kE+pjgwYA== X-Google-Smtp-Source: AFSGD/W72Nq2p29nd5Y0/GilNYZEEzruQXAnlDDDKbMN8MsvknsXNocedBbaGuyVhWtp/8Q5+Eby5g== X-Received: by 2002:a1c:ad43:: with SMTP id w64mr11012559wme.32.1545310490011; Thu, 20 Dec 2018 04:54:50 -0800 (PST) Received: from localhost.localdomain (ip-163-240.sn-213-198.clouditalia.com. [213.198.163.240]) by smtp.gmail.com with ESMTPSA id o4sm8732756wrq.66.2018.12.20.04.54.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Dec 2018 04:54:49 -0800 (PST) From: Jagan Teki To: Yong Deng , Mauro Carvalho Chehab , Maxime Ripard , Rob Herring , Mark Rutland , Chen-Yu Tsai , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi , linux-amarula@amarulasolutions.com, Michael Trimarchi Subject: [PATCH v5 1/6] dt-bindings: media: sun6i: Add A64 CSI compatible Date: Thu, 20 Dec 2018 18:24:33 +0530 Message-Id: <20181220125438.11700-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181220125438.11700-1-jagan@amarulasolutions.com> References: <20181220125438.11700-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181220_045501_975842_4D2465AE X-CRM114-Status: GOOD ( 12.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 --- 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 Dec 20 12:54:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10738861 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 D753213BF for ; Thu, 20 Dec 2018 12:55:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C447128824 for ; Thu, 20 Dec 2018 12:55:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7D7128837; Thu, 20 Dec 2018 12:55:54 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 461C628824 for ; Thu, 20 Dec 2018 12:55:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=d1/zUC9GYtFtqiTXtf72R6jRD/j6FOrv6YhQRd6sIf0=; b=SjV5HSBkGTTQpQ oMIMqUnG403q82NxRh5vuYOVt/+X8PpooUh12alSLek8qbYGQL9Exaa3u1p7s2XDYd75p3n9iWUwp Dop5JluJSf3hOr9nqsBAHlAI0qEBBtmzgqt1nuYAGEsx0P7W5cX1c3mHZy8XVzG4sd8wv6A4xm7ac I/Dj02tLEWNd5kDBbHl9IBx/1PPR9HlEVRbpuLr1mgYVLqRTBqWzixNZeepHdvNeO9Pi1D+Hjn1y/ PVyFnDLpum6P6fCdSZdaUu6DAFXhcr4NOG5hZqqTGlUjuFungctdaABLGV8hB7qk1gz2yYW0RdEAa 10a+r/0gI1qbqC5Ael2g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZxri-0004Y9-Jv; Thu, 20 Dec 2018 12:55:50 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZxqv-0002f3-Q3 for linux-arm-kernel@lists.infradead.org; Thu, 20 Dec 2018 12:55:05 +0000 Received: by mail-wm1-x342.google.com with SMTP id c126so2062494wmh.0 for ; Thu, 20 Dec 2018 04:54:52 -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=LrNl3IwBPVoOT7eCSWC64ChhCwwVumPx0DUceWWWdPc=; b=FhO6jXCTAOkYqprrUH7Dbw58ayINikQoRYAxUyV1kYB2NuYTVOokYSscoYmga9gjzL moqAL8CcrMrwkGTO8yZQyHL8JjJb4656N8ZALHqjRWbGpwnmRugK1npX3MtP0dqlYSbe ObVVNsaWJOGtpIJmBtKZzTDWDMlz1aYcq4+Kc= 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=LrNl3IwBPVoOT7eCSWC64ChhCwwVumPx0DUceWWWdPc=; b=XsQcpJUH736AlJYNVcllAxbyRfTtOXuQ33wGRrEhlrS7evCer3qyvNqL/PfxRyNuqX Q+oJ70X67p1saYPOalm+4mXg64hKXGQ4KlyNMpzH978vSUdkl5MJUFeWNuI4i7dc/iug W/NynZIc+DGsGynWjnx2KVWCPyNq9UwB3/Pr0Pe91an6qiJ1PW1rWReJ/H6ebT7w2Jj/ 6atHHkxUCcpLEHgLwXFIB8+gWj1TTBrMBxLDOn9qzURNGfpYyXaSeZuLniKuS6sE52F2 C6jLp4N0wVec3vvsYjyWvXarixWVLcGNrfLs1eGO0qw49DedbI950mI2d9FxCwIylmKO T4Yw== X-Gm-Message-State: AA+aEWbKPD0+8fN/OCsrYRV7fCp6s0kmKc/8BssEFU2hRgcxSNYzMalV itvMer8+rar59f3t3yNJhZaNnCEY+38= X-Google-Smtp-Source: AFSGD/UKw87i2Wm0RwmCPvyi3Kk9owBhff+Eq719ylOELjW2fIA4dcWzoEAsE1KXasnORldqPwfsBg== X-Received: by 2002:a1c:d988:: with SMTP id q130mr11902264wmg.41.1545310491536; Thu, 20 Dec 2018 04:54:51 -0800 (PST) Received: from localhost.localdomain (ip-163-240.sn-213-198.clouditalia.com. [213.198.163.240]) by smtp.gmail.com with ESMTPSA id o4sm8732756wrq.66.2018.12.20.04.54.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Dec 2018 04:54:50 -0800 (PST) From: Jagan Teki To: Yong Deng , Mauro Carvalho Chehab , Maxime Ripard , Rob Herring , Mark Rutland , Chen-Yu Tsai , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi , linux-amarula@amarulasolutions.com, Michael Trimarchi Subject: [PATCH v5 2/6] media: sun6i: Add mod_rate quirk Date: Thu, 20 Dec 2018 18:24:34 +0530 Message-Id: <20181220125438.11700-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181220125438.11700-1-jagan@amarulasolutions.com> References: <20181220125438.11700-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181220_045501_867278_EA9E296A X-CRM114-Status: GOOD ( 16.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Unfortunately default CSI_SCLK rate cannot work properly to drive the connected sensor interface, particularly on few Allwinner SoC's like A64. So, add mod_rate quirk via driver data so-that the respective SoC's which require to alter the default mod clock rate can assign the operating clock rate. Signed-off-by: Jagan Teki --- .../platform/sunxi/sun6i-csi/sun6i_csi.c | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c index ee882b66a5ea..fe002beae09c 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 @@ -28,8 +29,13 @@ #define MODULE_NAME "sun6i-csi" +struct sun6i_csi_variant { + unsigned long mod_rate; +}; + struct sun6i_csi_dev { struct sun6i_csi csi; + const struct sun6i_csi_variant *variant; struct device *dev; struct regmap *regmap; @@ -822,33 +828,43 @@ static int sun6i_csi_resource_request(struct sun6i_csi_dev *sdev, return PTR_ERR(sdev->clk_mod); } + if (sdev->variant->mod_rate) + clk_set_rate_exclusive(sdev->clk_mod, sdev->variant->mod_rate); + sdev->clk_ram = devm_clk_get(&pdev->dev, "ram"); if (IS_ERR(sdev->clk_ram)) { dev_err(&pdev->dev, "Unable to acquire dram-csi clock\n"); - return PTR_ERR(sdev->clk_ram); + ret = PTR_ERR(sdev->clk_ram); + goto err_unprotect_clk; } sdev->rstc_bus = devm_reset_control_get_shared(&pdev->dev, NULL); if (IS_ERR(sdev->rstc_bus)) { dev_err(&pdev->dev, "Cannot get reset controller\n"); return PTR_ERR(sdev->rstc_bus); + goto err_unprotect_clk; } irq = platform_get_irq(pdev, 0); if (irq < 0) { dev_err(&pdev->dev, "No csi IRQ specified\n"); ret = -ENXIO; - return ret; + goto err_unprotect_clk; } ret = devm_request_irq(&pdev->dev, irq, sun6i_csi_isr, 0, MODULE_NAME, sdev); if (ret) { dev_err(&pdev->dev, "Cannot request csi IRQ\n"); - return ret; + goto err_unprotect_clk; } return 0; + +err_unprotect_clk: + if (sdev->variant->mod_rate) + clk_rate_exclusive_put(sdev->clk_mod); + return ret; } /* @@ -871,6 +887,7 @@ static int sun6i_csi_probe(struct platform_device *pdev) sdev->dev = &pdev->dev; /* The DMA bus has the memory mapped at 0 */ sdev->dev->dma_pfn_offset = PHYS_OFFSET >> PAGE_SHIFT; + sdev->variant = of_device_get_match_data(sdev->dev); ret = sun6i_csi_resource_request(sdev, pdev); if (ret) @@ -887,14 +904,19 @@ static int sun6i_csi_remove(struct platform_device *pdev) struct sun6i_csi_dev *sdev = platform_get_drvdata(pdev); sun6i_csi_v4l2_cleanup(&sdev->csi); + if (sdev->variant->mod_rate) + clk_rate_exclusive_put(sdev->clk_mod); return 0; } +static const struct sun6i_csi_variant sun6i_a31_csi = { +}; + 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,sun6i-a31-csi", .data = &sun6i_a31_csi, }, + { .compatible = "allwinner,sun8i-h3-csi", .data = &sun6i_a31_csi, }, + { .compatible = "allwinner,sun8i-v3s-csi", .data = &sun6i_a31_csi, }, {}, }; MODULE_DEVICE_TABLE(of, sun6i_csi_of_match); From patchwork Thu Dec 20 12:54:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10738855 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 F34BC13BF for ; Thu, 20 Dec 2018 12:55:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E113528824 for ; Thu, 20 Dec 2018 12:55:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D59B52882A; Thu, 20 Dec 2018 12:55:31 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4ACA3287A7 for ; Thu, 20 Dec 2018 12:55:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=O8xwtXGitkC6gjl4P5dt9CrC9So48a1NRa4dviN6liQ=; b=DQmicAXSYhAZsK PrT/tmEYaduFOdBCSVTvcyesfi0ai5Oy7oVqLOp1mIK/2+oEuE5mjmPa4FoNlgzOXVJO67BvoS6Fr vy2HRY0ltr5p234X79SPoqJJr+kpTGV+BxBbD4HS+Ep3GOSZFxOm0fMM15UcMwG1WfaWd4LZ5uPV2 dNjgybsyFUHUOGAcWMOZFtdHtmcTCdE9rC+QOhgPxRSIL+f99FOFrvmD1piCsc0PgnM00qdIkcFne yJS3bVTc+gWaHR35gKIcgRYQeXQFok+nOdEi6KcvE6Ct0x3c0usVDNW9GNUQf4a0nPL9dkvqKJipq vsQ5nPwkhOcUsERPS8vA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZxrJ-000473-ST; Thu, 20 Dec 2018 12:55:25 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZxqu-0002fJ-Kk for linux-arm-kernel@lists.infradead.org; Thu, 20 Dec 2018 12:55:04 +0000 Received: by mail-wm1-x341.google.com with SMTP id m22so2066575wml.3 for ; Thu, 20 Dec 2018 04:54:54 -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=XK1+ImY4LqT3mqPXOgRcotLaegAmI6oUTAhBqe9t1Sw=; b=guAKJy0OL6nXtpHu5GU/d99DuxpR0mmuIZemRdWaOszAnuyybtR/sssbywfDKRrNrf DqL8yOLBev+gKWvFdn94peWiE144jfkW0jdSegShXzl3vVX8Veitr4Aov8ON1Mna/ZKG ltr8NR+r0nrJ12xaj2GAHmF2tKLYzb0BjWWpk= 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=XK1+ImY4LqT3mqPXOgRcotLaegAmI6oUTAhBqe9t1Sw=; b=GZHj/gyfY9SsOQ/jGDaZT22uo6l2v+JizQTRs/xfaKpRHl4tGHgQIHf5+1+wUQPL5m yxU/eX7iYXrblaRKa5IBLtQH0VpYB/8sajeYsxbjZN2PvPmqQOOkZ39zbX2mnWJx54gz 4SZTtrZIlq2SrtXZQjoeNMR+hl5CuLwJNbwLzFaTEEOFFN2a1aK6kK27YVn5/tk5A5ge yaqwlvlQxDxRYmqULO/+FzDhCqYrBoxEZhzWViRArtzkhsXQFZe9A+X61muUkwH+Y/LJ 5NjjstDFcvU/blIiw70MyXUHp0WwnflEEF4JmDZeb4nJy9zlTqdaR0nAeDXYWqDyDy4z fK3Q== X-Gm-Message-State: AA+aEWYwZK8jCcu9sHNybaE121LbmE90iYA+N6yjVn0+GYwdhn4IJ1rw Irg4uKpq3IGGEdb1AAI/VecHRw== X-Google-Smtp-Source: AFSGD/VaVhsdOJ+GQeoQ3YRRzS8H1oCRVWa/ZckdcR5C+R9heqHrTZBUjY6lcOQvr2R2zurM9FcrHw== X-Received: by 2002:a1c:a895:: with SMTP id r143mr10839869wme.95.1545310493002; Thu, 20 Dec 2018 04:54:53 -0800 (PST) Received: from localhost.localdomain (ip-163-240.sn-213-198.clouditalia.com. [213.198.163.240]) by smtp.gmail.com with ESMTPSA id o4sm8732756wrq.66.2018.12.20.04.54.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Dec 2018 04:54:52 -0800 (PST) From: Jagan Teki To: Yong Deng , Mauro Carvalho Chehab , Maxime Ripard , Rob Herring , Mark Rutland , Chen-Yu Tsai , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi , linux-amarula@amarulasolutions.com, Michael Trimarchi Subject: [PATCH v5 3/6] media: sun6i: Add A64 CSI block support Date: Thu, 20 Dec 2018 18:24:35 +0530 Message-Id: <20181220125438.11700-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181220125438.11700-1-jagan@amarulasolutions.com> References: <20181220125438.11700-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181220_045500_679921_9CD6D033 X-CRM114-Status: GOOD ( 12.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP CSI block in Allwinner A64 has similar features as like in H3, but default mod clock rate in BSP along with latest mainline testing require to operate it at 300MHz. So, add A64 CSI compatibe along with mod_rate quirk. Signed-off-by: Jagan Teki --- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c index fe002beae09c..48919aabefdb 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c @@ -913,10 +913,15 @@ static int sun6i_csi_remove(struct platform_device *pdev) static const struct sun6i_csi_variant sun6i_a31_csi = { }; +static const struct sun6i_csi_variant sun50i_a64_csi = { + .mod_rate = 300000000, +}; + static const struct of_device_id sun6i_csi_of_match[] = { { .compatible = "allwinner,sun6i-a31-csi", .data = &sun6i_a31_csi, }, { .compatible = "allwinner,sun8i-h3-csi", .data = &sun6i_a31_csi, }, { .compatible = "allwinner,sun8i-v3s-csi", .data = &sun6i_a31_csi, }, + { .compatible = "allwinner,sun50i-a64-csi", .data = &sun50i_a64_csi, }, {}, }; MODULE_DEVICE_TABLE(of, sun6i_csi_of_match); From patchwork Thu Dec 20 12:54:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10738859 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 2EACD746 for ; Thu, 20 Dec 2018 12:55:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B81B28824 for ; Thu, 20 Dec 2018 12:55:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FA4928837; Thu, 20 Dec 2018 12:55: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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AC84728824 for ; Thu, 20 Dec 2018 12:55:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eb99a/fcFfP4br8vZiiZY1EpIbzUXe4UnL1ZSfr+SFc=; b=MjuBX4Snm4Mro5 nGih7bCx5graxN0BCLAR5Kml7DB/aTeJMHpUk3OMKWeKWktebs9RCBwCpWHbYV065Qhxeuu8zMyNW t3EgFs1LQOCDxJSU8UDKFi2Fyr9q9eH1sMvGCpKGYqblJxg+/bUiZ7VI5mh3h9q9PCuZPOVlcKa7h a2k4cHn8an4XqGPUnX0A23sE86UtAzvtTem7AdK7eb56pPk6kOVHpBiryjEzRqimRMtyeYje47qt9 cPU1LoIpO5o1JTYop4KaG4SZMKaxP/PpD9iokYPdpeeIp0SjFCZhHrhq2rrP3hoWkrwAQ9uMN9PrY RB2G6RLDFSHI3E4rDJVA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZxrS-0004ID-MZ; Thu, 20 Dec 2018 12:55:34 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZxqu-0002g1-Ko for linux-arm-kernel@lists.infradead.org; Thu, 20 Dec 2018 12:55:05 +0000 Received: by mail-wm1-x341.google.com with SMTP id p6so2062020wmc.1 for ; Thu, 20 Dec 2018 04:54:57 -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=i+sX38c9cSRrT/+P6z3U+yEFrwV+FCNRU4fj085KJck=; b=KuwjOwszek352TtFJBBl/n/MzUH512/y0qTe+7lojuswGP/Lv1jUTJ+XBHt+h1OjXC Tkidz7Ho42OTctg0z04xNW5UbNEPscNSxUV65OjfFECCb3QGy3mQM5wO+4DPkeYcvjZ4 MqjQ9TS0onrxr8FvALPrJ5IwcnL33MRBhTXk8= 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=i+sX38c9cSRrT/+P6z3U+yEFrwV+FCNRU4fj085KJck=; b=mt1lBk4s7dS8nG0oiYE3CpEulF3eHiyr3yqvcowXbJWgYHFRNNzHM8jI8yakc12t2X 4EOsY+sYxABM2n+C+ns+gM4W8NJwhY3Td249eAq0ydQmCFSU5fziZmvDlV53jblG9hKO GIJoL9ljhyrJ+2UyH9TPFHcRnFKeWte9Om0jMp2ZXSKfPyv4Lm7LvGVBE+5oAXRzsp4i mKWD6VBzq11fidhQDuQgyj1VQp7nse9+Q+7EsG6Bkel4Ws646odn/ZixT7tx9XX9CjDv j+wuEHOyQT8qySTS61cLubtzGc+QQ2D5yW2WTSlzFFKbOHCMRqjcmaM6iXnzw5l7q9J/ iV4g== X-Gm-Message-State: AA+aEWYp/Diu6TPFbCIFR+XmeGgNoQwNw+xu6eHDAE+T/YJ6oZcvN3gp MvRpPgVKfOnA5ho2HI853HsjEZKp7Vg= X-Google-Smtp-Source: AFSGD/UrUUuEeGEqMJRANi0h2sU7UVGWvEG7qvhB+ZIFZAHUbiColEvrk/bJTB3CDLaWfH2J6q5zYw== X-Received: by 2002:a1c:864f:: with SMTP id i76mr11106358wmd.83.1545310496157; Thu, 20 Dec 2018 04:54:56 -0800 (PST) Received: from localhost.localdomain (ip-163-240.sn-213-198.clouditalia.com. [213.198.163.240]) by smtp.gmail.com with ESMTPSA id o4sm8732756wrq.66.2018.12.20.04.54.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Dec 2018 04:54:55 -0800 (PST) From: Jagan Teki To: Yong Deng , Mauro Carvalho Chehab , Maxime Ripard , Rob Herring , Mark Rutland , Chen-Yu Tsai , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi , linux-amarula@amarulasolutions.com, Michael Trimarchi Subject: [PATCH v5 4/6] arm64: dts: allwinner: a64: Add A64 CSI controller Date: Thu, 20 Dec 2018 18:24:36 +0530 Message-Id: <20181220125438.11700-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181220125438.11700-1-jagan@amarulasolutions.com> References: <20181220125438.11700-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181220_045500_684842_74FFA256 X-CRM114-Status: GOOD ( 12.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 --- 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 384c417cb7a2..89a0deb3fe6a 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi @@ -532,6 +532,12 @@ interrupt-controller; #interrupt-cells = <3>; + csi_pins: csi-pins { + pins = "PE0", "PE2", "PE3", "PE4", "PE5", "PE6", + "PE7", "PE8", "PE9", "PE10", "PE11"; + function = "csi0"; + }; + i2c0_pins: i2c0_pins { pins = "PH0", "PH1"; function = "i2c0"; @@ -899,6 +905,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 Dec 20 12:54:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10738871 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 4F7D66C2 for ; Thu, 20 Dec 2018 13:04:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B69E28518 for ; Thu, 20 Dec 2018 13:04:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EACB28521; Thu, 20 Dec 2018 13:04:54 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 99D6A28518 for ; Thu, 20 Dec 2018 13:04:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fU+BgW+nkS9EOw1IZpYvePEQqMgjVzt2N35WmN04GyE=; b=F8NjqArySm6yWX GegqfzqSKQUtvhRAuB2q4llLt5Ed2BishkJGHskqJ2fFpbg/fR0g5067YJwtv0g0hUkoFnKYA/7Wa au/Fs740oKjJ8QeMIcVSaJVT9kuUUiQX43ivIf0t/tbtpQPYjmlCE7hO6wHjiUN9C1XjbF0fF78NM NS0AfkZw372CilowiVU7++9fPJL2lfjtBa6IokJiWvkHdvEvhrRfzAQAY1+uSFPvT0x+d4/czxK9s 0JGR7f8n2fGIfzxRGoeAXEzTUdxHh9UCVDr6LzY1mzRvh5Np6CDV+007HOwaMKgV67gpLqr1YumBp MLcliMsWD7HW5xBmNfWA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZy0S-0008Fi-AO; Thu, 20 Dec 2018 13:04:52 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZxqv-0002gH-Q5 for linux-arm-kernel@lists.infradead.org; Thu, 20 Dec 2018 12:55:06 +0000 Received: by mail-wm1-x342.google.com with SMTP id f81so2047559wmd.4 for ; Thu, 20 Dec 2018 04:54:58 -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=/BsYwI4MGKscqtd4fapjUVq4zzWRiadQNZwYTiXxWLI=; b=BQmZ72bR81ebRCVcxLtWVeYzKIe97gNe16bqUHQEdvrxZ9jQdgduSgzMhZnrpzNDvC 4nLZ7zhSYguQz8KRJjM4qqfx1LBA7ljnIM+D1n9VSLPC5sOrwo92UiUC4iP9URlDtr+a cGKHO0/0xrOVFvYvrjVG1ONqrdH53rHjgH79I= 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=/BsYwI4MGKscqtd4fapjUVq4zzWRiadQNZwYTiXxWLI=; b=rHdkct1/bKD581xoZL/QSX9rqXEZTj2QM5obDQCzXnvs9CjfQVRYqxBsfFMDZXKW7w YPT9mh44IMMCSCGh/p0nxmtFJN8tAKvc1X2Cl/UG0WqrdfJ4EYBD6QOl3O60sF+YC5Or ORYBK0WKNUc8Cr0N/NF9pZTKAjw6orhPfcrBd8pcES6fVECjHP1qlcsBOLLCVyhL+S9a +vI9blMysubM+QyvfeUHLMC0EGXZGORMAKaP3hSOi0hJmheLpoVkZYsm28gBiHg1L/pc us9YGRo7O32XlUy42v6ef05cmIgvP58H96yoN5otdqjYJ2L2EvuY/PzJ5s0ehKEqwU3q B6zA== X-Gm-Message-State: AA+aEWbGk0r4Ec8/U5IU4LyGF6e6laIFynODQd+plymEWc1gnaW52u9k wXMLvPr/AlKgvQWPfrWboVPMFA== X-Google-Smtp-Source: AFSGD/VGbWVzN9KaZCPi1PGk/1YnRjWa3GPXr7KSh29e1qnj/L28l6uVj7KIQwJJENtIrgWqp97lNg== X-Received: by 2002:a1c:a8d2:: with SMTP id r201mr10180319wme.81.1545310497657; Thu, 20 Dec 2018 04:54:57 -0800 (PST) Received: from localhost.localdomain (ip-163-240.sn-213-198.clouditalia.com. [213.198.163.240]) by smtp.gmail.com with ESMTPSA id o4sm8732756wrq.66.2018.12.20.04.54.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Dec 2018 04:54:57 -0800 (PST) From: Jagan Teki To: Yong Deng , Mauro Carvalho Chehab , Maxime Ripard , Rob Herring , Mark Rutland , Chen-Yu Tsai , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi , linux-amarula@amarulasolutions.com, Michael Trimarchi Subject: [PATCH v5 5/6] arm64: dts: allwinner: a64: Add pinmux setting for CSI MCLK on PE1 Date: Thu, 20 Dec 2018 18:24:37 +0530 Message-Id: <20181220125438.11700-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181220125438.11700-1-jagan@amarulasolutions.com> References: <20181220125438.11700-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181220_045501_932260_762021F3 X-CRM114-Status: GOOD ( 12.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 89a0deb3fe6a..dd5740bc3fc9 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi @@ -538,6 +538,11 @@ function = "csi0"; }; + csi_mclk_pin: csi-mclk { + pins = "PE1"; + function = "csi0"; + }; + i2c0_pins: i2c0_pins { pins = "PH0", "PH1"; function = "i2c0"; From patchwork Thu Dec 20 12:54:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10738865 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 6A914746 for ; Thu, 20 Dec 2018 12:56:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57E242881A for ; Thu, 20 Dec 2018 12:56:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4BA2C2882A; Thu, 20 Dec 2018 12:56:42 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 07E3C2881A for ; Thu, 20 Dec 2018 12:56:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OpS2CspzOJGJT4k0n1VkMyEQuG6KY2SbYH7bgV26ZKw=; b=J43cvQYyoMOGHm tRFCeCM4yPk5U2U77N3I7OiT0llgEIXXLZsi13c8UfAwHVmkIc4ldf5zb4oUjpBKEDsjqgoFknbSm 8K6V9z5p9w43BLgY1AZFdTZGfqaUevwFRZBozAU4CFElFahAGsqUV939uNeN8bTixLVaravA0sy4q Ht5dG43bWHE2IFUkf0QcAUK7P+AI4dOLhla3r/bzsfUM7qQU/dtPVwZCHQHFX3Ll2fdtqNpfZ2Rzu bNLXOCXZGtRM6olsZf1I6e47T9TxuVqqy+lBpx2ccSU+A6nTOTcZI7R44ObIasctaTIWMC36aiYNZ Z+YEroF/X4J84E6vEJQA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZxsS-0005IY-2N; Thu, 20 Dec 2018 12:56:36 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZxqv-0002gS-3v for linux-arm-kernel@lists.infradead.org; Thu, 20 Dec 2018 12:55:09 +0000 Received: by mail-wm1-x341.google.com with SMTP id p6so2062253wmc.1 for ; Thu, 20 Dec 2018 04:55:00 -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=jEijnCjicnGILwhFrMB461TXW1hBMByoFGuErMag6m8=; b=OqNkOUfzqgjoQyhejdqh03U9bW5LPxP6cJgHr8DrmmDR6co5LEA1lPNy06CWMa5diC 8HFpmRY/RdxzXB41ICCzKewZhWTyPZrlnYwzNq3wj0342ilCj8mNWFcfeCt97FRX7ZaB rLKfqk5A+199/9SAS+ba0Eomgryl7+N+vUa7w= 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=jEijnCjicnGILwhFrMB461TXW1hBMByoFGuErMag6m8=; b=kEaMlafw5/DL7k7ynPs8FjDcbAb3vDBP0RXrLnWnH+fD7COSM7MAk1jGCBqThprVKC v9NXJYFlA9X33XvWI9JhhTSKCCQN3vHT2nXFKY7oWFaqNvCtcSBK1eDD9Qd7C/14dpsl rGC3qJYoT/PwkoPX8AU8++Ee6/fzTS4Z934NqWLZVWamSNHrgQ4PgibV5XSf7/XNoTTN R7BgM03uEVYsfBH4X+1yUkYftV3J/ZsnJ/zASEjXMaY/yZnRrYLP0rR3mkQm5QYEetfe knMxv4Dhf3yrKVz2Qtm8idJyvwMKXHgJHWvdvkhMq6R51Kef5Vcmtc3DVlC5+fwOIJ66 S+cw== X-Gm-Message-State: AA+aEWb3weoRhAR+2MbM8NqzCLJgU1fJqI2xALC1WbqyEb+tByxGl8yP 5cCQPKcnxLqzI0tPd9cV6ya9clQ3ts4= X-Google-Smtp-Source: AFSGD/UN81KQhKo/d71SW3eqyGyxaLk4UeGQ4qmnRgXdU/jlhJ76DFWvMXnCrFCWNWD5YY4JE/ppJQ== X-Received: by 2002:a1c:f605:: with SMTP id w5mr11781988wmc.116.1545310499216; Thu, 20 Dec 2018 04:54:59 -0800 (PST) Received: from localhost.localdomain (ip-163-240.sn-213-198.clouditalia.com. [213.198.163.240]) by smtp.gmail.com with ESMTPSA id o4sm8732756wrq.66.2018.12.20.04.54.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Dec 2018 04:54:58 -0800 (PST) From: Jagan Teki To: Yong Deng , Mauro Carvalho Chehab , Maxime Ripard , Rob Herring , Mark Rutland , Chen-Yu Tsai , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi , linux-amarula@amarulasolutions.com, Michael Trimarchi Subject: [DO NOT MERGE] [PATCH v5 6/6] arm64: dts: allwinner: bananapi-m64: Add HDF5640 camera module Date: Thu, 20 Dec 2018 18:24:38 +0530 Message-Id: <20181220125438.11700-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181220125438.11700-1-jagan@amarulasolutions.com> References: <20181220125438.11700-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181220_045501_328641_3C59F998 X-CRM114-Status: GOOD ( 13.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 83e30e0afe5b..c185ceec8c81 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"; @@ -106,6 +141,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"; }; @@ -296,6 +349,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>; @@ -313,6 +372,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>;