From patchwork Sat Oct 24 16:20:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 11854881 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB640C5517A for ; Sat, 24 Oct 2020 16:21:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C4042087C for ; Sat, 24 Oct 2020 16:21:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iu8Z1xju" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762058AbgJXQVL (ORCPT ); Sat, 24 Oct 2020 12:21:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759673AbgJXQVH (ORCPT ); Sat, 24 Oct 2020 12:21:07 -0400 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D102C0613CE; Sat, 24 Oct 2020 09:21:07 -0700 (PDT) Received: by mail-io1-xd44.google.com with SMTP id k21so5599588ioa.9; Sat, 24 Oct 2020 09:21:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OJv7OiMikXXMbdvgcciK3mXRtlHAeNlbojgHERZfLF8=; b=iu8Z1xjus9qMOBAGRkQoVxOEo5dixzIfAda1oNH3q/uTowBPj+4jgjWrgR4hP4PiTp gn987eEDXFgxFgoRCQLUkBouNf9VnynQn3fSncMnuLbOHyum6S/NH6Tkb25D6lNEeXJA weaHIeaW55JzyaRuhO3hxjIOMrUWW+clw8VcGTwBO1z9T8bV1y++osrgbkVlBa+xxuyY VUWsy9XH2Lnv11UWbYPVE/t5yRqGzV6zfhk2Gdv1QK9cUZCr4rW0NZkTgGIw8751M4kO nn/jBtG9e5AzpRCPCxmlMzZktXEg7S2K3rT6620P7Jy0bb/i+ec/3jr9RZLs6HhlAEmM /d/A== 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=OJv7OiMikXXMbdvgcciK3mXRtlHAeNlbojgHERZfLF8=; b=XjkX0Jj1DkQfVU9lkwhS/amPg7bUbUMfRe8p7jWPEnqM4zgYKyeV1F3BBvpU2NslgR dRpgcsAHg3o1kTqQZy4kiGPdpDsXsdWk2wlTzvvQ37jjK9X38oA0234dzxuMzBYsUO5a HPqtaxdKIsuUSylHA73EElrbdFD3E8wsfUwdBgFK/9N2b3Axwyyx6xKmH3pWNgMFR5ms bkcMDco3YucL+oegV0aDAj94YITjxU2n0BpktoGQ6VDTFqV6SCYAgW7uFslSijzMKxhC o3sX/rW7drwJ7T5i0XZJv5q2ZnzE/PQ5hvExHdEvhRiHegRnTWzJQVSqcgop8Ae/mGGT ShQQ== X-Gm-Message-State: AOAM530F8hYYmw7z3zUsjWD5u3Yvzs4mc1pwz3dn2GDa56etzLVLsfDT JrTi5coiCfBfTuYRl23ugiH2jOb2Ofoj2A== X-Google-Smtp-Source: ABdhPJx08Goj6W0lkWlmWsvqVP/nNXXTHXEr+AEoTnjdo1c3P/WjyD2cc5el5YPADM15Cm9X1g2NaA== X-Received: by 2002:a05:6602:2ac3:: with SMTP id m3mr5594921iov.105.1603556466474; Sat, 24 Oct 2020 09:21:06 -0700 (PDT) Received: from aford-IdeaCentre-A730.lan ([2601:448:8400:9e8:527:767:b750:2d3c]) by smtp.gmail.com with ESMTPSA id m86sm3028587ilb.44.2020.10.24.09.21.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Oct 2020 09:21:05 -0700 (PDT) From: Adam Ford To: linux-clk@vger.kernel.org Cc: abel.vesa@nxp.com, marex@denx.de, Adam Ford , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rob Herring , Philipp Zabel , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [RFC 1/3] dt-bindings: clock: imx8mn: Add media blk_ctl clock IDs Date: Sat, 24 Oct 2020 11:20:13 -0500 Message-Id: <20201024162016.1003041-2-aford173@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201024162016.1003041-1-aford173@gmail.com> References: <20201024162016.1003041-1-aford173@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org These will be used by the imx8mn for blk_ctl driver. Signed-off-by: Adam Ford Acked-by: Rob Herring --- include/dt-bindings/clock/imx8mn-clock.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/dt-bindings/clock/imx8mn-clock.h b/include/dt-bindings/clock/imx8mn-clock.h index 621ea0e87c67..2baaa2dccfd3 100644 --- a/include/dt-bindings/clock/imx8mn-clock.h +++ b/include/dt-bindings/clock/imx8mn-clock.h @@ -236,4 +236,15 @@ #define IMX8MN_CLK_END 215 +#define IMX8MN_CLK_MEDIA_BLK_CTL_MIPI_DSI_PCLK 0 +#define IMX8MN_CLK_MEDIA_BLK_CTL_MIPI_DSI_CLKREF 1 +#define IMX8MN_CLK_MEDIA_BLK_CTL_MIPI_CSI_PCLK 2 +#define IMX8MN_CLK_MEDIA_BLK_CTL_MIPI_CSI_ACLK 3 +#define IMX8MN_CLK_MEDIA_BLK_CTL_LCDIF_PIXEL 4 +#define IMX8MN_CLK_MEDIA_BLK_CTL_LCDIF_APB 5 +#define IMX8MN_CLK_MEDIA_BLK_CTL_ISI_PROC 6 +#define IMX8MN_CLK_MEDIA_BLK_CTL_ISI_APB 7 +#define IMX8MN_CLK_MEDIA_BLK_CTL_BUS_BLK 8 +#define IMX8MN_CLK_MEDIA_BLK_CTL_END 9 + #endif From patchwork Sat Oct 24 16:20:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 11854879 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 752D2C2D0A3 for ; Sat, 24 Oct 2020 16:21:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3387D2225F for ; Sat, 24 Oct 2020 16:21:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tfZBv9ov" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762093AbgJXQVL (ORCPT ); Sat, 24 Oct 2020 12:21:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762054AbgJXQVK (ORCPT ); Sat, 24 Oct 2020 12:21:10 -0400 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08053C0613D2; Sat, 24 Oct 2020 09:21:10 -0700 (PDT) Received: by mail-io1-xd42.google.com with SMTP id n6so5590739ioc.12; Sat, 24 Oct 2020 09:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DmYNWcDzAnUPRQg3cM/VYh7D0PDE+R8thr7Gr3d/KwY=; b=tfZBv9ovL7BaAq0jTmitzZtsR/oJmh1iNcLpOoLXbe5iQtaGg+bMMJKgd4QQCUf+4k rcplSN/Brn8hN24XiCYmBT4gWCNoAhbYwoChX01fU4modD5ThPhNYuWRxvZb9WTjNBTk TX4BNl4yu+Z0xh37ykOnBrMgH+sBZ3G+7pdNtKAdvdH0C6USE6uRWd1mTYF0AF6sXU1V uzm1b7ksEOy+tg9ul0hLHr5NUNgPgnb2wZe3kX976tsIGqwEfox3mcip+6/2dGfSmeMf LlnJYV69qFQbY4eGvtfnwCkXgssmEIQuyq+dNsvxjB+W75zrOyW4Ym4guhB8X1HJ905a NQlw== 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=DmYNWcDzAnUPRQg3cM/VYh7D0PDE+R8thr7Gr3d/KwY=; b=R2wnGLCXJw+B059dS2DzxpR2ckbDpMRJkr9UmazcLForHjfCgxzrNc5bl9nYJ58m9w oafx0SQyAiTJrhjltqjSaaBu9Zsa2H6mnN0ZhLS9gpnImr8g8ariyVAsONgW7qrloHvK +R/noC/dAPWZBh0HhsPiRD0NLgHYxmvAm5CfW9VntnyR6wNnbpaKzH3GX9Qts34WCehm t1Bp0Cl+kA2cP+YRpHhCGHM0nZ6qEfRUiagKuYhRCnhq/xBNYJPahYOxtT7KUfqrZJLW CcxDurbJqOxxhwWO8WeBJujNloZ9TMA1AFQIaJq0EJ/DaOP90TW4zaMok84FZLG/yug1 /6iw== X-Gm-Message-State: AOAM530kbPl5rW5cEaiVNjOhUq3on4jvmsoW2ZFl7aHOjzq6wysokDQm Nzvdt3nzxca7BewUaSoPETSndTbktGoRKg== X-Google-Smtp-Source: ABdhPJwb9Bt+Lu50N9TRHbiQm7gIzbOuF5p2bweesi4/dxe6M4QdxTY+/Ap91Lw2dZ7Ncpd6hqRRTw== X-Received: by 2002:a02:a384:: with SMTP id y4mr6008244jak.63.1603556468376; Sat, 24 Oct 2020 09:21:08 -0700 (PDT) Received: from aford-IdeaCentre-A730.lan ([2601:448:8400:9e8:527:767:b750:2d3c]) by smtp.gmail.com with ESMTPSA id m86sm3028587ilb.44.2020.10.24.09.21.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Oct 2020 09:21:07 -0700 (PDT) From: Adam Ford To: linux-clk@vger.kernel.org Cc: abel.vesa@nxp.com, marex@denx.de, Adam Ford , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rob Herring , Philipp Zabel , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [RFC 2/3] dt-bindings: reset: imx8mn: Add media blk_ctl reset IDs Date: Sat, 24 Oct 2020 11:20:14 -0500 Message-Id: <20201024162016.1003041-3-aford173@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201024162016.1003041-1-aford173@gmail.com> References: <20201024162016.1003041-1-aford173@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org These will be used by the imx8mn for blk_ctl driver. Signed-off-by: Adam Ford Acked-by: Rob Herring --- include/dt-bindings/reset/imx8mn-reset.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/dt-bindings/reset/imx8mn-reset.h b/include/dt-bindings/reset/imx8mn-reset.h new file mode 100644 index 000000000000..89d402742b96 --- /dev/null +++ b/include/dt-bindings/reset/imx8mn-reset.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (C) 2020 Compass Electronics Group, LLC + */ + +#ifndef DT_BINDING_RESET_IMX8MN_H +#define DT_BINDING_RESET_IMX8MN_H + +#define IMX8MN_MEDIA_BLK_CTL_RESET_MIPI_DSI_PCLK 0 +#define IMX8MN_MEDIA_BLK_CTL_RESET_MIPI_DSI_CLKREF 1 +#define IMX8MN_MEDIA_BLK_CTL_RESET_MIPI_CSI_PCLK 2 +#define IMX8MN_MEDIA_BLK_CTL_RESET_MIPI_CSI_ACLK 3 +#define IMX8MN_MEDIA_BLK_CTL_RESET_LCDIF_PIXEL 4 +#define IMX8MN_MEDIA_BLK_CTL_RESET_LCDIF_APB 5 +#define IMX8MN_MEDIA_BLK_CTL_RESET_ISI_PROC 6 +#define IMX8MN_MEDIA_BLK_CTL_RESET_ISI_APB 7 +#define IMX8MN_MEDIA_BLK_CTL_RESET_BUS_BLK 8 +#define IMX8MN_MEDIA_BLK_CTL_RESET_MIPI_S_RESET 9 +#define IMX8MN_MEDIA_BLK_CTL_RESET_MIPI_M_RESET 10 +#define IMX8MN_MEDIA_BLK_CTL_RESET_NUM 11 + +#endif From patchwork Sat Oct 24 16:20:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 11854883 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A979EC56202 for ; Sat, 24 Oct 2020 16:21:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E4522225F for ; Sat, 24 Oct 2020 16:21:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="grp7qtr2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762135AbgJXQVN (ORCPT ); Sat, 24 Oct 2020 12:21:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762114AbgJXQVM (ORCPT ); Sat, 24 Oct 2020 12:21:12 -0400 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BA40C0613CE; Sat, 24 Oct 2020 09:21:12 -0700 (PDT) Received: by mail-il1-x144.google.com with SMTP id p9so4350521ilr.1; Sat, 24 Oct 2020 09:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4ewdjBL0POYbkyERKt0JClct+9je8sQshxDRVp8rLQk=; b=grp7qtr2IS65QolRALjrQsJ9P4ieJ00Jkto8z93AVi+89gLb2EyxpH4duqYfrlB88j xS5+9PnWswtbQbEV+p7cWVUwxWFSU5zWcnb/kk572hW20TGbMgXBrCTjTdFaR3AedsRh 7DkgJhqzj21vgQrulWIRAaIPjg7oijIg74ozFYKSXuTsuoiHwWCZLlelQzGLJHc0uEYe bwTi+p2P9Q7g5Shzn7SyRJVuxwQU7DVU5z89cMKsA+dNIJM4X6AXplwfA3Thk+uCF4Ac EHvF/95BaoCswI+kSNN2itmSZVDNCC51lmLKpDwP8lIwqc6R2LGGV2ZT7F7Tp01HcPBD +n4Q== 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=4ewdjBL0POYbkyERKt0JClct+9je8sQshxDRVp8rLQk=; b=kPul8zVSQzqiogErtZbiRHmk9WOBQYYX3Af0O+liAAuKrlLiKounjK1SU26dQpsAcP NI7Azb20atoWpdgIxpPXYRqekSIm3H0A05Yrmqhi3o9yNzoi7KqUcej44gLa3GSTuk/o M1ykzoHkgttY3hLIc6SNfXUTbeEWdMH/7uyPcDuyeJwNuC/4+p+4vXiGMt7Ggxsi5gGE 0ln/V65SpRPXUc8h1utubxxjnItzBHNWZeNwfWvo0fE54hWUd6lv6hpnFUB0IjaJFNR/ 2TVVpW3PeQJOl6ZryVCiD3ytFRXCY1SVSeIRYm9JLwG7OvrT44A9pwnocfX/gfgQbB5N lZsg== X-Gm-Message-State: AOAM533Irc+42yjEP4u5SAihCOcDKSwd4mp0vAh/Yxpk4NX5J0xxXAsP T02gQs+E9JrD0uEPUHHwzMsbOh3PSSrUvw== X-Google-Smtp-Source: ABdhPJwi9oUTNHu72wgqV0Xr/QOjUGV/jwHh+j39fq7YVbNK7SRQodB35Gv4NCLo9a7fkGl+GZomsQ== X-Received: by 2002:a92:7112:: with SMTP id m18mr5846165ilc.133.1603556470189; Sat, 24 Oct 2020 09:21:10 -0700 (PDT) Received: from aford-IdeaCentre-A730.lan ([2601:448:8400:9e8:527:767:b750:2d3c]) by smtp.gmail.com with ESMTPSA id m86sm3028587ilb.44.2020.10.24.09.21.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Oct 2020 09:21:09 -0700 (PDT) From: Adam Ford To: linux-clk@vger.kernel.org Cc: abel.vesa@nxp.com, marex@denx.de, Adam Ford , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rob Herring , Philipp Zabel , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [RFC 3/3] clk: imx: Add blk-ctl driver for i.MX8MN Date: Sat, 24 Oct 2020 11:20:15 -0500 Message-Id: <20201024162016.1003041-4-aford173@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201024162016.1003041-1-aford173@gmail.com> References: <20201024162016.1003041-1-aford173@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org This driver is intended to work with the multimedia block which contains display and camera subsystems: LCDIF ISI MIPI CSI MIPI DSI Signed-off-by: Adam Ford --- drivers/clk/imx/clk-blk-ctl-imx8mn.c | 80 ++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/drivers/clk/imx/clk-blk-ctl-imx8mn.c b/drivers/clk/imx/clk-blk-ctl-imx8mn.c new file mode 100644 index 000000000000..917514212270 --- /dev/null +++ b/drivers/clk/imx/clk-blk-ctl-imx8mn.c @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2020 Compass Eletronics Group, LLC + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "clk.h" +#include "clk-blk-ctl.h" + +#define IMX_MEDIA_BLK_CTL_SFT_RSTN 0x0 +#define IMX_MEDIA_BLK_CTL_CLK_EN 0x4 +#define IMX_MEDIA_BLK_CTL_MIPI_RST 0x8 + +static struct imx_blk_ctl_hw imx8mn_media_blk_ctl_hws[] = { + /* clocks */ + IMX_BLK_CTL_CLK_GATE("mipi_dsi_pclk", IMX8MN_CLK_MEDIA_BLK_CTL_MIPI_DSI_PCLK, 0x4, 0, "dsi_core"), + IMX_BLK_CTL_CLK_GATE("mipi_dsi_clkref", IMX8MN_CLK_MEDIA_BLK_CTL_MIPI_DSI_CLKREF, 0x4, 1, "dsi_phy_ref"), + IMX_BLK_CTL_CLK_GATE("mipi_csi_pclk", IMX8MN_CLK_MEDIA_BLK_CTL_MIPI_CSI_PCLK, 0x4, 2, "camera_pixel_clk"), + IMX_BLK_CTL_CLK_GATE("mipi_csi_aclk", IMX8MN_CLK_MEDIA_BLK_CTL_MIPI_CSI_ACLK, 0x4, 3, "media_cam1_pix_root_clk"), + IMX_BLK_CTL_CLK_GATE("lcdif_pixel_clk", IMX8MN_CLK_MEDIA_BLK_CTL_LCDIF_PIXEL, 0x4, 4, "disp_pixel"), + IMX_BLK_CTL_CLK_GATE("lcdif_apb_clk", IMX8MN_CLK_MEDIA_BLK_CTL_LCDIF_APB, 0x4, 5, "disp_apb"), + IMX_BLK_CTL_CLK_GATE("isi_proc_clk", IMX8MN_CLK_MEDIA_BLK_CTL_ISI_PROC, 0x4, 6, "disp_axi_root_clk"), + IMX_BLK_CTL_CLK_GATE("isi_apb_clk", IMX8MN_CLK_MEDIA_BLK_CTL_ISI_APB, 0x4, 7, "disp_apb_root_clk"), + IMX_BLK_CTL_CLK_GATE("bus_blk_clk", IMX8MN_CLK_MEDIA_BLK_CTL_BUS_BLK, 0x4, 8, "disp_axi_root_clk"), + + /* resets */ + IMX_BLK_CTL_RESET(IMX8MN_MEDIA_BLK_CTL_RESET_MIPI_DSI_PCLK, 0, 0), + IMX_BLK_CTL_RESET(IMX8MN_MEDIA_BLK_CTL_RESET_MIPI_DSI_CLKREF, 0, 1), + IMX_BLK_CTL_RESET(IMX8MN_MEDIA_BLK_CTL_RESET_MIPI_CSI_PCLK, 0, 2), + IMX_BLK_CTL_RESET(IMX8MN_MEDIA_BLK_CTL_RESET_MIPI_CSI_ACLK, 0, 3), + IMX_BLK_CTL_RESET(IMX8MN_MEDIA_BLK_CTL_RESET_LCDIF_PIXEL, 0, 4), + IMX_BLK_CTL_RESET(IMX8MN_MEDIA_BLK_CTL_RESET_LCDIF_APB, 0, 5), + IMX_BLK_CTL_RESET(IMX8MN_MEDIA_BLK_CTL_RESET_ISI_PROC, 0, 6), + IMX_BLK_CTL_RESET(IMX8MN_MEDIA_BLK_CTL_RESET_ISI_APB, 0, 7), + IMX_BLK_CTL_RESET(IMX8MN_MEDIA_BLK_CTL_RESET_BUS_BLK, 0, 8), + IMX_BLK_CTL_RESET(IMX8MN_MEDIA_BLK_CTL_RESET_MIPI_S_RESET, 0x8, 16), + IMX_BLK_CTL_RESET(IMX8MN_MEDIA_BLK_CTL_RESET_MIPI_M_RESET, 0x8, 17), +}; + +const struct imx_blk_ctl_dev_data imx8mn_media_blk_ctl_dev_data __initconst = { + .hws = imx8mn_media_blk_ctl_hws, + .hws_num = ARRAY_SIZE(imx8mn_media_blk_ctl_hws), + .clocks_max = IMX8MN_CLK_MEDIA_BLK_CTL_END, + .resets_max = IMX8MN_MEDIA_BLK_CTL_RESET_NUM, + .pm_runtime_saved_regs_num = 3, + .pm_runtime_saved_regs = { + IMX_MEDIA_BLK_CTL_SFT_RSTN, + IMX_MEDIA_BLK_CTL_CLK_EN, + IMX_MEDIA_BLK_CTL_MIPI_RST, + }, +}; + +static const struct of_device_id imx8mn_blk_ctl_of_match[] = { + { + .compatible = "fsl,imx8mn-media-blk-ctl", + .data = &imx8mn_media_blk_ctl_dev_data + }, + { /* Sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx8mn_blk_ctl_of_match); + +static struct platform_driver imx_blk_ctl_driver = { + .probe = imx_blk_ctl_probe, + .driver = { + .name = "imx8mn-blk-ctl", + .of_match_table = of_match_ptr(imx8mn_blk_ctl_of_match), + .pm = &imx_blk_ctl_pm_ops, + }, +}; +module_platform_driver(imx_blk_ctl_driver);