From patchwork Fri Mar 12 17:30:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 398789 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 9EA51C4361A for ; Fri, 12 Mar 2021 17:30:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8CEF164F6F for ; Fri, 12 Mar 2021 17:30:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232828AbhCLR35 (ORCPT ); Fri, 12 Mar 2021 12:29:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232768AbhCLR3a (ORCPT ); Fri, 12 Mar 2021 12:29:30 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0473CC061761 for ; Fri, 12 Mar 2021 09:29:30 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id 124-20020a1c00820000b029010b871409cfso16262138wma.4 for ; Fri, 12 Mar 2021 09:29:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ih+4JzrKKCuZh71Wtn2Zri+erbNOfm2jAKfFgRpgVkc=; b=egAsdi3aEW4JZxfk0q5zHzACd74hnAJZW1BhFludF55G4gZE2j1NYj4XudQchPEh9R baHpWh6pmn9rH2KwQ2RxO5iG9mF8GhPkL2w6qFaLF+1JzOH+Topn6nlbT3RC2DCLmAzJ OlfxYfmub7ekNglvK6Oa3xw0MXh7RrJQqGD2X7Z8tq5mTQdt7L5aOO1roK+ewYJG8ruB e47xxHest9c8GDMktwJfWwDItZ+cuzr5xZMYoRspPu1UzSHsjNAsvdpA7kLtp9vuFJPT jRDwXH2ug7Rp0quTdwpSAzAWRNruCxBMQPdzRi6u3MJO5ENsm8rtPBad2XVxR9y8+3OS wh0w== 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=Ih+4JzrKKCuZh71Wtn2Zri+erbNOfm2jAKfFgRpgVkc=; b=tFZ9VxYXNdhhThKPR5BhOXa3IavIAVcWgbTfyZfrLZUN3zYl9k/MwXqfNJpjMJGkmX AkSiHYlx49uTk4bjmAzQnF9nlyCr6KKn9DfScdlOWQ2yZ1InMT2Kpelv6br93gG+S1Gy 7DAPGt12iyAf0+S78tPtpuGbSi/0ZP0Z4zPXriilZccex+cH4BNTXF+vQs2XwRhKXo9+ 4CNgeLanAaOiwlfAtX+82RlbWEAUc0dkfhuvybrJj1wxo5fW3D+7oR44pdNpFTTgU1Vr +Gf9UeppmbTbVfniiLP92qxufv1OrQWuYtG9OYzvXjRnI3BOw0hC3mdpwtijaUglqtQN 8XwQ== X-Gm-Message-State: AOAM533jdc8pCK2UXQ13ZCjFm1z6tcBERzuz2UNPQv7BaZOEAADlT2Ux QC3PBzCLkbXOLGXFz/BV5SUp5g== X-Google-Smtp-Source: ABdhPJwRSEwuDqq64/lvm+Qbi4gd4VY7jWW0YviF6HyCY6LE8OAOeo6fGZpybkDfTpJSM1UNh8DuyA== X-Received: by 2002:a05:600c:224e:: with SMTP id a14mr14029517wmm.57.1615570168760; Fri, 12 Mar 2021 09:29:28 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:28 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 17/25] media: venus: core, pm: Vote for min clk freq during venus boot Date: Fri, 12 Mar 2021 17:30:31 +0000 Message-Id: <20210312173039.1387617-18-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Dikshita Agarwal Vote for min clk frequency for core clks during prepare and enable clocks at boot sequence. Without this the controller clock runs at very low value (9.6MHz) which is not sufficient to boot venus. Signed-off-by: Dikshita Agarwal Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/pm_helpers.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index a23e490b6139..a91dc24de2a4 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -41,10 +41,24 @@ static int core_clks_get(struct venus_core *core) static int core_clks_enable(struct venus_core *core) { const struct venus_resources *res = core->res; + const struct freq_tbl *freq_tbl = core->res->freq_tbl; + unsigned int freq_tbl_size = core->res->freq_tbl_size; + unsigned long freq; unsigned int i; int ret; + if (!freq_tbl) + return -EINVAL; + + freq = freq_tbl[freq_tbl_size - 1].freq; + for (i = 0; i < res->clks_num; i++) { + if (IS_V6(core)) { + ret = clk_set_rate(core->clks[i], freq); + if (ret) + goto err; + } + ret = clk_prepare_enable(core->clks[i]); if (ret) goto err;