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: 397950 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5083C28D15 for ; Thu, 11 Mar 2021 18:11:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BCF5464FB8 for ; Thu, 11 Mar 2021 18:11:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230527AbhCKSKk (ORCPT ); Thu, 11 Mar 2021 13:10:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230408AbhCKSKZ (ORCPT ); Thu, 11 Mar 2021 13:10:25 -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 6FA26C061760 for ; Thu, 11 Mar 2021 10:10:25 -0800 (PST) Received: by mail-ed1-x52b.google.com with SMTP id z1so4206842edb.8 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=CqRbqDKzlCBAfJ3g0ki+MCaJ/ukv/42TEU/X3Rufli4CGi1o+MZBdBcrsVWAccjmnf OwJI4dZt/aTZiE25mQ5go7LzNOdv7YxjvOCbD6MixmHwIaD3rajNRUNtrhB3WKRLT927 hrb2fcW+h2OoyvhPW6iLgo6QTAT70HibJYiTzGhWeVaUbxK6Jt6n4ecynvMgPgltNouh UMqVD9iWMIFJJ6w27mFQeS4G/90bM/aRfW7hADGq8pNdEYfS5OOgpJ9DDoLnHX+aecJt GIfS02Nxlb5K+T0gyo1wkev8afh8mAVPkNXW5lUsIx9VpmwwmDJj5CTIDU5mIuwiGMrD szlA== X-Gm-Message-State: AOAM532Q+c20sxohFt5E/iJfWghq/L+iXceMDfOod0ockzAK6p9UOiJA cO72V0V/BFJr9N5ruDIRiBgYQg== X-Google-Smtp-Source: ABdhPJxwtPe8Lui9oVtgHhk9GbW7YSUdo0I/NVMxWnzt0t6EOcpyy/UIrXLk3hKjRsuRbIhYPOnH4Q== 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: linux-media@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(-) 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 {