From patchwork Sun May 10 16:55:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11539817 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 75B9D15E6 for ; Mon, 11 May 2020 07:18:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 54328207FF for ; Mon, 11 May 2020 07:18:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="moB/WcAp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54328207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8E02A6E23B; Mon, 11 May 2020 07:17:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 421D289FDB for ; Sun, 10 May 2020 16:55:55 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id j5so7964486wrq.2 for ; Sun, 10 May 2020 09:55:55 -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=UGtRSx0M1H2sciVoOm/cuTNsMxGSi9E0CIv7gSphJdg=; b=moB/WcApqXpplDXdnr9T7REGok5c63lnlOe5MLGjckrRBKnIWwEiMeEqNq/Ku2Ixgl a5aUidJAP1BSgquxga6sidNtyZ00U5NR7JLvdS7UoPuhDqQliDguzuxc3BZGJmuVExqE JgSYBt7oDjmW88qF4l+dKQOaswcczrNLYT37B9AU+xFEftA4Rhr1FmCmBPOgfj9fN9wZ WEvROQktO7JyOqpEtW83RPd54M3mn1roeo8boJgOrG0Bik7OTKB0QsWU0Nn9s57rdlqw KeH2TaiHbx1LmzzDyWoyeEy7Bkj66NcNiwwjRg9XUXY3lufrrYj0LV7V3QqXB5ZSOBCL XQuQ== 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=UGtRSx0M1H2sciVoOm/cuTNsMxGSi9E0CIv7gSphJdg=; b=EyzARJ+2bgMIia+QMK+HMWexd1uKiqCb3v9/n56gO0wVbtXyguEjxdtS2F8VZoBFGa jpb3032EyhTYkFT9Z0qQFDvje1SiBPkFSQVziUYNTJiw0rnqYuHPtkJAd5rTCRVO6553 bW6zlNtw7ogpSWjvp/Mkes01YZfylYoY5sPyOetH6Aroky4CMEn4DfKNtABwBpElFaB4 fpYXzSLlBIXlLaTaWcDbK+7gnc4bI6JUf0P2SdRF1Rbpmg81PKYxVZjTQeH2X2+6xdiF j8htezqRxsgSWaEKAEn4nl5Pv0EcqeN8gWM0VDUSoklQiObQIrMmpwfhhV7hPdygNNu2 a5Eg== X-Gm-Message-State: AGi0PuZdO+N0wmYLKua6d3r/Rd7ma/eNlZNe+nKjrNbPOID8AkUrd/DY 3GsCP4sCVolRsIH1o9330jY= X-Google-Smtp-Source: APiQypJb2TSWzqq6njqmcEA/TOqYHZSFpZoZ7VDbi6n/FR3lppFw2NBiQ/cKffersHlcaOfO6TPUTg== X-Received: by 2002:adf:a118:: with SMTP id o24mr13650480wro.330.1589129753836; Sun, 10 May 2020 09:55:53 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0:1cc8:b1f1:a2b8:a1ee]) by smtp.gmail.com with ESMTPSA id g15sm13637670wrp.96.2020.05.10.09.55.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 09:55:53 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 11/15] drm/panfrost: set devfreq clock name Date: Sun, 10 May 2020 18:55:34 +0200 Message-Id: <20200510165538.19720-12-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200510165538.19720-1-peron.clem@gmail.com> References: <20200510165538.19720-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 11 May 2020 07:17:27 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Some SoCs have several clocks defined and the OPP core needs to know the exact name of the clk to use. Set the clock name to "core". Signed-off-by: Clément Péron --- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 13 +++++++++++++ drivers/gpu/drm/panfrost/panfrost_devfreq.h | 1 + 2 files changed, 14 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c index 9ffea0d4a087..6bf3541b4d53 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c @@ -103,6 +103,14 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) spin_lock_init(&pfdevfreq->lock); + opp_table = dev_pm_opp_set_clkname(dev, "core"); + if (IS_ERR(opp_table)) { + ret = PTR_ERR(opp_table); + goto err_fini; + } + + pfdevfreq->clkname_opp_table = opp_table; + opp_table = dev_pm_opp_set_regulators(dev, pfdev->comp->supply_names, pfdev->comp->num_supplies); if (IS_ERR(opp_table)) { @@ -176,6 +184,11 @@ void panfrost_devfreq_fini(struct panfrost_device *pfdev) dev_pm_opp_put_regulators(pfdevfreq->regulators_opp_table); pfdevfreq->regulators_opp_table = NULL; } + + if (pfdevfreq->clkname_opp_table) { + dev_pm_opp_put_clkname(pfdevfreq->clkname_opp_table); + pfdevfreq->clkname_opp_table = NULL; + } } void panfrost_devfreq_resume(struct panfrost_device *pfdev) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.h b/drivers/gpu/drm/panfrost/panfrost_devfreq.h index 347cde4786cf..1f2475e1d034 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.h +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.h @@ -16,6 +16,7 @@ struct panfrost_device; struct panfrost_devfreq { struct devfreq *devfreq; struct opp_table *regulators_opp_table; + struct opp_table *clkname_opp_table; struct thermal_cooling_device *cooling; bool opp_of_table_added;