From patchwork Thu Mar 11 18:09:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 397553 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp536343jai; Thu, 11 Mar 2021 10:11:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxTbDDkcpMYZ6FbE8iw21VseRy8XxE7WumzS6IioHnVy4mgMYoEhgXyeUV43kv6Ddr2s1/ X-Received: by 2002:a17:906:cd05:: with SMTP id oz5mr4391492ejb.345.1615486296039; Thu, 11 Mar 2021 10:11:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615486296; cv=none; d=google.com; s=arc-20160816; b=WqSA/BM+lE0dqHYPMVCfyJ6sQqNUxLdbFb+SZdBrt9c9wV3bbY+kBjAOvTlTLCLUAR lhlA9PaQj4xj4dFnMwXLvP36C7Fl0TbItP2yc6yRv99RJ+qwNVcJf3937C8FDsZAm9sR 81XJI0JEK/qJIHABIo3Uiq6Puayxb6PafZQaKTgJD+EMysu4fJ0jl7AuuVFuK3iOAA1B Qu3zStFwb23477rhxT2uv+yJ8LaL53z4InNG0/b3SpIwWgBFXsqhKLpkAmMoK1T3h9mG cavTdM7uljPk9Ui7zhr6i3XMdEUXeymIodVgEnix5g+G6xNAVyzKfmNzRRz41p7ZA0mL 677A== 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=4COacosEh/7G7FGEwgQOsHMQRq0aP+h6re/ZR6VAhoY=; b=De6pirX8e85esRiaOMYkp8o1m6+ItNSITvfkayH80dvKOunywFXpykI7ufwGKvgTDX /zmvUWbSjEW9qR/ued6ZVpEXBJdA1MaqpTN9CxyMsWoMsEyZeaDe+S45h3EM4fUdcFsc c7S1acA8RNY4cl7vqhvj6rE+8k3Xe7zexxRxtfKoL1i6TD62Qq8G1y0KaRRh/ds0tJ1T 5H2X/tTIpqwBHPXKksd9RTGX99TwctkNWY1r1kILKR14hk/B9Y6Q3K5wcZ4zk/JWYKNW mEgLktkG8y83k9yo+dazQ/qbQqzIsqK8vG1JaPPRiADg60GkJ8P5S90aRa406Dk/QLug 0bwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zAJWWsa6; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 dg2si1771266edb.136.2021.03.11.10.11.35; Thu, 11 Mar 2021 10:11:36 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-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=zAJWWsa6; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S230406AbhCKSKi (ORCPT + 6 others); Thu, 11 Mar 2021 13:10:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230410AbhCKSKZ (ORCPT ); Thu, 11 Mar 2021 13:10:25 -0500 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72149C061762 for ; Thu, 11 Mar 2021 10:10:25 -0800 (PST) Received: by mail-ed1-x529.google.com with SMTP id w18so4208480edc.0 for ; Thu, 11 Mar 2021 10:10:25 -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=4COacosEh/7G7FGEwgQOsHMQRq0aP+h6re/ZR6VAhoY=; b=zAJWWsa6ScAsusIvItHEbkYx2MhEWGruKMuW1o2HgG4oqbODNgrN8CQYunoKQUpp1J /N3ftXvhnYpb24y49dIor1Kw8V8wdMB5IdP8nz94PEh9M73H8PzDTSNhgLnZuDGvH/1L JeJH8scJ7+k7pYNJBNB3A/sM1y2ONLQpvQ8yNQ2lt0tKvhVk3lR2E3BL0fxrNvw00h2A fNGYADJikjsmFsbsAyjbA3fTIfJYLDq41mILEr5yJs/ddiabDzJtRozLJBo75ilSIL4t T3z7PfNcS5TnO+BJCJ/VJVfjfZ86WL5pJoAT9+OaGqLuH4D+KoOpMuQp4TupiLYRQEDN CotQ== 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=4COacosEh/7G7FGEwgQOsHMQRq0aP+h6re/ZR6VAhoY=; b=EVf9BZTA4UOPeAvESv3985jA0w8j51OEAJzxhIaPMvgvGjUxRDhGeiRQ8jmhhYeu/W SN61H9btobsdwfE+0wRKTLsdAytSdDrIIMa1gCZdR8gMQqnYV2YdqAWixU6TqjFz1Msv DOMElbNhcZBgyUl28SQ6bGMCyRi8KKRx5PdHVj5+jL2QVk3AZBKWVxX64OcIraPKFViF Crm0IuK4DZUvDEjKioOj2jze3wOjTL2+JJ19UvkcMLqSM7Ki4VGjCT3oYUXN+pIZfxj/ n5vskATLbBVMOLG0Eoo6cE3eWiTh+y1nSWOwKeTAMEvKda4Z+Sr4jxvjug8dCviI10Kr WHEg== X-Gm-Message-State: AOAM530C9few0GtswCQqgbMYHUar5pbDVNbxzad3VxAVtU82AFH0HDFR A+ynbKoMpL9LDqNGxDROydcaoQ== X-Received: by 2002:a50:e183:: with SMTP id k3mr9867605edl.45.1615486224132; Thu, 11 Mar 2021 10:10:24 -0800 (PST) Received: from localhost.localdomain ([2a02:2454:3e3:5f00:8e01:34c:da50:eb7e]) by smtp.gmail.com with ESMTPSA id a22sm1741290ejr.89.2021.03.11.10.10.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 10:10:23 -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, 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 v7 13/22] media: camss: Enable SDM845 Date: Thu, 11 Mar 2021 19:09:39 +0100 Message-Id: <20210311180948.268343-14-robert.foss@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210311180948.268343-1-robert.foss@linaro.org> References: <20210311180948.268343-1-robert.foss@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@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 4ea1f251950b..83671733dc3c 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; } @@ -1241,6 +1247,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); @@ -1309,6 +1317,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; @@ -1440,6 +1454,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]); @@ -1473,6 +1489,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 {