From patchwork Mon Mar 15 15:59:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 400504 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3547509jai; Mon, 15 Mar 2021 09:01:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBCulOTyEW00tPCzc7gExXTh95VBQU4WqOlNO6ZSl3OXxf3b3xxJXwFztG9GB+RcJ3aI0m X-Received: by 2002:a17:906:2db2:: with SMTP id g18mr24786206eji.73.1615824119597; Mon, 15 Mar 2021 09:01:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615824119; cv=none; d=google.com; s=arc-20160816; b=BqMpZqTMGgUoiRclHB2j9gs9F8pqM9abZMz0bDtBrshs/IMWw+RMF7q1UzloBAUbT+ dP1Le5AUw6XjrC3YSN6KwYB5Y7VqSJQ/pf5xMcnFG2kSVAU8Q5WXzwhePoEgfTPAgS6a UNCXPN2X8PoNq0PsQEeR0KCLzqfstlvf/3G/yRJLffN9ZoZADdOjcH6WtKfb6/sY++b7 lvfRXqCqx+TRdYvlqjlhBxwxRzR13WE8t+6pTPCt4ICLm19kj+lW1y2lPKcXxcfHHbkw dFRXc8nr9yddtBjGsFUA/JcwtRM1/fHp9nIlmpnzZ6xbaaMOGEMo5IvBbMIaCfCVG9VZ ywVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R6aBUu7XE1YisU90N3EIguZcLh4QG6jqc/g/Smv0dIs=; b=T4DeS5YUQsMgIVtIgWrbbE0IQosEa/rsxyJnkAvxhieK/5tMHnZ9YzMNCvLPNsFjnD 6cKka/Cd7rmHOu0AnTTR8HlVFR2yCT/G8kXW6sluA+ulLnSjIBtrXw/4w7+qK3hralKO 8sFGyp6wLL31snml7UVySSMjUWDdCRevzvFhr23+wxlSi2+QIgqXqgvDinmHOwvPVWey qNbryAQRCvdhhWpEG/EhU9VlpUiOMB+/aeDPhKNplnglWQXt8ou1ZE8sMOeyWABqvCdK P+df/cnu1zpG+ZItdmDWroSqYLU1QABTqRrr4hmYM8LeFfD+OxhxpsYIyf9yaSCZUGPi J9ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Pt2wjwEG; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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. [23.128.96.18]) by mx.google.com with ESMTP id ga15si11470494ejc.24.2021.03.15.09.01.59; Mon, 15 Mar 2021 09:01:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Pt2wjwEG; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S231152AbhCOQBM (ORCPT + 16 others); Mon, 15 Mar 2021 12:01:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232922AbhCOQAv (ORCPT ); Mon, 15 Mar 2021 12:00:51 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D16AC06174A for ; Mon, 15 Mar 2021 09:00:51 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id p8so67113815ejb.10 for ; Mon, 15 Mar 2021 09:00:51 -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 :mime-version:content-transfer-encoding; bh=R6aBUu7XE1YisU90N3EIguZcLh4QG6jqc/g/Smv0dIs=; b=Pt2wjwEGaTHW4jyO/7EDJbSgAUT3H9lHLgSWwvUlzKSa45Jtxk2vuL9tNRzYbeGHD1 k1SycUo5PU5iET0yWfjMSihXIvQZ3lNEcb3DisrOPwKhoxo2CjGVJ0BEL0G88vISf/+v yIpdaEMVH2MB+3bQE1LZU0NmX0sHE9BLk4mWGeaXR4GBj/Q9XfAHSqge/o5fvm+EL6V7 TMwwur+ql+ysV3QN2v6Jm65DPAWD50VAduIFgiZ5PfmcI7xQjbQNZkDCluDG8EibJLiy wXo4L9X/j0PMgFxKVgCOq2C3rpJNWn6Ir0w4hi9tF8qlglzRGrdhPiW/FIBT2QWKfOHT tF/A== 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=R6aBUu7XE1YisU90N3EIguZcLh4QG6jqc/g/Smv0dIs=; b=S/FDWXJJGPSQEQphg83LG6IVG77fyqHnLOuJcTNMqrvvWJntXNorjw4vOiej8FYYK6 550piFyF2rmQR4VaAuf1+gsw0Q9DI1ZnVsdh5ID2/HGFz/cE/dHUYJuvAdcQgueP44ca NlRZINgdqAir3fYNoM4qAo9G+lMttydR69pXqnXKCPpL+mca08ppVBbQn4WChVJgnSmr tIATa4lF/UoBuUgNC6kd8AJ0NqyE/zrRgkYuI7gRwX17HSSkSris9s7jQ/uEKJiBeknV EZSqnkQB6gLxq6WImzv/fX/Suj0oEoNl8ZobxJzQhToYxwxTB7BbZALFzGlO0mpJFsOf O4LA== X-Gm-Message-State: AOAM533d5EgODu+uyFcCtcCtO6AKu+8/ffLdzNi3xjeVT7f3eqxZkH6a /ttap8wJnxOPotLcpJfnb0Se2w== X-Received: by 2002:a17:906:cb0a:: with SMTP id lk10mr19592025ejb.479.1615824049713; Mon, 15 Mar 2021 09:00:49 -0700 (PDT) Received: from localhost.localdomain ([37.120.1.234]) by smtp.gmail.com with ESMTPSA id r5sm8456445eds.49.2021.03.15.09.00.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 09:00:49 -0700 (PDT) From: Robert Foss To: agross@kernel.org, bjorn.andersson@linaro.org, robert.foss@linaro.org, todor.too@gmail.com, mchehab@kernel.org, robh+dt@kernel.org, angelogioacchino.delregno@somainline.org, linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , Sakari Ailus , Andrey Konovalov , Hans Verkuil Cc: Rob Herring , Tomasz Figa , Azam Sadiq Pasha Kapatrala Syed , Sarvesh Sridutt , Laurent Pinchart , Jonathan Marek Subject: [PATCH v8 13/22] media: camss: Enable SDM845 Date: Mon, 15 Mar 2021 16:59:34 +0100 Message-Id: <20210315155942.640889-14-robert.foss@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210315155942.640889-1-robert.foss@linaro.org> References: <20210315155942.640889-1-robert.foss@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Enable support for SDM845 based Titan 170 ISPs. Signed-off-by: Robert Foss Reviewed-by: Andrey Konovalov --- Changes since v5: - Andrey: Add r-b drivers/media/platform/qcom/camss/camss.c | 17 +++++++++++++++++ drivers/media/platform/qcom/camss/camss.h | 6 ++++-- 2 files changed, 21 insertions(+), 2 deletions(-) -- 2.27.0 diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index 9b23285d1c20..ef100d5f7763 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -939,6 +939,12 @@ static int camss_init_subdevices(struct camss *camss) csid_res = csid_res_660; ispif_res = &ispif_res_660; vfe_res = vfe_res_660; + } else if (camss->version == CAMSS_845) { + csiphy_res = csiphy_res_845; + csid_res = csid_res_845; + /* Titan VFEs don't have an ISPIF */ + ispif_res = NULL; + vfe_res = vfe_res_845; } else { return -EINVAL; } @@ -1244,6 +1250,8 @@ static int camss_configure_pd(struct camss *camss) if (camss->version == CAMSS_8x96 || camss->version == CAMSS_660) nbr_pm_domains = PM_DOMAIN_GEN1_COUNT; + else if (camss->version == CAMSS_845) + nbr_pm_domains = PM_DOMAIN_GEN2_COUNT; for (i = 0; i < nbr_pm_domains; i++) { camss->genpd[i] = dev_pm_domain_attach_by_id(camss->dev, i); @@ -1312,6 +1320,12 @@ static int camss_probe(struct platform_device *pdev) camss->csiphy_num = 3; camss->csid_num = 4; camss->vfe_num = 2; + } else if (of_device_is_compatible(dev->of_node, + "qcom,sdm845-camss")) { + camss->version = CAMSS_845; + camss->csiphy_num = 4; + camss->csid_num = 3; + camss->vfe_num = 3; } else { ret = -EINVAL; goto err_free; @@ -1443,6 +1457,8 @@ void camss_delete(struct camss *camss) if (camss->version == CAMSS_8x96 || camss->version == CAMSS_660) nbr_pm_domains = PM_DOMAIN_GEN1_COUNT; + else if (camss->version == CAMSS_845) + nbr_pm_domains = PM_DOMAIN_GEN2_COUNT; for (i = 0; i < nbr_pm_domains; i++) { device_link_del(camss->genpd_link[i]); @@ -1476,6 +1492,7 @@ static const struct of_device_id camss_dt_match[] = { { .compatible = "qcom,msm8916-camss" }, { .compatible = "qcom,msm8996-camss" }, { .compatible = "qcom,sdm660-camss" }, + { .compatible = "qcom,sdm845-camss" }, { } }; diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h index 33ed16ab821d..dc8b4154f92b 100644 --- a/drivers/media/platform/qcom/camss/camss.h +++ b/drivers/media/platform/qcom/camss/camss.h @@ -60,6 +60,8 @@ enum pm_domain { PM_DOMAIN_VFE0 = 0, PM_DOMAIN_VFE1 = 1, PM_DOMAIN_GEN1_COUNT = 2, /* CAMSS series of ISPs */ + PM_DOMAIN_VFELITE = 2, /* VFELITE / TOP GDSC */ + PM_DOMAIN_GEN2_COUNT = 3, /* Titan series of ISPs */ }; enum camss_version { @@ -83,8 +85,8 @@ struct camss { int vfe_num; struct vfe_device *vfe; atomic_t ref_count; - struct device *genpd[PM_DOMAIN_GEN1_COUNT]; - struct device_link *genpd_link[PM_DOMAIN_GEN1_COUNT]; + struct device *genpd[PM_DOMAIN_GEN2_COUNT]; + struct device_link *genpd_link[PM_DOMAIN_GEN2_COUNT]; }; struct camss_camera_interface {