From patchwork Fri Jan 8 12:04:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 358945 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp482282jai; Fri, 8 Jan 2021 04:07:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqlO6MmMG1SdsijDhjpCv/83e5j45dIXTNG6pfL3Msl9NXu367L3An2INKNFUeVNA82Pn8 X-Received: by 2002:a17:906:52da:: with SMTP id w26mr2481377ejn.347.1610107634614; Fri, 08 Jan 2021 04:07:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610107634; cv=none; d=google.com; s=arc-20160816; b=lFj8y0/E3h52+NjworpcJ2EggwdxyvjcC0j0AL+u2yC/+Z8i0qUAVNSScxKmSdB6tC rH87HSyCYXEaRyMxZrUMhzV6H5JW5fUWSabELkIlFzjv+BIcBC8B66HF1MWwKq1y+706 edYgbsAW6iW+hYj5DbOityGlQilQm9ErZ8astBM322huzg+Nb1l671VVf7ol+YKiujye RwUToO7XwmYcjNsGxQAbUZiUhh5cPrTFpZ9wpPlf0O0Szq45NdLHrVZaIdAm6jOwTU2u mwoZIxGYeLSkdVZjuwtbd2Z30FquAFKDphFWqrhXmw6bLTptwjIjdeTgq7jw6y2y9959 bC6Q== 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=7rVgQIzgBRTIosfiF1p2wFlmLYHzThKp02Co3vN4N1o=; b=MwSa7QtfxNStDLLNLsgXpgQuJPkZOEf2yX0GUzzdTd5K3HI55gcGBNDKgNAl4+B/NZ OkEqQsWqhOO/7sqXtJNLj0WTEd6YoFM1zb1I7HrhsTMeP6VC9ncq6QZN6J24nlj2m22Z qbjeorsfcNPOHclLsWIJ4r2e0ANC+CQWcCHBXCr9ORfxw12Gn9gkbEzYFGakQfD5fInF vRnx4q/NciN8oJQ3Do0w7a0LEmcfRg9TY/FcbLv+AxhmQK1nht7mBQR4NFQ/Nloy+WVM a/U2umnMJwcUvHrphb8gztRdGi4pY4zmZl2t/sD6jFvTTeEgUV4II/Tofha/JRVKePvN vncQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="rUaPmaD/"; 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 w10si3797218edv.243.2021.01.08.04.07.14; Fri, 08 Jan 2021 04:07:14 -0800 (PST) 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="rUaPmaD/"; 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 S1727818AbhAHMHE (ORCPT + 15 others); Fri, 8 Jan 2021 07:07:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727798AbhAHMHB (ORCPT ); Fri, 8 Jan 2021 07:07:01 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD5C2C061231 for ; Fri, 8 Jan 2021 04:05:21 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id ce23so14181143ejb.8 for ; Fri, 08 Jan 2021 04:05:21 -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=7rVgQIzgBRTIosfiF1p2wFlmLYHzThKp02Co3vN4N1o=; b=rUaPmaD/lopsdO/FAwrVClZBowUhrH7Q3l17m4gsDBAVC0SUDE40tSxHRHd9MLpKSX IFWJ5SKgcp51oF9TmCD2zXKE6hVgQo0sOc04nWnuqdfLtgjC1UH3+1gcGPZ6iYA4Zkf1 ajQwZgswNq3Jkav+qHd3gtr659b58/ebj7XyOQOMeOs+vVQeH/chpX83wZux2idS6S8B eIaVPjp4j2QFCV6Fzg814BNCtMB5OYfpm9NehXf/jhItiKU+dngpzgL09ULxWStCUajG joWjAvdAeeYWJCc9jwGnrCNdtfF4iMdVSDoK4hGf6pqQBbKoWP0n/XAOhiU1Sx3tM68g JEdg== 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=7rVgQIzgBRTIosfiF1p2wFlmLYHzThKp02Co3vN4N1o=; b=Gzuw8lAC7GS86FLQvJHyB5O9VPURNSPgRKCrFO+N6kAX3zVzE9oDfeKzLewaIRoi5y O7o/filQThbJL19Z6Esl5LLnxvOfUzckqUO+RA2p6UelpEEWW80+IDSQLLFSroh72Pgs JFQmVLCuw4K6b3gL9Ew/Cj8z85rWv/p7pkoi2sdZU8bGBAXgIsXYyi011IZq38CTtBtX XbuLRJiTTrGHFQ2Hqs89NzoRf9PbPEungcSkmNk9UsZS0WdHQr0eW7RqMLhDiPTxW5Bt A1C6fBKnqxe+uRuwEkHkJFE3T1OD1W0xh5Puf4E97IGzThWbJfMRsmKfcQgIqZlSOOHB CkwA== X-Gm-Message-State: AOAM530OOEqy1f5V4XgO9Ib1gWSwQgq642BZfPSLRolrP52LALHInJgC 2+JfZtMCpnTxDMFuxywOcqe2XQ== X-Received: by 2002:a17:906:7f11:: with SMTP id d17mr2414165ejr.534.1610107520575; Fri, 08 Jan 2021 04:05:20 -0800 (PST) Received: from localhost.localdomain ([2a02:2450:102f:d6a:bb2e:8b50:322a:1b9a]) by smtp.gmail.com with ESMTPSA id i18sm3674498edt.68.2021.01.08.04.05.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jan 2021 04:05:19 -0800 (PST) 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, catalin.marinas@arm.com, will@kernel.org, shawnguo@kernel.org, leoyang.li@nxp.com, geert+renesas@glider.be, arnd@arndb.de, Anson.Huang@nxp.com, michael@walle.cc, agx@sigxcpu.org, max.oss.09@gmail.com, linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno , Andrey Konovalov Cc: Tomasz Figa , Azam Sadiq Pasha Kapatrala Syed , Sarvesh Sridutt , Laurent Pinchart Subject: [PATCH v1 13/17] media: camss: Enable SDM845 Date: Fri, 8 Jan 2021 13:04:25 +0100 Message-Id: <20210108120429.895046-14-robert.foss@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210108120429.895046-1-robert.foss@linaro.org> References: <20210108120429.895046-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 --- 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 259ed094cee4..4dfae29c6327 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -897,6 +897,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; } @@ -1205,6 +1211,8 @@ static int camss_configure_pd(struct camss *camss) if (camss->version == CAMSS_8x96 || camss->version == CAMSS_660) nbr_pm_domains = PM_DOMAIN_CAMSS_COUNT; + else if (camss->version == CAMSS_845) + nbr_pm_domains = PM_DOMAIN_TITAN_COUNT; for (i = 0; i < nbr_pm_domains; i++) { camss->genpd[i] = dev_pm_domain_attach_by_id(camss->dev, i); @@ -1273,6 +1281,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; @@ -1404,6 +1418,8 @@ void camss_delete(struct camss *camss) if (camss->version == CAMSS_8x96 || camss->version == CAMSS_660) nbr_pm_domains = PM_DOMAIN_CAMSS_COUNT; + else if (camss->version == CAMSS_845) + nbr_pm_domains = PM_DOMAIN_TITAN_COUNT; for (i = 0; i < nbr_pm_domains; i++) { device_link_del(camss->genpd_link[i]); @@ -1437,6 +1453,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 7560d85b3352..2f853557ed16 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_CAMSS_COUNT = 2, /* CAMSS series of ISPs */ + PM_DOMAIN_VFELITE = 2, /* VFELITE / TOP GDSC */ + PM_DOMAIN_TITAN_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_CAMSS_COUNT]; - struct device_link *genpd_link[PM_DOMAIN_CAMSS_COUNT]; + struct device *genpd[PM_DOMAIN_TITAN_COUNT]; + struct device_link *genpd_link[PM_DOMAIN_TITAN_COUNT]; }; struct camss_camera_interface {