Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1878992rdd; Thu, 11 Jan 2024 11:58:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IEkVa6xBPuYBat0/2Q1M0WB0PXaOFOkGu9s1gla5PmaQ9L+TAqvykIHrxREP7JskZzo7858 X-Received: by 2002:a17:90a:1210:b0:28d:c4ff:74a2 with SMTP id f16-20020a17090a121000b0028dc4ff74a2mr322936pja.47.1705003110938; Thu, 11 Jan 2024 11:58:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705003110; cv=none; d=google.com; s=arc-20160816; b=utQWkCaTPDK+hNMLQS59vHcmbFcOC+uyfJaVQi5aCm/VZhsHR155w0Y3zvS20JNcRg ew4mSz6mL+kahKH2MHvt21ur8Os8krFKSx4oxqFKBNDOcY8s7l8rBBHdL9yukjL64lLS grpUKLqiR5e6BJtFRCgo5gt/7NEoYmc5hj7S8J/VmYzedZiGxo0aZb89ijc31eItK0BU AM0Hj5Kv9qIoTYzoPAk+R5u1wHjDwzglveNO2kFUgFfU6RKTuBxTaQbNEwVhugubyWVL 4ks19iQKnRvIVUf2BVKE9m7axYy0c46sQDK3/UyfxAwj1TMPhQDmmROMicdG+xZ3z4Ez AvRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=teCmGBj+ibwO9q2qm/uPhkHrsqBCoribiVZv4qydUkA=; fh=gfJYK83H4MceAD6Z4Efb2gXw8kj02FP9twgR+Rx5Cz0=; b=bcQFPDKm+3LjQMN4Y/nOh6jAlHSEfb+LHVEF3OBD9a5mwOctgMdVafWbCYCZO2SN+z 41/GJhphcWMD9X9j4Q9uwzKW5Vw1JpuwlEWHmv4p/sg/1koNMbfJF76dinKZ028n51f7 J7StHZdLyv86NEs9oY85IAmgiXaf4fwKRTPRBpeAkIbsQVaazB4FXHDp1sBDXYgFImlp oKWZkxcwyev8hLnV7o/lME33nZ8TEnL3QyUIjhzHV7JCJ1cGEuXW6rA95FedgqGdb+0f nLsgB+937UdjfZ7v1oam1WGb8ct+/bbdYg5Mvq6gDyQ11GJIScKGdopEk527exMW1ySQ E/9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gpl7z/lD"; spf=pass (google.com: domain of linux-kernel+bounces-24026-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24026-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id m6-20020a17090a668600b0028c9f74f6f6si4342332pjj.0.2024.01.11.11.58.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 11:58:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24026-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gpl7z/lD"; spf=pass (google.com: domain of linux-kernel+bounces-24026-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24026-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B39BBB21046 for ; Thu, 11 Jan 2024 19:58:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EFA8E5787D; Thu, 11 Jan 2024 19:57:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gpl7z/lD" Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AFBE56B9F for ; Thu, 11 Jan 2024 19:57:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-40e629c5a42so6360765e9.0 for ; Thu, 11 Jan 2024 11:57:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705003027; x=1705607827; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=teCmGBj+ibwO9q2qm/uPhkHrsqBCoribiVZv4qydUkA=; b=gpl7z/lDBgDkvjWnVlys2e3fU2Um0KjeEL64+olny8f9D/Yl5MwSh3109mm7ph66DJ C05H4OYNW0G/ofWwjxG/Q5vNzdamfyb0A2mvNWYqmSDsDt/wPt0puxpqr3Jv+1tGZQhc d6kUseVaxFnCddEemCfTfMCWnF6PZoH8E6jzCPKHndpsKC4a30Hqt2Wdtdb5fHKFad57 S7gx16TgGeJc1N6QuwubmBoGjLui0upx3czz0x8JTJ+dmvIBamkX5xaJZ2AQ2ZOy2XSO X4YQt3Inqf8rPW4FNcYT52GIAQucF0/1kOAXZA+8Dm07dusMZECT09gTt1cNtc5l5XFv qyEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705003027; x=1705607827; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=teCmGBj+ibwO9q2qm/uPhkHrsqBCoribiVZv4qydUkA=; b=QrRcx0aC6iUx/IVgMvClt3RR/Q3eoM6Q6/3gtEQ8WSQMXu6UulLMl84adO/xY7cbMQ oRrqxuZM3rVOeXyk+oCdHMtajY5hsBMlBjBLX0iCltg6AoEB9ck9abkmFjK5KxX+9BFE 7xc1MiZ1vjcjdk4vp44iohkBED1kSCdCa6MtLJakByyam+iko22GA+suyRiJMDunTjeq rfHUpXiq8maFnV0njgDz1KroMcYm9iFq6JjcmIPZ1oRPVNqMWJwIJWVzJwtUtw279FC6 ICTYaNK4IVq6Uw5CJulWg8yP+SWzvQTXXfMNKgao0uhJ9m/61WSbfotRw+cQ7oP8PkKo /bkA== X-Gm-Message-State: AOJu0YyuVkLJRcunNy5z4HfqUjmr9diFI/EgDrD21LY9TfaOdphbX97M m6fOmlklYg5UGBWD+PkLtOMIPS+ukQFXKg== X-Received: by 2002:a05:600c:458b:b0:40d:94df:dac4 with SMTP id r11-20020a05600c458b00b0040d94dfdac4mr169970wmo.153.1705003027605; Thu, 11 Jan 2024 11:57:07 -0800 (PST) Received: from [127.0.1.1] ([37.228.218.3]) by smtp.gmail.com with ESMTPSA id b7-20020adfe647000000b0033763a9ea2dsm1955382wrn.63.2024.01.11.11.57.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 11:57:07 -0800 (PST) From: Bryan O'Donoghue Date: Thu, 11 Jan 2024 19:57:05 +0000 Subject: [PATCH 4/5] media: qcom: camss: Add sc8280xp support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240111-linux-next-24-01-09-sc8280xp-camss-changes-v1-4-b92a650121ba@linaro.org> References: <20240111-linux-next-24-01-09-sc8280xp-camss-changes-v1-0-b92a650121ba@linaro.org> In-Reply-To: <20240111-linux-next-24-01-09-sc8280xp-camss-changes-v1-0-b92a650121ba@linaro.org> To: Hans Verkuil , Laurent Pinchart , Robert Foss , Todor Tomov , Bjorn Andersson , Konrad Dybcio , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bryan O'Donoghue X-Mailer: b4 0.13-dev-4e032 Add in functional logic throughout the code to support the sc8280xp. Acked-by: Konrad Dybcio Signed-off-by: Bryan O'Donoghue --- .../platform/qcom/camss/camss-csiphy-3ph-1-0.c | 23 +++++++++++++++++--- drivers/media/platform/qcom/camss/camss-csiphy.c | 1 + drivers/media/platform/qcom/camss/camss-vfe.c | 25 +++++++++++++++++----- drivers/media/platform/qcom/camss/camss-video.c | 1 + 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c index 66ff48aeab64..df7e93a5a4f6 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c @@ -513,6 +513,10 @@ static void csiphy_gen2_config_lanes(struct csiphy_device *csiphy, r = &lane_regs_sm8250[0][0]; array_size = ARRAY_SIZE(lane_regs_sm8250[0]); break; + case CAMSS_8280XP: + r = &lane_regs_sc8280xp[0][0]; + array_size = ARRAY_SIZE(lane_regs_sc8280xp[0]); + break; default: WARN(1, "unknown cspi version\n"); return; @@ -548,13 +552,26 @@ static u8 csiphy_get_lane_mask(struct csiphy_lanes_cfg *lane_cfg) return lane_mask; } +static bool csiphy_is_gen2(u32 version) +{ + bool ret = false; + + switch (version) { + case CAMSS_845: + case CAMSS_8250: + case CAMSS_8280XP: + ret = true; + break; + } + + return ret; +} + static void csiphy_lanes_enable(struct csiphy_device *csiphy, struct csiphy_config *cfg, s64 link_freq, u8 lane_mask) { struct csiphy_lanes_cfg *c = &cfg->csi2->lane_cfg; - bool is_gen2 = (csiphy->camss->res->version == CAMSS_845 || - csiphy->camss->res->version == CAMSS_8250); u8 settle_cnt; u8 val; int i; @@ -576,7 +593,7 @@ static void csiphy_lanes_enable(struct csiphy_device *csiphy, val = 0x00; writel_relaxed(val, csiphy->base + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(0)); - if (is_gen2) + if (csiphy_is_gen2(csiphy->camss->res->version)) csiphy_gen2_config_lanes(csiphy, settle_cnt); else csiphy_gen1_config_lanes(csiphy, cfg, settle_cnt); diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/media/platform/qcom/camss/camss-csiphy.c index 264c99efeae8..45b3a8e5dea4 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy.c @@ -578,6 +578,7 @@ int msm_csiphy_subdev_init(struct camss *camss, break; case CAMSS_845: case CAMSS_8250: + case CAMSS_8280XP: csiphy->formats = csiphy_formats_sdm845; csiphy->nformats = ARRAY_SIZE(csiphy_formats_sdm845); break; diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c index 2062be668f49..d875237cf244 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.c +++ b/drivers/media/platform/qcom/camss/camss-vfe.c @@ -225,6 +225,7 @@ static u32 vfe_src_pad_code(struct vfe_line *line, u32 sink_code, case CAMSS_660: case CAMSS_845: case CAMSS_8250: + case CAMSS_8280XP: switch (sink_code) { case MEDIA_BUS_FMT_YUYV8_1X16: { @@ -1518,6 +1519,7 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe, break; case CAMSS_845: case CAMSS_8250: + case CAMSS_8280XP: l->formats = formats_rdi_845; l->nformats = ARRAY_SIZE(formats_rdi_845); break; @@ -1595,6 +1597,23 @@ static const struct media_entity_operations vfe_media_ops = { .link_validate = v4l2_subdev_link_validate, }; +static int vfe_bpl_align(struct vfe_device *vfe) +{ + int ret = 8; + + switch (vfe->camss->res->version) { + case CAMSS_845: + case CAMSS_8250: + case CAMSS_8280XP: + ret = 16; + break; + default: + break; + } + + return ret; +} + /* * msm_vfe_register_entities - Register subdev node for VFE module * @vfe: VFE device @@ -1661,11 +1680,7 @@ int msm_vfe_register_entities(struct vfe_device *vfe, } video_out->ops = &vfe->video_ops; - if (vfe->camss->res->version == CAMSS_845 || - vfe->camss->res->version == CAMSS_8250) - video_out->bpl_alignment = 16; - else - video_out->bpl_alignment = 8; + video_out->bpl_alignment = vfe_bpl_align(vfe); video_out->line_based = 0; if (i == VFE_LINE_PIX) { video_out->bpl_alignment = 16; diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c index a89da5ef4710..54cd82f74115 100644 --- a/drivers/media/platform/qcom/camss/camss-video.c +++ b/drivers/media/platform/qcom/camss/camss-video.c @@ -1028,6 +1028,7 @@ int msm_video_register(struct camss_video *video, struct v4l2_device *v4l2_dev, break; case CAMSS_845: case CAMSS_8250: + case CAMSS_8280XP: video->formats = formats_rdi_845; video->nformats = ARRAY_SIZE(formats_rdi_845); break; -- 2.42.0