From patchwork Wed Jan 27 14:49:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 371550 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp343161jam; Wed, 27 Jan 2021 07:00:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJyp4Te4TLBvm8OJ63WVKc+REdvXRwv4F/NMBqgfSiJDyM8tHWMVqvXkB6/Vo6y/r+Qx8ho+ X-Received: by 2002:a50:c94c:: with SMTP id p12mr9263347edh.154.1611759633509; Wed, 27 Jan 2021 07:00:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611759633; cv=none; d=google.com; s=arc-20160816; b=Pb3mrDIhj9ORfIwjVoQMrOnzc6A4zjd15hNmGxS2WlMPs9yBX22Q/SWTw1nY4NP3pP k+Dol4nrUfZBIMV6sBb69k+O5Dcsj2enf8ScSk8YhXcejmvwk6tvPq1COxf0lp1vD0MD LLtyGiEMgeykroJSXT5aezFPa4Agj+zcvMiLcbViB4H4G6fgbQ4frQbkr13YEk/jWTZY oGr8v5+H/4/XjcAev8vfuHGWnjdEQAPjUqqdBuSqJnWFlMxAhHXfU5ognVIcmbJ7raQQ GNhENx+Y1i1hvRHZoauFKFe2dvSfL6ukm44r/VDI5fZI+kZRJ1yTUFA2XYZEvzGCtcq9 wH1w== 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=kvX1fPx3FMQ5uXckxXhS8AVQna5Rb5Ybg4HAxWPNgfE=; b=VpqEay78HtMXe5DWt7o43e2C0Oz8md8KtAW9k0qjitZHVnBGkdzCDOYPFxVR54R4zV UsOl31K2IILMlvNrvjXqM5RYD/cKwTSUs2qHYO+uPGnOddk61U/8FiV88UG0iowPSL7k Y5EAIXSlxjTmg9HZolc7iXlimVNcAP5zLrCfGi9xJ1TAsgMSxnrkQbkzUpjeEvTqlkB3 wg8nBv1oPfnOP4da3Ze/1H7Ny1u1bJXvGEbrk9BSwIBy+s8dYL4fv+HqFrd0Y0obSGiQ DH8n8LqLP0Dmmxmef45sGDe0HPrLVbMsTksUhFAnmdLLOM06QKTxpUTDhtMl6FNFMI57 LlAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kX4+vQu5; 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 r11si1266786edc.353.2021.01.27.07.00.33; Wed, 27 Jan 2021 07:00:33 -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=kX4+vQu5; 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 S234240AbhA0O7P (ORCPT + 6 others); Wed, 27 Jan 2021 09:59:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234964AbhA0O4l (ORCPT ); Wed, 27 Jan 2021 09:56:41 -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 862FCC061A30 for ; Wed, 27 Jan 2021 06:50:37 -0800 (PST) Received: by mail-ed1-x52b.google.com with SMTP id z22so2756614edb.9 for ; Wed, 27 Jan 2021 06:50:37 -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=kvX1fPx3FMQ5uXckxXhS8AVQna5Rb5Ybg4HAxWPNgfE=; b=kX4+vQu5KkA7c6fiC1k7aSk49vpEf2RMy0CIAZDrW3dRpuRRMv3k0/SMy/umi5P4Zg SWEqK8N9N6Xtjh0GQoz97dtOmBX9+qLFmULQZOrZPoqd1GHRbE86fYGlqowmTOCdnctl YiN17EyWk5A7LF+PbwdS/lcC9epJNJ2OM3EKoS4cAkfQzewh/jnNur5XsE5YsWRuEywx ZVeeQYDHn/IrE2e5fQcVHM3B5phgiTDntDi3z0cjLwUTR12csdNM0MAdYnAux8pGMRQA JrOg1dBqfZx6/Q7NGNSDL+n0ZRIkb5jVXkX050Fap/heqHS6OtfohiAk8BBZRC7rQGWv LBwA== 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=kvX1fPx3FMQ5uXckxXhS8AVQna5Rb5Ybg4HAxWPNgfE=; b=o4E83OZZFkM43ixwvk0QQj6i8+i2/jXMwj9HkjNY5wjZ/HRMsBaKeHl7w/hDtTZNSt /H+aacEaspxBLbIdyLO2wuLULB9eJmxGCgmi0j9FwMhISAg6WD3JJRel9TxrRFXhFat2 5OUurkEhxWkT+gALsG8bHQDz/RhYn7MopVUwqOsNBtS+G3arF8JysqvfXHikOpyQVbbm zLmZeIxHZThgAXtc/9nLnuTh4xJYEZFnORa+HqMichFVTDklal/cjp0NaBJIbozuJA81 ngqN3+u+7qz3Y9R4ME14Txg7Bj2TPW/URegT0pEw8Ij1jmEd+2oFGc2c+ad8AZbjRUfB hWMw== X-Gm-Message-State: AOAM531M8hsIQXkdbwrTfAkykTNzXMJfma0Tev9D0PEaMMlHsQG9Bgyd IwQIX429Xs/1BD75T6bVpjOU+g== X-Received: by 2002:a50:ee94:: with SMTP id f20mr9536768edr.222.1611759036316; Wed, 27 Jan 2021 06:50:36 -0800 (PST) Received: from localhost.localdomain ([2a02:2450:102f:d6a:62e7:589a:1625:7acc]) by smtp.gmail.com with ESMTPSA id ah12sm947799ejc.70.2021.01.27.06.50.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 06:50:35 -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, angelogioacchino.delregno@somainline.org, 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 , Rob Herring , Andrey Konovalov Cc: Tomasz Figa , Azam Sadiq Pasha Kapatrala Syed , Sarvesh Sridutt , Laurent Pinchart , Jonathan Marek Subject: [PATCH v3 12/22] media: camss: Enable SDM845 Date: Wed, 27 Jan 2021 15:49:20 +0100 Message-Id: <20210127144930.2158242-13-robert.foss@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210127144930.2158242-1-robert.foss@linaro.org> References: <20210127144930.2158242-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 22f9d7d7085a..5ce7cae2ab9b 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; } @@ -1203,6 +1209,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); @@ -1271,6 +1279,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; @@ -1402,6 +1416,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]); @@ -1435,6 +1451,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 {