From patchwork Thu Mar 4 12:03:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 392745 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp6375002ejz; Thu, 4 Mar 2021 14:27:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJgAfSlTMLIkCI5RwEoVB/RijMMp+iJ1k7x4nd7Ny/09oAAxmmdc7vriEXI1OhqBWgJ7XK X-Received: by 2002:a17:906:1d0f:: with SMTP id n15mr6489740ejh.553.1614896824715; Thu, 04 Mar 2021 14:27:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614896824; cv=none; d=google.com; s=arc-20160816; b=toSHxVVgTfH1kiBmdZnNFvETEufn55eytIHst1bVCV/dz8LFsfk/oBFuELn+2B+ftD QelpDpc7bd8ymDXas4RUdPsFxKRzLQppJXLEkLfDhgClD8v1eO+MCLcIPuOfxNOPkftr SfF0HwubEuNduR1tmvU855l8Q1a3buWiOnshQ1J1kPJlf0KcDlje+tgGfpEGD9PWrTJ4 TQ1gj5jUOiWZzZ4Psp7CHwRvCMsTYAIz48ZJZkSpBIAD+fEISfcON5BD7QX0Tf4Ny/1+ cFxEQJzSzaWjph5GWAcLRBCmIfeO/1RIIcXqKCqEiA20KbxQquNA1F5Zv63gVoi1m5Ex +JAA== 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=ZzNAE8DcF9c7gV07r9a7AjhjR1cDYzLUD3bNmPF3IsA=; b=hPI4nOm4lu2QvDqf8WPuZ/uo/3eKS6EGElkCTs1Tj9lmfWZx4JjiTQqP+nfglK7Ar5 lddVGvaxPqa+inCXw/HsefbyduSL/vH4g7Yu9Hsi1M8XjvOmej7f5D4nYBDqUOsG1Nwk jyx0Gihf+j7KnSVmjOPAD/9FRWm+gLKyRJERjuL0KMkoLV2upXK1afd/Fk1TqIOpMAxZ +8pVj/JcdKkEz2/mmD1BoU7Xo1xTk6L4DBuT64aKB8WcANMQhI4bdgMyvFYKfTOlpX3b hXeEN9qKTKyYlXkoBTvKuijqoZ8I/5MDkm483/dyyj49fSZrebVZLFXhTB3NF4KQlsSP PC8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IoI4Z42E; 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 k6si527757edj.545.2021.03.04.14.27.04; Thu, 04 Mar 2021 14:27:04 -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=IoI4Z42E; 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 S240012AbhCDMGt (ORCPT + 16 others); Thu, 4 Mar 2021 07:06:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239956AbhCDMGg (ORCPT ); Thu, 4 Mar 2021 07:06:36 -0500 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 948BEC0613A6 for ; Thu, 4 Mar 2021 04:05:55 -0800 (PST) Received: by mail-ed1-x535.google.com with SMTP id dm26so10903701edb.12 for ; Thu, 04 Mar 2021 04:05:55 -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=ZzNAE8DcF9c7gV07r9a7AjhjR1cDYzLUD3bNmPF3IsA=; b=IoI4Z42ESsRI/IHOgWdbFDzDe3K8zFMLxJhPAj1yPeDFYKU5ai0630E6DGe9oytfaR Y39MkN2E3MxADtOfbqgqVs9ICcWheqVm0jFWzmjHCgFp/pW/h5HL4nz0aoYaFQVBOl3g M9PlKW4GBi2XW3upiswdjDjsu2Hc0d6Fw3/zOtxNyYvD/uaBSuJkx/swuxEjrXIdSbYb 7CDx6/LW2SQa26mnlw0JhU1H257isqP1LY9jcRemmusitsU6t5qUXX3wW/opp5jcDjKM o3RQXbTWQ7Dzbv2TZC5OLGsUD32ocNswHHjbljYKEMdmW+iem+vWSqwtfsKBOUWj6iZS zxpQ== 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=ZzNAE8DcF9c7gV07r9a7AjhjR1cDYzLUD3bNmPF3IsA=; b=ArHy1KxxZujRvz8pHUULSr5zPrulI90hT50LsOFkNdSKo1jHuiUua5SXZY9S12JM4W EqOfoP937lxijSqL3fkldj7b8zqJCUpPn96PFLRRYKzRTlKmhYtin3ddGlonu8esZGmp c7bDl0grF5M8phRqhHMdUlPd38adCt6xXf9ZxZ8rK7sQqoYjY+2EjCkwsVVI5AZ/yz5E rqi8QFMirQdRphcMoq9qHMZ7Bv3iLOuFb6DTfAyviF+bmxEZb/4eczvSiE3/udpw3x7q +rjyYV+pbuqCAMhSg4rWnKAQ3SZzgk40TO/+xesk+l4b8K2/MKE7fpCH5KPK8bjLBApx bfsg== X-Gm-Message-State: AOAM532azWWFyAz0gMuiTdN6W8V+jAyMnrgeR6HrLqyanOhwJdFrZCGL oEfs4uSr+aKmGOnExlFJqsVMKg== X-Received: by 2002:aa7:d54a:: with SMTP id u10mr3985931edr.316.1614859554370; Thu, 04 Mar 2021 04:05:54 -0800 (PST) Received: from localhost.localdomain ([2a02:2450:102f:d6a:470a:340b:1b:29dd]) by smtp.gmail.com with ESMTPSA id cf6sm20464447edb.92.2021.03.04.04.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Mar 2021 04:05:53 -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 Cc: Rob Herring , Tomasz Figa , Azam Sadiq Pasha Kapatrala Syed , Sarvesh Sridutt , Laurent Pinchart , Jonathan Marek Subject: [PATCH v6 13/22] media: camss: Enable SDM845 Date: Thu, 4 Mar 2021 13:03:19 +0100 Message-Id: <20210304120326.153966-14-robert.foss@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210304120326.153966-1-robert.foss@linaro.org> References: <20210304120326.153966-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 0a9388227c59..7446f9c71b3a 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -916,6 +916,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; } @@ -1218,6 +1224,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); @@ -1286,6 +1294,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; @@ -1417,6 +1431,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]); @@ -1450,6 +1466,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 244991710879..a2994c9251f4 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 {