Received: by 2002:ab2:6991:0:b0:1f2:fff1:ace7 with SMTP id v17csp270499lqo; Wed, 27 Mar 2024 12:28:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVYxl+jRMHxYMmYdcTT2AGNLlX1fTpgzhoxxjBC0B8pa3LhMDfxtV3+1Uz5RYrcsh+26jK7FnPCwT/iEcNoCWKdzU1V4jKUwFnVPXzJMw== X-Google-Smtp-Source: AGHT+IFYvUNFg8eDqijYOVi9r1pU7ZbZZSnGhWhQFUKKfzwh0pMIMHTMxjKF22ZUfyxgPdhF8i22 X-Received: by 2002:a05:6512:32b7:b0:515:a66b:9302 with SMTP id q23-20020a05651232b700b00515a66b9302mr316478lfe.44.1711567684379; Wed, 27 Mar 2024 12:28:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711567684; cv=pass; d=google.com; s=arc-20160816; b=a+vJ7IyEdwWlesZVPyqc7prIu83rukcLmY0P49Ym+4PDW3jrvPhNltrCMH3T22t21F siQ3hEKF1nZ7fWKwfBTvj46kxZInuKgrBE4bGDRHED0ox731KCDEUQWjyz/AzS2+mhNv P+ql1F0fFpxkXNA/WNe4F5X65h8CKwlRj+0IJJl45thf2ti7vR7UtbXlZvGavl9AUEST urRBBdZ1vjfX7GCUCG0evesCDdy/prRTcBHOvhob2lWRUCPkeWs9kd77bT+XGO4sV66r QRCcCQV77FnArInb6BX7RBDZNZMQfWsIKWQfUiP0ywL00RgJZtIweyCbaJVMmk/NoCM5 QWjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=v0yrZ/yWAaXgHD2Ul0KN3dDIRFMbDzRG8DuMRaqz9/s=; fh=dow72pzQOZLKrdfKRQTk/xccM4Gf6lBAYtNMtDRvoWc=; b=vbLi32Fji+EHAJ2uFMVr/M2yBvlhluZ7SuWjkiQ0xU/Ywuhd9bTOdb2kAm0JUF41CY ThlEkJuDXGZuUWpzmT+QDXNT6UxiLEDlkRn2jesEbni/QeJZtT9HNuxnlbGg1vkczipf CXCuP3qkZT0YXSbi4FQJvnTdRHxv+PGJrrYoggE+KbgpfkFRosEwdaXOG8oLeSKzazyD /rCbe3iNxz5DGPQJ94IvNNR8hHzNbQp0Qssre5MeFZDdfm6bmfkhidHdbvgw1xEwVWNe BrNUwPFV6D4igQiLKZu/QtwzYcpcW3B6Tzouqwh68NxKnyIsVVR37GxZc/c2YVMoKX7O +SfA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GBwGLLRV; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-121792-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121792-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gt37-20020a1709072da500b00a4df3e5e6b1si2077335ejc.802.2024.03.27.12.28.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 12:28:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-121792-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GBwGLLRV; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-121792-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121792-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3B5051F38CF4 for ; Wed, 27 Mar 2024 18:10:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C212414EC5E; Wed, 27 Mar 2024 18:09:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GBwGLLRV" Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8AE0152171 for ; Wed, 27 Mar 2024 18:08:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711562940; cv=none; b=GgKQAoE1SX0QUn53yKw1zVmzy7UfG9O+a1GypFs3wUCpzHktTcSIITdZ0SkqXpmicpFLskG6cYiuF0bhZ4GJtXzqj5FHkKuTkAvUWNd+/mqE9M0fXTfhr3jXEycgnBQKCqCDqQNHu8Ojfyh45NBErSQKdndwM2OZNP9XqoclS00= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711562940; c=relaxed/simple; bh=6kdN4bIMMHrZ4SMvrh49Lrd228bzKlbevJXjeVijEjQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iaBL7W6OeZfHRnNN8S82FEeWcEk1UxjDUyA7bOe3xIsd1UswbSE2tW6UvfPgd+B+Dw5CG6gepzAws5EU5kUGPO8/xsw8H1g1Bs8jSeE3ErXR270VdmCxEpIH3OqXIuch2ifaaY8IMgnAgOOYQpuEJz7+uigg7NjyVpMnBPTcGQY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=GBwGLLRV; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a4e0a65f37bso16186766b.0 for ; Wed, 27 Mar 2024 11:08:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711562937; x=1712167737; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=v0yrZ/yWAaXgHD2Ul0KN3dDIRFMbDzRG8DuMRaqz9/s=; b=GBwGLLRVa8m6haSMEvTbNMUkL+jjFKL1nLdGPKrjVMdQ7IuHF0X1XFCJE3zPGpM3Ot FEmV6og7SF1IGUFD9WjJbppOdbsFc5L2K/JQ8ITxfMCM9uU5tjsw+8rXhHK0QhriNghA ypb1jJLHO7J7PQ8ODXfm/+jAwce+o1obZNKZuVpTy4FY466I9Si+F8M29c9YCvLCvd3k 6ET/cSTJPnatZECwzj7vkKh61qRDyu3T1is+jCBCpFU0ravcTN+SmChpfaOrW5iJJbGE XCAPxhKGYaU4zrzBj+fF/xvoKuj+bHy2urubtkztofEJjSkH1VRu+H1VPqxSy0vdrJDZ s5BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711562937; x=1712167737; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v0yrZ/yWAaXgHD2Ul0KN3dDIRFMbDzRG8DuMRaqz9/s=; b=FEqZQRQh0f+Q5PQ41cIAQN6ZTnsA9U/IxqPKMlaj8L0GIveihHcwJ+LRDL3V5qNqUz ZFEPxZlYZc92b0qyzqClOj4NoaqsMteBrda5UBTtgl2t9/91A2g1blTtqnce3uV/4y58 zUD0v6SBDPszXgcoDWOXjvZ5FhhdWjFnj8jyLI2hAFyADtU0bI4Oe9NP8YP994NeLnaf gq6L8U8AvDthmVmqo4OhayfuAV/p7IHcYu9Eozn/pPGHpcd/au8Wk9lbdndSdCe8SfMz SQvmQw+rwupuUByijYEybAhjZXpmDsH8tPKIrgLYN52TKHyYbhl6SijPmlQSbSx5NumB Ij7A== X-Forwarded-Encrypted: i=1; AJvYcCVEeTtIhkbUBsXRUhnLTr5smixKaeGVxrdD91d1xtXCe9v+E9yLR+3jKBbvOQ6MJz6xPxhg2iXeuizCwNrOr5uWyxyWUbQNNM1YtHxz X-Gm-Message-State: AOJu0Yw3X5VwENhDX7zayar7ew1RT7ivmtu0W8GB+wayTkjYC7fZ/iPF oL7CO91aLUc27svkjsGbUHGmihd80XHlpcXRH4g62FEhaPoZr1djOc5NdYeHve4= X-Received: by 2002:a17:906:4559:b0:a46:4d16:439b with SMTP id s25-20020a170906455900b00a464d16439bmr131713ejq.43.1711562937226; Wed, 27 Mar 2024 11:08:57 -0700 (PDT) Received: from [192.168.92.47] (078088045141.garwolin.vectranet.pl. [78.88.45.141]) by smtp.gmail.com with ESMTPSA id z2-20020a1709060be200b00a45f2dc6795sm5702733ejg.137.2024.03.27.11.08.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 11:08:56 -0700 (PDT) From: Konrad Dybcio Date: Wed, 27 Mar 2024 19:08:44 +0100 Subject: [PATCH v3 06/19] media: venus: pm_helpers: Move reset acquisition to common code Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230911-topic-mars-v3-6-79f23b81c261@linaro.org> References: <20230911-topic-mars-v3-0-79f23b81c261@linaro.org> In-Reply-To: <20230911-topic-mars-v3-0-79f23b81c261@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Philipp Zabel Cc: Marijn Suijten , Stanimir Varbanov , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1711562923; l=2551; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=6kdN4bIMMHrZ4SMvrh49Lrd228bzKlbevJXjeVijEjQ=; b=CtQR+eHJic5RXCB/ys245BqBen08N508V3dMF9qZepH61Eg6IBXLL/1ibfyDLWYOWndHzKBoG Q8bhVnsEexeAaw6s+eU2HvdmvE2TAufRlJPbHuXmMHg7HUvIUP8obA1 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= There is no reason to keep reset_get code local to HFIv4/v6. Move it to the common part. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 9 ++++++++- drivers/media/platform/qcom/venus/pm_helpers.c | 23 ----------------------- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 5ab3c414ec0f..0652065cb113 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -286,7 +287,7 @@ static int venus_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct venus_core *core; - int ret; + int i, ret; core = devm_kzalloc(dev, sizeof(*core), GFP_KERNEL); if (!core) @@ -324,6 +325,12 @@ static int venus_probe(struct platform_device *pdev) if (ret) return ret; + for (i = 0; i < core->res->resets_num; i++) { + core->resets[i] = devm_reset_control_get_exclusive(dev, core->res->resets[i]); + if (IS_ERR(core->resets[i])) + return PTR_ERR(core->resets[i]); + } + if (core->pm_ops->core_get) { ret = core->pm_ops->core_get(core); if (ret) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 730c4b593cec..5b2a40a2f524 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -939,25 +939,6 @@ static int core_resets_reset(struct venus_core *core) return ret; } -static int core_resets_get(struct venus_core *core) -{ - struct device *dev = core->dev; - const struct venus_resources *res = core->res; - unsigned int i; - int ret; - - for (i = 0; i < res->resets_num; i++) { - core->resets[i] = - devm_reset_control_get_exclusive(dev, res->resets[i]); - if (IS_ERR(core->resets[i])) { - ret = PTR_ERR(core->resets[i]); - return ret; - } - } - - return 0; -} - static int core_get_v4(struct venus_core *core) { struct device *dev = core->dev; @@ -981,10 +962,6 @@ static int core_get_v4(struct venus_core *core) if (ret) return ret; - ret = core_resets_get(core); - if (ret) - return ret; - if (legacy_binding) return 0; -- 2.44.0