Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp618572imm; Thu, 5 Jul 2018 06:13:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfzwcWXUqQm5fhds7TX08HRgzcmdfkorqqG/M/U7/7Wexz/Oo0Ke9d4pHrN07l+9xrO+XTw X-Received: by 2002:a17:902:82c7:: with SMTP id u7-v6mr271313plz.83.1530796428164; Thu, 05 Jul 2018 06:13:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530796428; cv=none; d=google.com; s=arc-20160816; b=vBw+2oUCYs0lSdyAW/d72SKY0uCP/kVQyO69K5Z8hY/pOPIIf/x9K2OMKZ4ojwl7r0 mVrUB5Il6wh+YfnsTIoMVECfYAeaviIKzW30gy+HkF/PdxQVT/8MLvt/cpEJoKsBal1+ /NthQ7URPVlFjzBJQDpG+CCWPbi1dD8lta/W0UjCwj0NVxBz7wQHxeUqoYBkhwpPe4O9 NCwMMG4zlzgS4CC4vB+BDTlOEXy+1076H3n11E0oF0+NgjZwfU8ByVl5c0mCuHhBD/JG mGfHK9rbr90ykagYUC64XQemoSJNnzPa1fw9nm0yQ3KzGy0QR2wOVHrqo+5xOacu2K5X UPeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=0MKE00JaWerRp2/nQ0l2U1l97a+GwZN1ggGadoc+uKY=; b=j+eEDRqv+De61PdZJg9Gtznb+26Kk7OzKNw5Y3y0xS4gtfTe8PTyjZNa/5nV3dR3/h vkNOqdYojz5K4puzd2c5GX2q7jIT34a2rc7X1m+qPkc0TWKK1daHO+CrykIZUqbvxDel LGbhCI4E7lgLq3U+AbqQROYbuZV1J40OWJ9ZF5zOhc5cyuhN0nd5uPscfhx+qyeP78+B ONKyjpN8u+Z9WkA+bR9Jr+CrMn2BYjZPTz+3WGPudDJobfJtjdjwYncYLO+0+O4lmo+X FVQgq8W7Pan5Vm3DRGhIs8HCOGqklSdQOfIV7v5j+1drg/D2CdGfwDpO9/veOdi3LDpt rDKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y+tsa2Kg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f24-v6si5693913pgh.287.2018.07.05.06.13.33; Thu, 05 Jul 2018 06:13:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y+tsa2Kg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754656AbeGENMu (ORCPT + 99 others); Thu, 5 Jul 2018 09:12:50 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:45771 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754342AbeGENFT (ORCPT ); Thu, 5 Jul 2018 09:05:19 -0400 Received: by mail-wr1-f68.google.com with SMTP id u7-v6so1137735wrn.12 for ; Thu, 05 Jul 2018 06:05:18 -0700 (PDT) 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; bh=0MKE00JaWerRp2/nQ0l2U1l97a+GwZN1ggGadoc+uKY=; b=Y+tsa2Kgng9NIpvHg6lzwny2cePlCJmo68eKAkvZ/n6P7oGZ9uglsTSl3c6Psm09ao IaezgHVRYpSiEag/EIiewAtPSsBi1KxExBTPg+/0aQbeaMQH5nukXvWjUVlUHBOcHei7 VCCggFIwfbBCRZcVuE3RTOxtgOPSvjypnkg0k= 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; bh=0MKE00JaWerRp2/nQ0l2U1l97a+GwZN1ggGadoc+uKY=; b=EIC/2y1lfSl0uSlH2DlT+cVi2R68kC0zSy8LdsrwGcl9qwt6gh13JVusjeqdKax4rw F/alnzXkF6ZrQC23N71sDqtN9Tj+H2bFyTNLXxpBj1oEHVH5Ti8tZCxzvJ+ZTIO+m8qq ULY8KqUBqRpZyfWa6a9uuF8Z4D65a9j2aEGga++6rIi1N45CNJhrC4LacaTOVXrSHRFL 7o83BQsiFNNcborA8OF7SBUg8VJvxfdBXr4r3lkI8pGCwZ8DPiynepc1n26tza341HDr d2BmAJPGF24uqtgUgmrg+VJkcAYGv2dXtnN3qfl8unsa/Xltu1FwNV1z86RVvDz4vcMB LHDw== X-Gm-Message-State: APt69E0KMde9fYJDErsmpS0nmi0WvzHtO4RzktaKMg92PTgO7I5y97Du PSECRhZ9wYuFydFWnYaj7081cw== X-Received: by 2002:adf:9f0f:: with SMTP id l15-v6mr4653674wrf.206.1530795917786; Thu, 05 Jul 2018 06:05:17 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 11-v6sm2109102wrw.67.2018.07.05.06.05.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 06:05:17 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia , Tomasz Figa , Alexandre Courbot , Stanimir Varbanov Subject: [PATCH v5 10/27] venus: hfi_venus: add suspend functionality for Venus 4xx Date: Thu, 5 Jul 2018 16:03:44 +0300 Message-Id: <20180705130401.24315-11-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180705130401.24315-1-stanimir.varbanov@linaro.org> References: <20180705130401.24315-1-stanimir.varbanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds suspend (power collapse) functionality by reusing the suspend function for Venus 3xx and also enables idle indicator property for Venus 4xx (where it is disabled by default). Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa --- drivers/media/platform/qcom/venus/hfi_venus.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 7a83e967a8ea..124085556b94 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -879,6 +879,14 @@ static int venus_sys_set_default_properties(struct venus_hfi_device *hdev) if (ret) dev_warn(dev, "setting fw debug msg ON failed (%d)\n", ret); + /* + * Idle indicator is disabled by default on some 4xx firmware versions, + * enable it explicitly in order to make suspend functional by checking + * WFI (wait-for-interrupt) bit. + */ + if (IS_V4(hdev->core)) + venus_sys_idle_indicator = true; + ret = venus_sys_set_idle_message(hdev, venus_sys_idle_indicator); if (ret) dev_warn(dev, "setting idle response ON failed (%d)\n", ret); @@ -1533,7 +1541,7 @@ static int venus_suspend_3xx(struct venus_core *core) static int venus_suspend(struct venus_core *core) { - if (core->res->hfi_version == HFI_VERSION_3XX) + if (IS_V3(core) || IS_V4(core)) return venus_suspend_3xx(core); return venus_suspend_1xx(core); -- 2.14.1