From patchwork Wed Feb 17 11:21:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 383809 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp2719052jao; Wed, 17 Feb 2021 03:30:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkRliarkyYdqLxI2JSlkloqtzq/RE1uBoAfMy1Dk1JaaPrx77Ny3lRIXiGqkUDA4gB893e X-Received: by 2002:a50:80c6:: with SMTP id 64mr25914512edb.209.1613561405788; Wed, 17 Feb 2021 03:30:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613561405; cv=none; d=google.com; s=arc-20160816; b=SJbHgeJdyeQ5TsN0+jPm9J2cker8TvFAdjkTgidy871uFEBIBT08/JtaxtqBm1kndU 1dEEeBdpYF/UWgoSg+9MhM+lfvnhK0ctPjtgxxmRFzIHx1QwTP1vWQOeMsKVRlOLjjeG 3NCttfSMzqOqq2B7hHPDRe2MO7X3uP23wfUKpLe2iHRk/eq5DXJMhrba2qJfXj0x2WyF 9dS6RLD6T+Wz56jNZFffIfXa8oZnB275jp1ghsXG+678khPawMhMRh4UZGeQOJsk3wWE a5QhuiKuSgp6Y7ta7N4jdTUwOqRFciL8R+fXtuEu9zfaSv5RriIfPsJ9+HJQ68McagGM K2HQ== 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=PZVbssStSeLcJiuSI+6NDfhUe0uXgKt+Gf8JFcpnG2I=; b=pASN1MFt7RI6fehHDOwWTRR4uNyqMSpb52jtLKTFglPTrcmK3lmNnBpZCAMHg+Fuwq TwFqLiRiM+WX+CwbQ0KnFcrnyyNayuY7CYH54ebkBQ6qAKeSz13ngQ9NEvUzsyPK/YEX OvHcrDDtetPTzcqG1+hSS8t7rrbSq4byS6DmQ5IcJGX7PFKfq+nA1MU41dK5TOexTyWf WCrZgKwcwKKxR51TwzXRvgz9+X4d89MmbB8Y9eDvDZhxAMQ8YvRn+ngUcn0YKuCZ6JCt xUnpknIjIbMSZMWeTqHhaoebSbeuL7P8ur4/0fwM48HM+mhDfNfMTcTLoy6ZNzFfi8dC P1Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nH4BeaW9; 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 l11si1115725edb.238.2021.02.17.03.30.05; Wed, 17 Feb 2021 03:30:05 -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=nH4BeaW9; 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 S231876AbhBQL2p (ORCPT + 6 others); Wed, 17 Feb 2021 06:28:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231959AbhBQL0e (ORCPT ); Wed, 17 Feb 2021 06:26:34 -0500 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95E8AC0698C3 for ; Wed, 17 Feb 2021 03:22:20 -0800 (PST) Received: by mail-ed1-x52b.google.com with SMTP id l12so15961002edt.3 for ; Wed, 17 Feb 2021 03:22:20 -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=PZVbssStSeLcJiuSI+6NDfhUe0uXgKt+Gf8JFcpnG2I=; b=nH4BeaW9mLebvquKQugWuj1aU1QgYGl80GwT0OyCGL1l6CcbRQ64U3aVl1GExC7KsW nu8e1yzMENpvZCXa1JjIvHuCiljiu9gr5i9t4Hmlv6SD7UKc5pVTnbiMSjIiVyioHdOY 9pM2P2ROc+5MfyETueyLbR2ZTyAsnDTbRwAKGsqCeozJNbgsvfiZnCd+eBskpU+EMa0K GH91KbeIxpLkfUNqvORkUEW8QydvHMkiESoVaTC/MVTQzPBSDOIkrbv5DvztLeM+cXpW MZO8x1QARCsed3OOOimST4NO3w0rtVm/6ZShL/X+o6iKJ8SG/1QSyT+L1mmwjJa95cKH orPw== 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=PZVbssStSeLcJiuSI+6NDfhUe0uXgKt+Gf8JFcpnG2I=; b=HfuV49oHHP/4noaZG2SYsiCn1CVMBJ0gemUdIrXe9lb/tYMPhKQm6gS3r1YCeZ47AC SB0ThnGNgx4sHqlfJQzf7cVsSxQhn19QtxjcRYWXsR4TEFJKf5HqMp30v7s4ZBnlD9q3 OZFd7K0fidlo5lFmOsPPr4Ym1orSo5TTmNKnjySEHYC7gwlpS0pgyVrvVM/uMLgi5Vo7 fsGqDum63knhDJ5X6SCGE7tky/ImDIf4N84+Bh6oIWOOMIMs53xJcg0FC0spaunSTZ1q ZuDIGB1OiaWjiMYb6IDhaKJa7BHHU2Z943J+9ELU/WRjAOo9Jmuu7bbKPSg4r3bLnYtc 8RQg== X-Gm-Message-State: AOAM533jwIc3XmPaVx4Hu0yWU7aPIda16VeKRdN7lzvPvCRiEPw2oiBp X8+6XwhCoB0leKySIC++t1eiSg== X-Received: by 2002:a05:6402:b86:: with SMTP id cf6mr26298471edb.66.1613560939380; Wed, 17 Feb 2021 03:22:19 -0800 (PST) Received: from localhost.localdomain ([2a02:2450:102f:d6a:4815:d4dc:ff5a:704a]) by smtp.gmail.com with ESMTPSA id h10sm934344edk.45.2021.02.17.03.22.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 03:22: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, 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 , Nicolas Boichat , Andrey Konovalov Cc: Rob Herring , Tomasz Figa , Azam Sadiq Pasha Kapatrala Syed , Sarvesh Sridutt , Laurent Pinchart , Jonathan Marek Subject: [PATCH v5 13/22] media: camss: Enable SDM845 Date: Wed, 17 Feb 2021 12:21:13 +0100 Message-Id: <20210217112122.424236-14-robert.foss@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210217112122.424236-1-robert.foss@linaro.org> References: <20210217112122.424236-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 --- 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 3c45537b2cfb..3bd3153b7905 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -894,6 +894,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; } @@ -1196,6 +1202,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); @@ -1264,6 +1272,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; @@ -1395,6 +1409,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]); @@ -1428,6 +1444,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 {