From patchwork Fri Mar 11 14:34:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 12778110 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EEF0C433EF for ; Fri, 11 Mar 2022 14:36:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243998AbiCKOhE (ORCPT ); Fri, 11 Mar 2022 09:37:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349411AbiCKOhB (ORCPT ); Fri, 11 Mar 2022 09:37:01 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 280411C8D9E; Fri, 11 Mar 2022 06:35:57 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 456D1240004; Fri, 11 Mar 2022 14:35:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1647009356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tUV9pToXc97GruDFUILdAEx8PuuZu4dV5AXoi5Yg5kY=; b=OCg9rH7jIUCvz9N3IkVUtWDFo+Fq7PJnwOBs4ZJ63qVflQlRjD5xXd1Aj0oClc3u5bJhJc RhQ+2dQ3bDtH1AMhFiUYKw7Vw5ksTVuAu49bg+y4IAF1bNi5mZKPJSwEp+O7j/TAxFWNw9 HzRz/NpT5gK4ezzvLWigf5AHEsd56Nd85ls9B+qobInxF0xcGoBI3O3C9cufsUTSH3EHWt ijkm9MMfl7j+kqB6cWQmagcrJOWgxNKCj0WJRgF1JisBvWzQzkicVS4/pSyAzqNXACSHoo pEElKKV+v0/a6+dBhtmrLpwJhRXdpXWcnbYZOpcKeKBpUSy+KA/K7glrLlpV0w== From: Paul Kocialkowski To: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Cc: Yong Deng , Paul Kocialkowski , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Laurent Pinchart , Maxime Ripard , Thomas Petazzoni Subject: [PATCH v3 03/46] media: sun6i-csi: Grab bus clock instead of passing it to regmap Date: Fri, 11 Mar 2022 15:34:49 +0100 Message-Id: <20220311143532.265091-4-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220311143532.265091-1-paul.kocialkowski@bootlin.com> References: <20220311143532.265091-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Since the bus clock alone is not enough to get access to the registers, don't pass it to regmap and manage it instead just like the other clocks. Signed-off-by: Paul Kocialkowski --- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 10 ++++++++-- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c index 5fbaa1e99412..dc79f3c14336 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c @@ -827,13 +827,19 @@ static int sun6i_csi_resource_request(struct sun6i_csi_device *csi_dev, if (IS_ERR(io_base)) return PTR_ERR(io_base); - csi_dev->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "bus", io_base, - &sun6i_csi_regmap_config); + csi_dev->regmap = devm_regmap_init_mmio(&pdev->dev, io_base, + &sun6i_csi_regmap_config); if (IS_ERR(csi_dev->regmap)) { dev_err(&pdev->dev, "Failed to init register map\n"); return PTR_ERR(csi_dev->regmap); } + csi_dev->clk_bus = devm_clk_get(&pdev->dev, "bus"); + if (IS_ERR(csi_dev->clk_bus)) { + dev_err(&pdev->dev, "Unable to acquire bus clock\n"); + return PTR_ERR(csi_dev->clk_bus); + } + csi_dev->clk_mod = devm_clk_get(&pdev->dev, "mod"); if (IS_ERR(csi_dev->clk_mod)) { dev_err(&pdev->dev, "Unable to acquire csi clock\n"); diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h index e4e7ac6c869f..356661b413f8 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h @@ -51,6 +51,7 @@ struct sun6i_csi_device { struct sun6i_video video; struct regmap *regmap; + struct clk *clk_bus; struct clk *clk_mod; struct clk *clk_ram; struct reset_control *reset;