From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 72027CA9EA0 for ; Fri, 25 Oct 2019 17:57:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3EEDB205F4 for ; Fri, 25 Oct 2019 17:57:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="c0qmNnQs"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="i3MIHeuY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3EEDB205F4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=m6mCwcrnzKuZPRS0dagIWIz17l901pnoLPYwQUs1UE8=; b=c0qmNnQsKrtuDa F1mtVp2eHRy8ovDg68Bm4ppi1Jhjd2ljGt7+2z2twpxm9+Oaxpk8Ut/w2Bch4VPin/Cb9nPIs5anI OcGSBpizBT2JeuTdZ2Q4nGKkgLJc/MuerMEhkx/C7r6GKtoljA2eLC58dqSn9ULSMzvsmgf7584Zu +RR9T4Ws5FVCt9WOWMkD3JJuE6dy8bWuHTiDJ39ivZ4FUZorsw6h6WbGUWjs+A/O51iiWbz17SFV0 cM2rYYIo9GcFBZULQWQ4F7GOV49YsjFsGolLVc5g8o/Ih76f5bpBRd6SXeOC2nPrgDx3xfkXg0KEG SV8TICLnQspFO5YOnv6A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iO3qT-0003if-CP; Fri, 25 Oct 2019 17:57:53 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iO3pk-00033i-JC for linux-arm-kernel@lists.infradead.org; Fri, 25 Oct 2019 17:57:11 +0000 Received: by mail-pg1-x543.google.com with SMTP id u23so2030311pgo.0 for ; Fri, 25 Oct 2019 10:57:08 -0700 (PDT) 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=P3Mki6uub+NAK80E3ntfBcsFK0xNEI4Pl6xkUsSgIeM=; b=i3MIHeuYlYEVmU4821ovZp6xUdW9w+0CO4+t4aQLQryHnwktMguR3UUD+Yd9ZkzbTJ 4iQrMyZXSu1Za0QtBnk0m4NeXcBDnmIdW7LtsfXsM4RHfFgOEWbXEXuvHz130kkxKtiF fH4VjdQ2kJHmdErld9s1DPCCJz7NeHLkpyWIA= 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=P3Mki6uub+NAK80E3ntfBcsFK0xNEI4Pl6xkUsSgIeM=; b=ZcahtQ8LnNT6jNWVQeVq3ZWYGJ+mEZB8gFCwnHn3yzFM04nkuK64h5qNq+UvM8bwuo 6Ddv0bufU4DDQtFmmVh5DTfvwHIccVd0UDedD0A7dJsvkv7xJEFZyiv0JFZ5eYE5dXsQ gdQtKk1mzj/ClxgNS+Pw71pKkPONK6MqUVo6pSr2wcDhKbPVuAp4ufFtlIcNIZjd/9yB KcmNxqNQpmAUwGs2RaQ6pZsqjgQoya3UyNrF5JwajHyE3kj2/zfSOaVU5D1dapHwWp6Q 29wdGIKNI00a6xvrcwb8BAi685tVVmaVGdtmuSzxJVslwIIU1kL1IJuJ9RyhgeO5uDNI 4XaA== X-Gm-Message-State: APjAAAVL4M96p17LowFh1HwYw0lGj/FqhQjslUoveITlkUx3UD/l2+Gj DI5d1fIzQ1DE7EYT++pXQu0yEA== X-Google-Smtp-Source: APXvYqwQDEhpc37JYujaBlS0c+W1Le7LhGIIS5sXpnrhe8K1umdFkvWh0OaUWV5zfFMK68Yte1XnMQ== X-Received: by 2002:a62:58c2:: with SMTP id m185mr6044311pfb.10.1572026227045; Fri, 25 Oct 2019 10:57:07 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.31]) by smtp.gmail.com with ESMTPSA id n15sm2926580pfq.146.2019.10.25.10.57.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 10:57:06 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland Subject: [PATCH v11 4/7] =?UTF-8?q?drm/sun4i:=20dsi:=20Handle=20bus=20cloc?= =?UTF-8?q?k=20explicitly=C2=A0?= Date: Fri, 25 Oct 2019 23:26:22 +0530 Message-Id: <20191025175625.8011-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20191025175625.8011-1-jagan@amarulasolutions.com> References: <20191025175625.8011-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191025_105708_978980_4A9F47AE X-CRM114-Status: GOOD ( 14.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sunxi , Jagan Teki , michael@amarulasolutions.com, linux-amarula@amarulasolutions.com, linux-arm-kernel@lists.infradead.org, Icenowy Zheng Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Usage of clocks are varies between different Allwinner DSI controllers. Clocking in A33 would need bus and mod clocks where as A64 would need only bus clock. To support this kind of clocking structure variants in the same dsi driver, explicit handling of common clock would require since the A64 doesn't need to mention the clock-names explicitly in dts since it support only one bus clock. Also pass clk_id NULL instead "bus" to regmap clock init function since the single clock variants no need to mention clock-names explicitly. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 8c4c541224dd..eacdfcff64ad 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -1109,7 +1109,7 @@ static int sun6i_dsi_probe(struct platform_device *pdev) return PTR_ERR(dsi->regulator); } - dsi->regs = devm_regmap_init_mmio_clk(dev, "bus", base, + dsi->regs = devm_regmap_init_mmio_clk(dev, NULL, base, &sun6i_dsi_regmap_config); if (IS_ERR(dsi->regs)) { dev_err(dev, "Couldn't create the DSI encoder regmap\n"); @@ -1122,6 +1122,12 @@ static int sun6i_dsi_probe(struct platform_device *pdev) return PTR_ERR(dsi->reset); } + dsi->bus_clk = devm_clk_get(dev, NULL); + if (IS_ERR(dsi->bus_clk)) { + dev_err(dev, "Couldn't get the DSI bus clock\n"); + return PTR_ERR(dsi->bus_clk); + } + if (dsi->variant->has_mod_clk) { dsi->mod_clk = devm_clk_get(dev, "mod"); if (IS_ERR(dsi->mod_clk)) { @@ -1196,6 +1202,7 @@ static int __maybe_unused sun6i_dsi_runtime_resume(struct device *dev) } reset_control_deassert(dsi->reset); + clk_prepare_enable(dsi->bus_clk); if (dsi->variant->has_mod_clk) clk_prepare_enable(dsi->mod_clk); @@ -1227,6 +1234,7 @@ static int __maybe_unused sun6i_dsi_runtime_suspend(struct device *dev) if (dsi->variant->has_mod_clk) clk_disable_unprepare(dsi->mod_clk); + clk_disable_unprepare(dsi->bus_clk); reset_control_assert(dsi->reset); regulator_disable(dsi->regulator); -- 2.18.0.321.gffc6fa0e3 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel