From nobody Wed Dec 17 19:08:04 2025 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 D58951F03E5 for ; Fri, 14 Mar 2025 23:36:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741995363; cv=none; b=TPFMNvfxjyzy35dySWq7EG/zo4xvuSmNaQX0/N7sQCbbIRRUXRDvPQj4lZD7wRqqtMCiP35rNMcRewtEJWLICjezyMRlR1STQ8g7Mbbpsj3O3/xhJgfe5bIUs9UUCMRix0wBnICdnHi1i9XZbsY4VhFm/jsLzHC11EXmDxzwRfY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741995363; c=relaxed/simple; bh=ukK58TSZD1mgx2a2RMEtx4bXeUeR9Zv1iJTR2sL5N+0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=r7dhx8rX1nVYBvUQozFrcnbqSQ7QrWtPpYilJ6GHBOFbFKaTTFnhSNmfBIHs6k1iqDDsXfUDUFpXeGo0gSLGoHnhFwxUnV2rVQAG6gmrcvpMAVWk5tGLVfWLbNAe86lv0EK3YhsJGZ7bBWyOE3M7aUfhRhzuYT5Fj1x4gUAH85o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=y0HHRgFp; arc=none smtp.client-ip=209.85.218.51 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="y0HHRgFp" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-ac2a089fbbdso477360866b.1 for ; Fri, 14 Mar 2025 16:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741995359; x=1742600159; 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=fgtbrNjg3RxK7lHji+uLlEjbRwxwoaENC7vutfrY5Ak=; b=y0HHRgFp9ITHESaB4ouBNW8Xfi/ZIiKkYQdNHFArfAXZzr6wL/vt5XlaE5U7Fwgrfu OajSvnTwrqfwDM1hraI4xpRhCW2VR2S6/pmSn8jxIqTSLfN/i3QoASB49Trz+oMlqJLi nftnRdzWrrYnOHYXhSAz4vzrRiKcsZEisPyGTyRT5ExLssmjvAGopMp2FMH+kcwTn+rf tlHvqxUgrPW9Z09JCtbubsqEDE3NUehuJnn5fKs0pnna+4cl+1F+81oT7oNwHpOOX+To VnBOzYmNIT4IEDp1i4CBiGOjUDAJ+6iifmqGGSHHvtmiL6lmXPfRMl+DPjT5+Fc7hACT Ftrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741995359; x=1742600159; 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=fgtbrNjg3RxK7lHji+uLlEjbRwxwoaENC7vutfrY5Ak=; b=J2pJlRhmAE8l4pTA6Y/0dtoP7K7bLuHJd4NDNj+1UVoJh+Rve/C6uMLl0wzgcNqwWz ktK0pfnM14Y5pHdutD8boQbMPrjNXo8odgjCjmOBIk2ztl14hDyQS436GL8TomDnc4TB MMp/j+c7y3lMBto2UT/KSARfO50MKhElHowlqcmXSpdKO9xj5Xla6KgujcMKlbIW9gO5 7WwygLb7o7sPly6x/WR+z9XWPNJ0RuHit29UQDydqPsjgm5UgFvGF5vfTtnBJrCJXfYG hFQEx/lB+mEwxJQXR5FdktSCD2ppNoiUMb6EnABffvMLmwfS6UqGoNY6T78VqwVDoojF wiZw== X-Forwarded-Encrypted: i=1; AJvYcCWiQOZ25rdxNNq7fT559uzv1MzOU9ry5N8s8AuLv1P0WMlmahhesTcr9hHwpICmWMigiSpssOpyJ1OUHdY=@vger.kernel.org X-Gm-Message-State: AOJu0Yzs+UHFBsdXEfmen7/FyGOGt0SFErnWD6fnO2awXhUr7JGA4eQZ FXcb8/QYO8ow3JKTokZjh7DPhO2f2t+l72iaPFwVtfY6sZHaL4aqvGeowhjKEYwAzbZ0Y/Kk0KL Lz9U/ag== X-Gm-Gg: ASbGnctm3+JWPZNWV0uDWPMmD7zEwYBn04P2lPmR97DhVtREoa/9l5BliGSvWV1CfZ0 /QtT2ci1Cm23Va5b8ROijhYvJGwGPn5a2RwPKlfpI6sSAFmLf8PMy2s1dd9gOwq68tZh2GmDvgK 5q7bzDza0/Ckttq5yFQEgqAcIhoBAGqvHp2BdjtmauRvBRmdjbpVfvmw2GcO23VviM2BQTEi78b 1hgFMCMvO6tkxWDDtd84KMYmFLz+e5snAfMX2MTwVbCpGZk5gH5QLqBqFtnvbkRIhxSHQVkLzT0 cwhhofvHF8k7AMAAuib9Cj7uBRjU8ukvAgGK0Pmgoo0DauqKB+P9tPHrW3PHsWAUnfmbslkDvz7 Gj08Ik+jlhcImf/TpVJ8AOJXZoMT9iXNUKzMk/bnwH+CusD7M2k94S65fXLgPFv4weycE X-Google-Smtp-Source: AGHT+IFioEfRk4etvKLgUi95Is5Nk227xfOzVnVRdw09cGLrCdUKOtOpJZvahOiRQ8jdUpxMj7pcgw== X-Received: by 2002:a17:907:2ce2:b0:ac2:d5d3:2b77 with SMTP id a640c23a62f3a-ac331304749mr433254266b.8.1741995358560; Fri, 14 Mar 2025 16:35:58 -0700 (PDT) Received: from [192.168.178.107] (2001-1c06-2302-5600-7555-cca3-bbc4-648b.cable.dynamic.v6.ziggo.nl. [2001:1c06:2302:5600:7555:cca3:bbc4:648b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3146aeadbsm284246966b.29.2025.03.14.16.35.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 16:35:57 -0700 (PDT) From: Bryan O'Donoghue Date: Fri, 14 Mar 2025 23:35:54 +0000 Subject: [PATCH v2 1/7] media: qcom: camss: Add an id property to struct resources 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: quoted-printable Message-Id: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-1-d163d66fcc0d@linaro.org> References: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-0-d163d66fcc0d@linaro.org> In-Reply-To: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-0-d163d66fcc0d@linaro.org> To: Robert Foss , Todor Tomov , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bryan O'Donoghue , Vladimir Zapolskiy X-Mailer: b4 0.14.2 In various places in CAMSS we assume a linear set of declared devices {csiphy0, csiphy1, csiphy2} which currently works for upstream SoCs but for upcoming SoCs some of the SoC resources will result in a set such as {csiphy0, csiphy2} which will break the naive for() loops we have. Introduce an identity property which resource declarations can populate hence facilitating non-linear resource naming. Reviewed-by: Vladimir Zapolskiy Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/camss/camss-csiphy.h | 1 + drivers/media/platform/qcom/camss/camss.c | 41 ++++++++++++++++++++= +++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.h b/drivers/med= ia/platform/qcom/camss/camss-csiphy.h index 86b98b37838e11d43d642c3f24e9a66acddabd03..ab91273303b9e3c67c4bcefe1e3= a67e1a47bf14f 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy.h +++ b/drivers/media/platform/qcom/camss/camss-csiphy.h @@ -81,6 +81,7 @@ struct csiphy_hw_ops { }; =20 struct csiphy_subdev_resources { + u8 id; const struct csiphy_hw_ops *hw_ops; const struct csiphy_formats *formats; }; diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/plat= form/qcom/camss/camss.c index 6791dfea91b13d584694a26599e24ca088dfc1ab..9da74da679a28070b101df06a84= 12e85efdcffcc 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -46,6 +46,7 @@ static const struct camss_subdev_resources csiphy_res_8x1= 6[] =3D { .reg =3D { "csiphy0", "csiphy0_clk_mux" }, .interrupt =3D { "csiphy0" }, .csiphy =3D { + .id =3D 0, .hw_ops =3D &csiphy_ops_2ph_1_0, .formats =3D &csiphy_formats_8x16 } @@ -62,6 +63,7 @@ static const struct camss_subdev_resources csiphy_res_8x1= 6[] =3D { .reg =3D { "csiphy1", "csiphy1_clk_mux" }, .interrupt =3D { "csiphy1" }, .csiphy =3D { + .id =3D 1, .hw_ops =3D &csiphy_ops_2ph_1_0, .formats =3D &csiphy_formats_8x16 } @@ -318,6 +320,7 @@ static const struct camss_subdev_resources csiphy_res_8= x96[] =3D { .reg =3D { "csiphy0", "csiphy0_clk_mux" }, .interrupt =3D { "csiphy0" }, .csiphy =3D { + .id =3D 0, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_8x96 } @@ -334,6 +337,7 @@ static const struct camss_subdev_resources csiphy_res_8= x96[] =3D { .reg =3D { "csiphy1", "csiphy1_clk_mux" }, .interrupt =3D { "csiphy1" }, .csiphy =3D { + .id =3D 1, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_8x96 } @@ -350,6 +354,7 @@ static const struct camss_subdev_resources csiphy_res_8= x96[] =3D { .reg =3D { "csiphy2", "csiphy2_clk_mux" }, .interrupt =3D { "csiphy2" }, .csiphy =3D { + .id =3D 2, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_8x96 } @@ -524,6 +529,7 @@ static const struct camss_subdev_resources csiphy_res_6= 60[] =3D { .reg =3D { "csiphy0", "csiphy0_clk_mux" }, .interrupt =3D { "csiphy0" }, .csiphy =3D { + .id =3D 0, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_8x96 } @@ -542,6 +548,7 @@ static const struct camss_subdev_resources csiphy_res_6= 60[] =3D { .reg =3D { "csiphy1", "csiphy1_clk_mux" }, .interrupt =3D { "csiphy1" }, .csiphy =3D { + .id =3D 1, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_8x96 } @@ -560,6 +567,7 @@ static const struct camss_subdev_resources csiphy_res_6= 60[] =3D { .reg =3D { "csiphy2", "csiphy2_clk_mux" }, .interrupt =3D { "csiphy2" }, .csiphy =3D { + .id =3D 2, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_8x96 } @@ -751,6 +759,7 @@ static const struct camss_subdev_resources csiphy_res_6= 70[] =3D { .reg =3D { "csiphy0" }, .interrupt =3D { "csiphy0" }, .csiphy =3D { + .id =3D 0, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -768,6 +777,7 @@ static const struct camss_subdev_resources csiphy_res_6= 70[] =3D { .reg =3D { "csiphy1" }, .interrupt =3D { "csiphy1" }, .csiphy =3D { + .id =3D 1, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -785,6 +795,7 @@ static const struct camss_subdev_resources csiphy_res_6= 70[] =3D { .reg =3D { "csiphy2" }, .interrupt =3D { "csiphy2" }, .csiphy =3D { + .id =3D 2, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -935,6 +946,7 @@ static const struct camss_subdev_resources csiphy_res_8= 45[] =3D { .reg =3D { "csiphy0" }, .interrupt =3D { "csiphy0" }, .csiphy =3D { + .id =3D 0, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -957,6 +969,7 @@ static const struct camss_subdev_resources csiphy_res_8= 45[] =3D { .reg =3D { "csiphy1" }, .interrupt =3D { "csiphy1" }, .csiphy =3D { + .id =3D 1, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -979,6 +992,7 @@ static const struct camss_subdev_resources csiphy_res_8= 45[] =3D { .reg =3D { "csiphy2" }, .interrupt =3D { "csiphy2" }, .csiphy =3D { + .id =3D 2, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -1001,6 +1015,7 @@ static const struct camss_subdev_resources csiphy_res= _845[] =3D { .reg =3D { "csiphy3" }, .interrupt =3D { "csiphy3" }, .csiphy =3D { + .id =3D 3, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -1179,6 +1194,7 @@ static const struct camss_subdev_resources csiphy_res= _8250[] =3D { .reg =3D { "csiphy0" }, .interrupt =3D { "csiphy0" }, .csiphy =3D { + .id =3D 0, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -1192,6 +1208,7 @@ static const struct camss_subdev_resources csiphy_res= _8250[] =3D { .reg =3D { "csiphy1" }, .interrupt =3D { "csiphy1" }, .csiphy =3D { + .id =3D 1, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -1205,6 +1222,7 @@ static const struct camss_subdev_resources csiphy_res= _8250[] =3D { .reg =3D { "csiphy2" }, .interrupt =3D { "csiphy2" }, .csiphy =3D { + .id =3D 2, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -1218,6 +1236,7 @@ static const struct camss_subdev_resources csiphy_res= _8250[] =3D { .reg =3D { "csiphy3" }, .interrupt =3D { "csiphy3" }, .csiphy =3D { + .id =3D 3, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -1231,6 +1250,7 @@ static const struct camss_subdev_resources csiphy_res= _8250[] =3D { .reg =3D { "csiphy4" }, .interrupt =3D { "csiphy4" }, .csiphy =3D { + .id =3D 4, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -1244,6 +1264,7 @@ static const struct camss_subdev_resources csiphy_res= _8250[] =3D { .reg =3D { "csiphy5" }, .interrupt =3D { "csiphy5" }, .csiphy =3D { + .id =3D 5, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -1458,6 +1479,7 @@ static const struct camss_subdev_resources csiphy_res= _7280[] =3D { .reg =3D { "csiphy0" }, .interrupt =3D { "csiphy0" }, .csiphy =3D { + .id =3D 0, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sc7280 } @@ -1472,6 +1494,7 @@ static const struct camss_subdev_resources csiphy_res= _7280[] =3D { .reg =3D { "csiphy1" }, .interrupt =3D { "csiphy1" }, .csiphy =3D { + .id =3D 1, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sc7280 } @@ -1486,6 +1509,7 @@ static const struct camss_subdev_resources csiphy_res= _7280[] =3D { .reg =3D { "csiphy2" }, .interrupt =3D { "csiphy2" }, .csiphy =3D { + .id =3D 2, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sc7280 } @@ -1500,6 +1524,7 @@ static const struct camss_subdev_resources csiphy_res= _7280[] =3D { .reg =3D { "csiphy3" }, .interrupt =3D { "csiphy3" }, .csiphy =3D { + .id =3D 3, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sc7280 } @@ -1514,6 +1539,7 @@ static const struct camss_subdev_resources csiphy_res= _7280[] =3D { .reg =3D { "csiphy4" }, .interrupt =3D { "csiphy4" }, .csiphy =3D { + .id =3D 4, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sc7280 } @@ -1766,6 +1792,7 @@ static const struct camss_subdev_resources csiphy_res= _sc8280xp[] =3D { .reg =3D { "csiphy0" }, .interrupt =3D { "csiphy0" }, .csiphy =3D { + .id =3D 0, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -1779,6 +1806,7 @@ static const struct camss_subdev_resources csiphy_res= _sc8280xp[] =3D { .reg =3D { "csiphy1" }, .interrupt =3D { "csiphy1" }, .csiphy =3D { + .id =3D 1, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -1792,6 +1820,7 @@ static const struct camss_subdev_resources csiphy_res= _sc8280xp[] =3D { .reg =3D { "csiphy2" }, .interrupt =3D { "csiphy2" }, .csiphy =3D { + .id =3D 2, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -1805,6 +1834,7 @@ static const struct camss_subdev_resources csiphy_res= _sc8280xp[] =3D { .reg =3D { "csiphy3" }, .interrupt =3D { "csiphy3" }, .csiphy =3D { + .id =3D 3, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -2134,6 +2164,7 @@ static const struct camss_subdev_resources csiphy_res= _8550[] =3D { .reg =3D { "csiphy0" }, .interrupt =3D { "csiphy0" }, .csiphy =3D { + .id =3D 0, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -2147,6 +2178,7 @@ static const struct camss_subdev_resources csiphy_res= _8550[] =3D { .reg =3D { "csiphy1" }, .interrupt =3D { "csiphy1" }, .csiphy =3D { + .id =3D 1, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -2160,6 +2192,7 @@ static const struct camss_subdev_resources csiphy_res= _8550[] =3D { .reg =3D { "csiphy2" }, .interrupt =3D { "csiphy2" }, .csiphy =3D { + .id =3D 2, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -2173,6 +2206,7 @@ static const struct camss_subdev_resources csiphy_res= _8550[] =3D { .reg =3D { "csiphy3" }, .interrupt =3D { "csiphy3" }, .csiphy =3D { + .id =3D 3, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -2186,6 +2220,7 @@ static const struct camss_subdev_resources csiphy_res= _8550[] =3D { .reg =3D { "csiphy4" }, .interrupt =3D { "csiphy4" }, .csiphy =3D { + .id =3D 4, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -2199,6 +2234,7 @@ static const struct camss_subdev_resources csiphy_res= _8550[] =3D { .reg =3D { "csiphy5" }, .interrupt =3D { "csiphy5" }, .csiphy =3D { + .id =3D 5, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -2212,6 +2248,7 @@ static const struct camss_subdev_resources csiphy_res= _8550[] =3D { .reg =3D { "csiphy6" }, .interrupt =3D { "csiphy6" }, .csiphy =3D { + .id =3D 6, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -2225,6 +2262,7 @@ static const struct camss_subdev_resources csiphy_res= _8550[] =3D { .reg =3D { "csiphy7" }, .interrupt =3D { "csiphy7" }, .csiphy =3D { + .id =3D 7, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -2749,7 +2787,8 @@ static int camss_init_subdevices(struct camss *camss) =20 for (i =3D 0; i < camss->res->csiphy_num; i++) { ret =3D msm_csiphy_subdev_init(camss, &camss->csiphy[i], - &res->csiphy_res[i], i); + &res->csiphy_res[i], + res->csiphy_res[i].csiphy.id); if (ret < 0) { dev_err(camss->dev, "Failed to init csiphy%d sub-device: %d\n", --=20 2.48.1 From nobody Wed Dec 17 19:08:04 2025 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (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 714511F3B8B for ; Fri, 14 Mar 2025 23:36:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741995363; cv=none; b=MDbn4B4CdhQc9KSaJxLtLXLCYaRS8XDZ4R5zY5GIYfnRq9spdmUnoyrSKnvY/DX2/Hh6H2XavQEXAtG3kMDiJAB4LOIgiZ2d+XK/aXm8EgFHVocUiU+OiyE7LKe3GB7tVBOBoAp0cnfOdLgn/jEdRmFiylRYMuCPIPMExgdsOXo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741995363; c=relaxed/simple; bh=zqZuL7y2zz8Z5aLjOZmpn3nFoIVpo+K0JqZU4el81sg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DpkUwEOdegj9aVhuUGXHIc1TFsOfMmR+q3a/9fzGEinyrwB4olqFDHJwL2xO0s08p4g+4CKr6rYMil4ONRfY9n7Of0SeLy9ouJUfNusn5a/8iQDl1EkKJqzXBynEuC//r+X2GlWfmonGlBYYKJ/PzdjVrPl6j2vGHUZqCMrbuPg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Q11i4A+n; arc=none smtp.client-ip=209.85.218.47 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Q11i4A+n" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-aaf900cc7fbso495927366b.3 for ; Fri, 14 Mar 2025 16:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741995359; x=1742600159; 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=zh5mSsP+CPUK/p+5IIg657ozBms22Tvquc5MSQ7N3gU=; b=Q11i4A+nxwterXfB7UPlGFlQt3nIEYbrTCIDAtAyDeF3XV6rNaTU+dgQZIA2aTjyg6 8a4n68rRwuZIiu3qwutz0XFw6v4WiNoQZXAnUJfybmkLG4mU6xmBQnoPOYjIkMnt66bn eNVXkx+CHp+YpwLWamUXQ+2+87BeGGkSyyquzHwvGeHPESeHJsYXmeWKjmZ9Y+spZe9L 5Irf4Efsy73KsmRdirJ68HGwZ6NQQhbAvfbllMDMl0RQopgKSV1X8Z5XzW/hNRHzGAOZ SYrlzTBoQKFEDTHxz0iXIzjl1fRE92To1GGotX2obKWY1XYZPKJ+zS16cbFGcX4PchQP dfkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741995359; x=1742600159; 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=zh5mSsP+CPUK/p+5IIg657ozBms22Tvquc5MSQ7N3gU=; b=SCvILgbh+MswRxeTeIP0rtwuXjFU6OL3hA+kx4xHRvAhOR2h6bWQb1uOo4v/tF/mfx /gG42Pn0s0kkCOjjo5b3ybu+mARR7JITnohwbNcQQ8HDIoSXpOyoudYfw0q1vG1wtpOG RrObXsu4eGEEaAqBn8mP5MS4KglOOk3eyQtorcYtXMlRAm1qkYeTFYVWEFRHicN9QOoV BpAwojUMe4y6fnSXefoeZGv9Cx/EqAiLbVmzpIkBl5MGMrCSeBSpWgMJmGPpiU+A8mmK LBGmvZmhtXJt8J8beUJ/JLmj85Q0QfJMWvZ3mGiHS1gPKnwCmqzc4JyUp6uKAVJbvMV4 OabQ== X-Forwarded-Encrypted: i=1; AJvYcCVTy6EkgAf0z56C1TzDrwkxxgJkNilNxGihLfE8hHR/she1uVBoNK8vk8cEj3PQcRRceswwHKwMYHOZv38=@vger.kernel.org X-Gm-Message-State: AOJu0YycWKgOcpyCYpIAfI8nBcQhqOgfHtJmexg+E3n8VPsvKwzTWToi MNsPPwrHgfBvnVeoJ1B85uGaVHUi0sASxSyLv07xQzedxq+qhZEukStAFWhlKtZd4U8g6/EojU5 BwtjeRA== X-Gm-Gg: ASbGncuaY+CcOwDy7IYuTC3wnbuLGruaR1GZMwMMLRe7hAdWZIaT1eGs3+GFbgFThwK EflVDi+XO+RAZjzdJxi2WO2poF1dqGccZr9N91+7M8CWCCPP1YTXFc+wI9TxgWUOTk6niJEyIVV FuFkK6l9kHJOFYcr7M/Uqz41iBONWTQxDtTSsxYxsNw3+Tm6WAqjo0cY55p3DxKRhI7DIo4826q zubGqrl5pzxwi60KlXsANFmfH+z9FShHWvMRc5359c+5H2UGCrdUQvPC3n/RVxdzm7/G0RY7OHN 3sMub8H9Ta0MznRk8619Ne+z+GPb+XPVMl7pL2SggRBW/Ciodv3sDqi5L0kh+vWj6OH8QVFahFi NoF0rQvAcwDtgQCBMMDDcqLvgMYcfaXHfcOZ0dxmXRYr8iB7O+uC75zHA7VzwRPbBXhDv X-Google-Smtp-Source: AGHT+IG6nhastrg8lGmw+aj1tV6koccwxzYEiAixZksntYlUmcCP3TXBqPSKmVTdhJD6wI4rRFOwkQ== X-Received: by 2002:a17:907:72cd:b0:ac2:6837:6248 with SMTP id a640c23a62f3a-ac3301e8dacmr338954166b.30.1741995359435; Fri, 14 Mar 2025 16:35:59 -0700 (PDT) Received: from [192.168.178.107] (2001-1c06-2302-5600-7555-cca3-bbc4-648b.cable.dynamic.v6.ziggo.nl. [2001:1c06:2302:5600:7555:cca3:bbc4:648b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3146aeadbsm284246966b.29.2025.03.14.16.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 16:35:59 -0700 (PDT) From: Bryan O'Donoghue Date: Fri, 14 Mar 2025 23:35:55 +0000 Subject: [PATCH v2 2/7] media: qcom: camss: Use the CSIPHY id property to find clock names 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: quoted-printable Message-Id: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-2-d163d66fcc0d@linaro.org> References: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-0-d163d66fcc0d@linaro.org> In-Reply-To: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-0-d163d66fcc0d@linaro.org> To: Robert Foss , Todor Tomov , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bryan O'Donoghue , Vladimir Zapolskiy X-Mailer: b4 0.14.2 Use the CSIPHY id property to find clock names instead of relying on generating the clock names based on the control-loop index. x1e80100 has CSIPHY0, CSIPHY1, CSIPHY2 and CSIPHY4 so simple index naming won't work whereas and 'id' property allows any ordering and any stepping between the CSIPHY names. Reviewed-by: Vladimir Zapolskiy Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/camss/camss-csiphy.c | 28 +++++++++++---------= ---- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/med= ia/platform/qcom/camss/camss-csiphy.c index c053616558a73c4a285a576c671aca47d05290f8..c622efcc92ff3781d7fc3ace025= 3c2d64c91e847 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy.c @@ -586,7 +586,7 @@ int msm_csiphy_subdev_init(struct camss *camss, { struct device *dev =3D camss->dev; struct platform_device *pdev =3D to_platform_device(dev); - int i, j, k; + int i, j; int ret; =20 csiphy->camss =3D camss; @@ -680,23 +680,21 @@ int msm_csiphy_subdev_init(struct camss *camss, for (j =3D 0; j < clock->nfreqs; j++) clock->freq[j] =3D res->clock_rate[i][j]; =20 - for (k =3D 0; k < camss->res->csiphy_num; k++) { - csiphy->rate_set[i] =3D csiphy_match_clock_name(clock->name, - "csiphy%d_timer", k); - if (csiphy->rate_set[i]) - break; - - if (camss->res->version =3D=3D CAMSS_660) { - csiphy->rate_set[i] =3D csiphy_match_clock_name(clock->name, - "csi%d_phy", k); - if (csiphy->rate_set[i]) - break; - } + csiphy->rate_set[i] =3D csiphy_match_clock_name(clock->name, + "csiphy%d_timer", + csiphy->id); + if (csiphy->rate_set[i]) + continue; =20 - csiphy->rate_set[i] =3D csiphy_match_clock_name(clock->name, "csiphy%d"= , k); + if (camss->res->version =3D=3D CAMSS_660) { + csiphy->rate_set[i] =3D csiphy_match_clock_name(clock->name, + "csi%d_phy", + csiphy->id); if (csiphy->rate_set[i]) - break; + continue; } + + csiphy->rate_set[i] =3D csiphy_match_clock_name(clock->name, "csiphy%d",= csiphy->id); } =20 /* CSIPHY supplies */ --=20 2.48.1 From nobody Wed Dec 17 19:08:04 2025 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 956CD1F5839 for ; Fri, 14 Mar 2025 23:36:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741995366; cv=none; b=cOPhHBCoCTHAyuVKQtdzsGELRv8zi3mRBR+4zCZsy0GI0nCbjO5YSonKFfPqAVfB+MhHVAB+ZKQ6txmCJNiszEiJ7GpDgmvkABqdTnUSCbK08CoiUT3D4C1g++xxSS6muMoeZAgrdA85uiMaKwAvnnrkwCGlpZhtEBVhTxIJ8qk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741995366; c=relaxed/simple; bh=O7xWFJc5+4ujWnOHiT/qvQxKGnZsRKBl3BYu8xK4Zi4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Lom9EdXSympOiJhKmp0wXV2NdbFvay5mieTfI3JzQrq4SwWYGZ7CtmkbqcJzJb+N7uiWsVs/zvCPVfp7ov1fRZJtByVLv972JUutJBCt8Wj0uOmqKByghBzhm2S6tGrtOLBygk5w0zMPprh7H3EDUfDgtIjhun9FyZ1Url0EmMY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=qZqCbO/M; arc=none smtp.client-ip=209.85.218.51 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="qZqCbO/M" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-ac345bd8e13so53044066b.0 for ; Fri, 14 Mar 2025 16:36:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741995362; x=1742600162; 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=6Hc0d6eFecdsJvWli5NDhIDXrT6X3XLnxW35pcwgovo=; b=qZqCbO/My6eEcLUmI38RCYo5IgMxJkYq503DhTtsbyujQvAHmdbEcy9aMvXwWZZ0NS G+Ed/NHLMKUjHdrLeo6LDZ+6nOPRbFe9CyPRy+SXh1wwwuUMWBKuSkRT95K1B1qErqxX aQrY0muY2C9TSgZxWI1MW4C1ju6Q1lw0vzmJfqhjF1JS7Ay8/UAXGSvRr6A8OcnARHbK cP54RCln3L9hoEYl+wIsYM5whzUqzXN8VLh48wL+cezwpxg1B5bFm+TYE+OWgI8/0QFo ErUXKntZFj3RqUZfStAnIoWkbJlN6i+7Vugh1WdBDWoWCVWd4iry/mcR6rEnj5CFp9I/ +jdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741995362; x=1742600162; 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=6Hc0d6eFecdsJvWli5NDhIDXrT6X3XLnxW35pcwgovo=; b=CyVOEyBdz78a9e/EI12t25JC1IV8YhOWFyoYXk+TM/APFQZaydFGWLbrUptWSsdl41 JDQIOnYeU8Qif9t8WIDV1bUbjFL6H1AX4gB3ebvtqCt1s+EYKH+yvt+gMoOSQTZfgn3f n9ZTMoJ2Z9uu22mXbyZkcX8xSKab7CF3jUBeifX2+hGY8gLK1fzU0T0hdfLOyZEclOni Zh/Q8EKP2ZyOqaeVvLmgGng9bRiYvCyem3bBUtDI/5CwrJH1A+yollihH1Hx+bcGe+fm noq/WiAvmN/Mzdi+glUoTp6csesqELnMVA082MZj9067NNj6bSOyGhm7QvrJu7m54klp 375g== X-Forwarded-Encrypted: i=1; AJvYcCVS2OOblhEBDyuuDL+VxYJlTxdnRfn1gFy126kj6dNmiXRa2JxwOQI1SLb7oPOWR7dlvF0GxT1czh0tgzY=@vger.kernel.org X-Gm-Message-State: AOJu0YwrK6bkVdjqXAda05F1anuaaBk6U5mvmkGzgN7oSFdfPsf3tmbX NV3c6E8YmjoTaVy9cwjnwu4H2UA8lqzkDBj++YYm93W5zWqMoA/6TQEGZh7uNWEXoHfpAhHJtCe aO3DUng== X-Gm-Gg: ASbGncupkj5AmhQWAdaGQlHR+9sH+5ZUvInk15GtAFao/cFdyKf8wkXqC6Vats82pet YYXNyUqGwyGK4f5c3hnSVjshxb4cKmYT1wy8M+D3bS3kdaBV/elNPZKkJucJPx+Gxq62savN6qQ eMOghWi5lnb3fTMxk7RTiakInFDFbc025c3OCf0XLH8T2d4TVgrbGS/lIqWVbUpxe/0olJQdo5b JmbVxNbOsH3UpG1uhdHbUeUhCh0KYm2RdpNmbDaa31GYOt7ItgIA9/I+xBzimEC740dCFPQTRD7 +JLfSQk1mgEipkc86RAod/ZGwO+03eqpLw5mDrQyptOQd6gMsceOjWwERmimkJDl2QnRmKNZD32 S446pz6kc6ROPAK0c8LrPjUFgPD9UYxbWUW8vipZhueoP7T2WGbz30jPaP3Y0xJfx3Htpd2FQV+ wzPc8= X-Google-Smtp-Source: AGHT+IEhC9g8Jad94HvaXLG+3lIX4tP2GlsKy0wlQWEIgTOnPJQQ1rYcluS+cjHlemsmrncF1sU+Gg== X-Received: by 2002:a17:907:7241:b0:ac1:e332:b1f5 with SMTP id a640c23a62f3a-ac330371508mr558125866b.37.1741995361523; Fri, 14 Mar 2025 16:36:01 -0700 (PDT) Received: from [192.168.178.107] (2001-1c06-2302-5600-7555-cca3-bbc4-648b.cable.dynamic.v6.ziggo.nl. [2001:1c06:2302:5600:7555:cca3:bbc4:648b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3146aeadbsm284246966b.29.2025.03.14.16.35.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 16:36:00 -0700 (PDT) From: Bryan O'Donoghue Date: Fri, 14 Mar 2025 23:35:56 +0000 Subject: [PATCH v2 3/7] media: qcom: camss: Add CSID 680 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: quoted-printable Message-Id: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-3-d163d66fcc0d@linaro.org> References: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-0-d163d66fcc0d@linaro.org> In-Reply-To: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-0-d163d66fcc0d@linaro.org> To: Robert Foss , Todor Tomov , 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.14.2 Add CSI Decoder (CSID) 680 support to CAMSS. This version of CSID has been shipped with SM8450 and x1e chips. References work from Vladimir Zapolskiy Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/camss/Makefile | 1 + drivers/media/platform/qcom/camss/camss-csid-680.c | 422 +++++++++++++++++= ++++ drivers/media/platform/qcom/camss/camss-csid.h | 1 + 3 files changed, 424 insertions(+) diff --git a/drivers/media/platform/qcom/camss/Makefile b/drivers/media/pla= tform/qcom/camss/Makefile index f6db5b3b5ace3bc1cd06fd8e08a639e5a34ee4a0..71797745f2f712929f76f6b97f7= 5457bc59e35ab 100644 --- a/drivers/media/platform/qcom/camss/Makefile +++ b/drivers/media/platform/qcom/camss/Makefile @@ -6,6 +6,7 @@ qcom-camss-objs +=3D \ camss-csid.o \ camss-csid-4-1.o \ camss-csid-4-7.o \ + camss-csid-680.o \ camss-csid-gen2.o \ camss-csid-780.o \ camss-csiphy-2ph-1-0.o \ diff --git a/drivers/media/platform/qcom/camss/camss-csid-680.c b/drivers/m= edia/platform/qcom/camss/camss-csid-680.c new file mode 100644 index 0000000000000000000000000000000000000000..3ad3a174bcfb8c0d319930d0010= df92308cb5ae4 --- /dev/null +++ b/drivers/media/platform/qcom/camss/camss-csid-680.c @@ -0,0 +1,422 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Qualcomm MSM Camera Subsystem - CSID (CSI Decoder) Module + * + * Copyright (C) 2020-2025 Linaro Ltd. + */ +#include +#include +#include +#include + +#include "camss.h" +#include "camss-csid.h" +#include "camss-csid-gen2.h" + +#define CSID_TOP_IO_PATH_CFG0(csid) (0x4 * (csid)) +#define CSID_TOP_IO_PATH_CFG0_INTERNAL_CSID BIT(0) +#define CSID_TOP_IO_PATH_CFG0_SFE_0 BIT(1) +#define CSID_TOP_IO_PATH_CFG0_SFE_1 GENMASK(1, 0) +#define CSID_TOP_IO_PATH_CFG0_SBI_0 BIT(4) +#define CSID_TOP_IO_PATH_CFG0_SBI_1 GENMASK(3, 0) +#define CSID_TOP_IO_PATH_CFG0_SBI_2 GENMASK(3, 1) +#define CSID_TOP_IO_PATH_CFG0_OUTPUT_IFE_EN BIT(8) +#define CSID_TOP_IO_PATH_CFG0_SFE_OFFLINE_EN BIT(12) + +#define CSID_RESET_CMD 0x10 +#define CSID_RESET_CMD_HW_RESET BIT(0) +#define CSID_RESET_CMD_SW_RESET BIT(1) +#define CSID_RESET_CMD_IRQ_CTRL BIT(2) + +#define CSID_IRQ_CMD 0x14 +#define CSID_IRQ_CMD_CLEAR BIT(0) +#define CSID_IRQ_CMD_SET BIT(4) + +#define CSID_REG_UPDATE_CMD 0x18 + +#define CSID_CSI2_RDIN_IRQ_STATUS(rdi) (0xec + 0x10 * (rdi)) +#define CSID_CSI2_RDIN_CCIF_VIOLATION BIT(29) +#define CSID_CSI2_RDIN_SENSOR_SWITCH_OUT_OF_SYNC_FRAME_DROP BIT(28) +#define CSID_CSI2_RDIN_ERROR_REC_WIDTH_VIOLATION BIT(27) +#define CSID_CSI2_RDIN_ERROR_REC_HEIGHT_VIOLATION BIT(26) +#define CSID_CSI2_RDIN_BATCH_END_MISSING_VIOLATION BIT(25) +#define CSID_CSI2_RDIN_ILLEGAL_BATCH_ID_IRQ BIT(24) +#define CSID_CSI2_RDIN_RUP_DONE BIT(23) +#define CSID_CSI2_RDIN_CAMIF_EPOCH_1_IRQ BIT(22) +#define CSID_CSI2_RDIN_CAMIF_EPOCH_0_IRQ BIT(21) +#define CSID_CSI2_RDIN_ERROR_REC_OVERFLOW_IRQ BIT(19) +#define CSID_CSI2_RDIN_ERROR_REC_FRAME_DROP BIT(18) +#define CSID_CSI2_RDIN_VCDT_GRP_CHANG BIT(17) +#define CSID_CSI2_RDIN_VCDT_GRP_0_SEL BIT(16) +#define CSID_CSI2_RDIN_VCDT_GRP_1_SEL BIT(15) +#define CSID_CSI2_RDIN_ERROR_LINE_COUNT BIT(14) +#define CSID_CSI2_RDIN_ERROR_PIX_COUNT BIT(13) +#define CSID_CSI2_RDIN_INFO_INPUT_SOF BIT(12) +#define CSID_CSI2_RDIN_INFO_INPUT_SOL BIT(11) +#define CSID_CSI2_RDIN_INFO_INPUT_EOL BIT(10) +#define CSID_CSI2_RDIN_INFO_INPUT_EOF BIT(9) +#define CSID_CSI2_RDIN_INFO_FRAME_DROP_SOF BIT(8) +#define CSID_CSI2_RDIN_INFO_FRAME_DROP_SOL BIT(7) +#define CSID_CSI2_RDIN_INFO_FRAME_DROP_EOL BIT(6) +#define CSID_CSI2_RDIN_INFO_FRAME_DROP_EOF BIT(5) +#define CSID_CSI2_RDIN_INFO_CAMIF_SOF BIT(4) +#define CSID_CSI2_RDIN_INFO_CAMIF_EOF BIT(3) +#define CSID_CSI2_RDIN_INFO_FIFO_OVERFLOW BIT(2) +#define CSID_CSI2_RDIN_RES1 BIT(1) +#define CSID_CSI2_RDIN_RES0 BIT(0) + +#define CSID_CSI2_RDIN_IRQ_MASK(rdi) (0xf0 + 0x10 * (rdi)) +#define CSID_CSI2_RDIN_IRQ_CLEAR(rdi) (0xf4 + 0x10 * (rdi)) +#define CSID_CSI2_RDIN_IRQ_SET(rdi) (0xf8 + 0x10 * (rdi)) + +#define CSID_TOP_IRQ_STATUS 0x7c +#define CSID_TOP_IRQ_MASK 0x80 +#define CSID_TOP_IRQ_CLEAR 0x84 +#define CSID_TOP_IRQ_RESET BIT(0) +#define CSID_TOP_IRQ_RX BIT(2) +#define CSID_TOP_IRQ_LONG_PKT(rdi) (BIT(8) << (rdi)) +#define CSID_TOP_IRQ_BUF_DONE BIT(13) + +#define CSID_BUF_DONE_IRQ_STATUS 0x8c +#define BUF_DONE_IRQ_STATUS_RDI_OFFSET (csid_is_lite(csid) ? 1 : 14) +#define CSID_BUF_DONE_IRQ_MASK 0x90 +#define CSID_BUF_DONE_IRQ_CLEAR 0x94 + +#define CSID_CSI2_RX_IRQ_STATUS 0x9c +#define CSID_CSI2_RX_IRQ_MASK 0xa0 +#define CSID_CSI2_RX_IRQ_CLEAR 0xa4 + +#define CSID_RESET_CFG 0xc +#define CSID_RESET_CFG_MODE_IMMEDIATE BIT(0) +#define CSID_RESET_CFG_LOCATION_COMPLETE BIT(4) + +#define CSID_CSI2_RDI_IRQ_STATUS(rdi) (0xec + 0x10 * (rdi)) +#define CSID_CSI2_RDI_IRQ_MASK(rdi) (0xf0 + 0x10 * (rdi)) +#define CSID_CSI2_RDI_IRQ_CLEAR(rdi) (0xf4 + 0x10 * (rdi)) + +#define CSID_CSI2_RX_CFG0 0x200 +#define CSI2_RX_CFG0_NUM_ACTIVE_LANES 0 +#define CSI2_RX_CFG0_DL0_INPUT_SEL 4 +#define CSI2_RX_CFG0_DL1_INPUT_SEL 8 +#define CSI2_RX_CFG0_DL2_INPUT_SEL 12 +#define CSI2_RX_CFG0_DL3_INPUT_SEL 16 +#define CSI2_RX_CFG0_PHY_NUM_SEL 20 +#define CSI2_RX_CFG0_PHY_SEL_BASE_IDX 1 +#define CSI2_RX_CFG0_PHY_TYPE_SEL 24 + +#define CSID_CSI2_RX_CFG1 0x204 +#define CSI2_RX_CFG1_PACKET_ECC_CORRECTION_EN BIT(0) +#define CSI2_RX_CFG1_DE_SCRAMBLE_EN BIT(1) +#define CSI2_RX_CFG1_VC_MODE BIT(2) +#define CSI2_RX_CFG1_COMPLETE_STREAM_EN BIT(4) +#define CSI2_RX_CFG1_COMPLETE_STREAM_FRAME_TIMING BIT(5) +#define CSI2_RX_CFG1_MISR_EN BIT(6) +#define CSI2_RX_CFG1_CGC_MODE BIT(7) + +#define CSID_CSI2_RX_CAPTURE_CTRL 0x208 +#define CSI2_RX_CAPTURE_CTRL_LONG_PKT_EN BIT(0) +#define CSI2_RX_CAPTURE_CTRL_SHORT_PKT_EN BIT(1) +#define CSI2_RX_CAPTURE_CTRL_CPHY_PKT_EN BIT(2) +#define CSI2_RX_CAPTURE_CTRL_LONG_PKT_DT GENMASK(9, 4) +#define CSI2_RX_CAPTURE_CTRL_LONG_PKT_VC GENMASK(14, 10) +#define CSI2_RX_CAPTURE_CTRL_SHORT_PKT_VC GENMASK(19, 15) +#define CSI2_RX_CAPTURE_CTRL_CPHY_PKT_DT GENMASK(20, 25) +#define CSI2_RX_CAPTURE_CTRL_CPHY_PKT_VC GENMASK(30, 26) + +#define CSID_CSI2_RX_TOTAL_PKTS_RCVD 0x240 +#define CSID_CSI2_RX_STATS_ECC 0x244 +#define CSID_CSI2_RX_CRC_ERRORS 0x248 + +#define CSID_RDI_CFG0(rdi) (0x500 + 0x100 * (rdi)) +#define RDI_CFG0_DECODE_FORMAT 12 +#define RDI_CFG0_DATA_TYPE 16 +#define RDI_CFG0_VIRTUAL_CHANNEL 22 +#define RDI_CFG0_DT_ID 27 +#define RDI_CFG0_ENABLE BIT(31) + +#define CSID_RDI_CTRL(rdi) (0x504 + 0x100 * (rdi)) +#define CSID_RDI_CTRL_HALT_CMD_HALT_AT_FRAME_BOUNDARY 0 +#define CSID_RDI_CTRL_HALT_CMD_RESUME_AT_FRAME_BOUNDARY 1 + +#define CSID_RDI_CFG1(rdi) (0x510 + 0x100 * (rdi)) +#define RDI_CFG1_TIMESTAMP_STB_FRAME BIT(0) +#define RDI_CFG1_TIMESTAMP_STB_IRQ BIT(1) +#define RDI_CFG1_BYTE_CNTR_EN BIT(2) +#define RDI_CFG1_TIMESTAMP_EN BIT(4) +#define RDI_CFG1_DROP_H_EN BIT(5) +#define RDI_CFG1_DROP_V_EN BIT(6) +#define RDI_CFG1_CROP_H_EN BIT(7) +#define RDI_CFG1_CROP_V_EN BIT(8) +#define RDI_CFG1_MISR_EN BIT(9) +#define RDI_CFG1_PLAIN_ALIGN_MSB BIT(11) +#define RDI_CFG1_EARLY_EOF_EN BIT(14) +#define RDI_CFG1_PACKING_MIPI BIT(15) + +#define CSID_RDI_ERR_RECOVERY_CFG0(rdi) (0x514 + 0x100 * (rdi)) +#define CSID_RDI_EPOCH_IRQ_CFG(rdi) (0x52c + 0x100 * (rdi)) +#define CSID_RDI_FRM_DROP_PATTERN(rdi) (0x540 + 0x100 * (rdi)) +#define CSID_RDI_FRM_DROP_PERIOD(rdi) (0x544 + 0x100 * (rdi)) +#define CSID_RDI_IRQ_SUBSAMPLE_PATTERN(rdi) (0x548 + 0x100 * (rdi)) +#define CSID_RDI_IRQ_SUBSAMPLE_PERIOD(rdi) (0x54c + 0x100 * (rdi)) +#define CSID_RDI_PIX_DROP_PATTERN(rdi) (0x558 + 0x100 * (rdi)) +#define CSID_RDI_PIX_DROP_PERIOD(rdi) (0x55c + 0x100 * (rdi)) +#define CSID_RDI_LINE_DROP_PATTERN(rdi) (0x560 + 0x100 * (rdi)) +#define CSID_RDI_LINE_DROP_PERIOD(rdi) (0x564 + 0x100 * (rdi)) + +static inline int reg_update_rdi(struct csid_device *csid, int n) +{ + return BIT(4 + n) + BIT(20 + n); +} + +static void csid_reg_update(struct csid_device *csid, int port_id) +{ + csid->reg_update |=3D reg_update_rdi(csid, port_id); + writel(csid->reg_update, csid->base + CSID_REG_UPDATE_CMD); +} + +static inline void csid_reg_update_clear(struct csid_device *csid, + int port_id) +{ + csid->reg_update &=3D ~reg_update_rdi(csid, port_id); + writel(csid->reg_update, csid->base + CSID_REG_UPDATE_CMD); +} + +static void __csid_configure_rx(struct csid_device *csid, + struct csid_phy_config *phy, int vc) +{ + u32 val; + + val =3D (phy->lane_cnt - 1) << CSI2_RX_CFG0_NUM_ACTIVE_LANES; + val |=3D phy->lane_assign << CSI2_RX_CFG0_DL0_INPUT_SEL; + val |=3D (phy->csiphy_id + CSI2_RX_CFG0_PHY_SEL_BASE_IDX) << CSI2_RX_CFG0= _PHY_NUM_SEL; + + writel(val, csid->base + CSID_CSI2_RX_CFG0); + + val =3D CSI2_RX_CFG1_PACKET_ECC_CORRECTION_EN; + if (vc > 3) + val |=3D CSI2_RX_CFG1_VC_MODE; + writel(val, csid->base + CSID_CSI2_RX_CFG1); +} + +static void __csid_ctrl_rdi(struct csid_device *csid, int enable, u8 rdi) +{ + u32 val; + + if (enable) + val =3D CSID_RDI_CTRL_HALT_CMD_RESUME_AT_FRAME_BOUNDARY; + else + val =3D CSID_RDI_CTRL_HALT_CMD_HALT_AT_FRAME_BOUNDARY; + + writel(val, csid->base + CSID_RDI_CTRL(rdi)); +} + +static void __csid_configure_top(struct csid_device *csid) +{ + u32 val; + + val =3D CSID_TOP_IO_PATH_CFG0_OUTPUT_IFE_EN | CSID_TOP_IO_PATH_CFG0_INTER= NAL_CSID; + writel(val, csid->camss->csid_wrapper_base + + CSID_TOP_IO_PATH_CFG0(csid->id)); +} + +static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enabl= e, u8 vc) +{ + struct v4l2_mbus_framefmt *input_format =3D &csid->fmt[MSM_CSID_PAD_FIRST= _SRC + vc]; + const struct csid_format_info *format =3D csid_get_fmt_entry(csid->res->f= ormats->formats, + csid->res->formats->nformats, + input_format->code); + u8 lane_cnt =3D csid->phy.lane_cnt; + u8 dt_id; + u32 val; + + if (!lane_cnt) + lane_cnt =3D 4; + + val =3D 0; + writel(val, csid->base + CSID_RDI_FRM_DROP_PERIOD(vc)); + + /* + * DT_ID is a two bit bitfield that is concatenated with + * the four least significant bits of the five bit VC + * bitfield to generate an internal CID value. + * + * CSID_RDI_CFG0(vc) + * DT_ID : 28:27 + * VC : 26:22 + * DT : 21:16 + * + * CID : VC 3:0 << 2 | DT_ID 1:0 + */ + dt_id =3D vc & 0x03; + + /* note: for non-RDI path, this should be format->decode_format */ + val |=3D DECODE_FORMAT_PAYLOAD_ONLY << RDI_CFG0_DECODE_FORMAT; + val |=3D format->data_type << RDI_CFG0_DATA_TYPE; + val |=3D vc << RDI_CFG0_VIRTUAL_CHANNEL; + val |=3D dt_id << RDI_CFG0_DT_ID; + writel(val, csid->base + CSID_RDI_CFG0(vc)); + + val =3D RDI_CFG1_TIMESTAMP_STB_FRAME; + val |=3D RDI_CFG1_BYTE_CNTR_EN; + val |=3D RDI_CFG1_TIMESTAMP_EN; + val |=3D RDI_CFG1_DROP_H_EN; + val |=3D RDI_CFG1_DROP_V_EN; + val |=3D RDI_CFG1_CROP_H_EN; + val |=3D RDI_CFG1_CROP_V_EN; + val |=3D RDI_CFG1_PACKING_MIPI; + + writel(val, csid->base + CSID_RDI_CFG1(vc)); + + val =3D 0; + writel(val, csid->base + CSID_RDI_IRQ_SUBSAMPLE_PERIOD(vc)); + + val =3D 1; + writel(val, csid->base + CSID_RDI_IRQ_SUBSAMPLE_PATTERN(vc)); + + val =3D 0; + writel(val, csid->base + CSID_RDI_CTRL(vc)); + + val =3D readl(csid->base + CSID_RDI_CFG0(vc)); + if (enable) + val |=3D RDI_CFG0_ENABLE; + else + val &=3D ~RDI_CFG0_ENABLE; + writel(val, csid->base + CSID_RDI_CFG0(vc)); +} + +static void csid_configure_stream(struct csid_device *csid, u8 enable) +{ + int i; + + __csid_configure_top(csid); + + /* Loop through all enabled VCs and configure stream for each */ + for (i =3D 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) { + if (csid->phy.en_vc & BIT(i)) { + __csid_configure_rdi_stream(csid, enable, i); + __csid_configure_rx(csid, &csid->phy, i); + __csid_ctrl_rdi(csid, enable, i); + } + } +} + +/* + * csid_reset - Trigger reset on CSID module and wait to complete + * @csid: CSID device + * + * Return 0 on success or a negative error code otherwise + */ +static int csid_reset(struct csid_device *csid) +{ + unsigned long time; + u32 val; + int i; + + reinit_completion(&csid->reset_complete); + + writel(CSID_IRQ_CMD_CLEAR, csid->base + CSID_IRQ_CMD); + + /* preserve registers */ + val =3D CSID_RESET_CFG_MODE_IMMEDIATE | CSID_RESET_CFG_LOCATION_COMPLETE; + writel(val, csid->base + CSID_RESET_CFG); + + val =3D CSID_RESET_CMD_HW_RESET | CSID_RESET_CMD_SW_RESET; + writel(val, csid->base + CSID_RESET_CMD); + + time =3D wait_for_completion_timeout(&csid->reset_complete, + msecs_to_jiffies(CSID_RESET_TIMEOUT_MS)); + if (!time) { + dev_err(csid->camss->dev, "CSID reset timeout\n"); + return -EIO; + } + + for (i =3D 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) { + /* Enable RUP done for the client port */ + writel(CSID_CSI2_RDIN_RUP_DONE, csid->base + CSID_CSI2_RDIN_IRQ_MASK(i)); + } + + /* Clear RDI status */ + writel(~0u, csid->base + CSID_BUF_DONE_IRQ_CLEAR); + + /* Enable BUF_DONE bit for all write-master client ports */ + writel(~0u, csid->base + CSID_BUF_DONE_IRQ_MASK); + + /* Unmask all TOP interrupts */ + writel(~0u, csid->base + CSID_TOP_IRQ_MASK); + + return 0; +} + +static void csid_rup_complete(struct csid_device *csid, int rdi) +{ + csid_reg_update_clear(csid, rdi); +} + +/* + * csid_isr - CSID module interrupt service routine + * @irq: Interrupt line + * @dev: CSID device + * + * Return IRQ_HANDLED on success + */ +static irqreturn_t csid_isr(int irq, void *dev) +{ + struct csid_device *csid =3D dev; + u32 buf_done_val, val, val_top; + int i; + + /* Latch and clear TOP status */ + val_top =3D readl(csid->base + CSID_TOP_IRQ_STATUS); + writel(val_top, csid->base + CSID_TOP_IRQ_CLEAR); + + /* Latch and clear CSID_CSI2 status */ + val =3D readl(csid->base + CSID_CSI2_RX_IRQ_STATUS); + writel(val, csid->base + CSID_CSI2_RX_IRQ_CLEAR); + + /* Latch and clear top level BUF_DONE status */ + buf_done_val =3D readl(csid->base + CSID_BUF_DONE_IRQ_STATUS); + writel(buf_done_val, csid->base + CSID_BUF_DONE_IRQ_CLEAR); + + /* Process state for each RDI channel */ + for (i =3D 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) { + val =3D readl(csid->base + CSID_CSI2_RDIN_IRQ_STATUS(i)); + if (val) + writel(val, csid->base + CSID_CSI2_RDIN_IRQ_CLEAR(i)); + + if (val & CSID_CSI2_RDIN_RUP_DONE) + csid_rup_complete(csid, i); + + if (buf_done_val & BIT(BUF_DONE_IRQ_STATUS_RDI_OFFSET + i)) + camss_buf_done(csid->camss, csid->id, i); + } + + /* Issue clear command */ + writel(CSID_IRQ_CMD_CLEAR, csid->base + CSID_IRQ_CMD); + + /* Reset complete */ + if (val_top & CSID_TOP_IRQ_RESET) + complete(&csid->reset_complete); + + return IRQ_HANDLED; +} + +static void csid_subdev_reg_update(struct csid_device *csid, int port_id, = bool is_clear) +{ + if (is_clear) + csid_reg_update_clear(csid, port_id); + else + csid_reg_update(csid, port_id); +} + +static void csid_subdev_init(struct csid_device *csid) {} + +const struct csid_hw_ops csid_ops_680 =3D { + .configure_testgen_pattern =3D NULL, + .configure_stream =3D csid_configure_stream, + .hw_version =3D csid_hw_version, + .isr =3D csid_isr, + .reset =3D csid_reset, + .src_pad_code =3D csid_src_pad_code, + .subdev_init =3D csid_subdev_init, + .reg_update =3D csid_subdev_reg_update, +}; diff --git a/drivers/media/platform/qcom/camss/camss-csid.h b/drivers/media= /platform/qcom/camss/camss-csid.h index 90b8fc5852be32d5617e9bc64458f3484d21a6e2..9dc826d8c8f6a9251b5d0fc4f69= 8e0968c57cc6d 100644 --- a/drivers/media/platform/qcom/camss/camss-csid.h +++ b/drivers/media/platform/qcom/camss/camss-csid.h @@ -213,6 +213,7 @@ extern const struct csid_formats csid_formats_gen2; =20 extern const struct csid_hw_ops csid_ops_4_1; extern const struct csid_hw_ops csid_ops_4_7; +extern const struct csid_hw_ops csid_ops_680; extern const struct csid_hw_ops csid_ops_gen2; extern const struct csid_hw_ops csid_ops_780; =20 --=20 2.48.1 From nobody Wed Dec 17 19:08:04 2025 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 7365A1F63F9 for ; Fri, 14 Mar 2025 23:36:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741995366; cv=none; b=Qe3o9HTCSzqtBCMYvjse6p7x4yp6zRhPYY1qwc+r4qLEZTUh2svHMb73xgI/qsyw8MVXQLJpa3b29e6pJN0WRLpsJBIuR6u/sy9sOXJkz9D9ckmq0JXFvP61evjDFjTQH5XCAf59bqaJ/bzs/Jfa5E9kqKUY/lVzzpxy92YEqok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741995366; c=relaxed/simple; bh=od5Z1Svn8BYbFzs98UBOgL0BUpzTDGbd+1gcxYEsBeo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MXHtFVE8ZD2u1mNOjSlbQD4z3ykQg+GCXF+r1iM+LYBcLPLQuj4w7iGdBKvLjFBrFMOHFsvGbf8zlLqLoX/D+ziI3NhCNlfM3STwVnlyHvKx8l9MVUGkAYtjvjFoaz8rz7xv+3pPa3sEFLujD/BXpjSU6aXNtQ85W51AUnrUy5Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=RBevlPbK; arc=none smtp.client-ip=209.85.218.54 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="RBevlPbK" Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-ac2a9a74d9cso538580966b.1 for ; Fri, 14 Mar 2025 16:36:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741995362; x=1742600162; 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=15nxH5caHACIfumG1mxHa3lLrfZBiG2an8ZU5x65FLw=; b=RBevlPbKZKuXxd/13zDWqNLiRjpWIqaAv8Bj/oZjDI0Y6HMRENscNI3i356htz9SMb CAaBsI0aZ63Pe/mC68BV1vv7FGNrKSBoDza+JWVv4y3td/1c7OsfUDDBeCac7hcS7dYB PJNjsX3tsEn2FKrMI3Ve3tSxyZykHPvAdwrg0NtduDbLRFJMyCpI93RkRLAwgb/PE7TN v994fwPo2BjmPPi0yfs/KKey0wFWjM9AQ+nQ/ajVFEmoSShU35+DLBWoDY+ei9zInS9s ibKTHXq+plEU6KpUFdKp7bkO8eXaP3F+mJZqw38VtVhxGyOrjTpg95lBkRweJDtSNzDi py1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741995362; x=1742600162; 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=15nxH5caHACIfumG1mxHa3lLrfZBiG2an8ZU5x65FLw=; b=TO+7W0dQfUjIfj26b2t6Z1Fsy2t2npFxLLz5AX1tPuHiZJSCFUzdkaaohY30gxL/JI 8pD25douqjjynNC+OgaqNPjfPdQRazH2wzXYeI3EE+vi+pj/X+wNk4UNIAPW25MQyjbr zW+a5Gn1Op7oZCcvCuBP0PmSVo6nRJccUpfK1coAMPDrOKz3rxEAdaszytoj43KjlWka C8Hc1vJH7A4svl+ZIrKR3DBJZRhMMo1yxDnI7W6XDk3SszrauJG8nQrxOY12oSi5MniM ixg603izNnYBwDmkwOx80EKyHck+bvHhnQ9gtZcaNkGvQ+SykXvUqF/0Ch49vN1yRLnC avYQ== X-Forwarded-Encrypted: i=1; AJvYcCXZ5TNFP8yNZ3Wrf3V/sjCo4gdQt2e8lbYpIiB1MZTg5O4XBeZxi2+NJpJycw3lveCNYlHjFVDmq7zZUoM=@vger.kernel.org X-Gm-Message-State: AOJu0Yy4to+J4KAuO4/ojVudUO6qi9jv1qqG8vjVZ6n4Vfr7Hu2d+gD3 RApJHwEsSXYrlvL4BKakN0gsrDOxuPGDX8U0ET7Pbz1rafidBQgfbRURj2ziBXfYHBqWvBw1py5 Jz629uA== X-Gm-Gg: ASbGncuuEaVNqcyu3Fj3AyFonXHGTKIrn+hfF4vjUiaWj6ePoPvaDzVhzZbcidSGFjS VMfX/Wo+lTILzJlidxTnwFXvdByshpUngsTFycC9ATRVMF/3a80SdUN7betZbWxekNt3w6F+68O Z+zmwfCeyal/+iOfQ4CenIPGNrDQq9cqocoSgP+W9zkPKctXyZHvsAcKau8ZIgO28S5oHwvslx0 +Vb+seRS4mDfcSK1wfkDIS5/SKy12Uw1CbalVgiw8ZkFbCPqJ1oLn7oSJQmLsuUjfreoWFuPmp8 GnYJ4xaY0bOqx10snEB6BNmrRh1Q74AWsmGtvgnXrJjmMWVczr4I3YFOUexQLM17q8kcL/vlDwd txIQa0EbO29h194UdWBA0L6X0a4Syw4qsNTwwM3uLr7VDTvBhQxjJSWtWdZ9jxhDZuiPj X-Google-Smtp-Source: AGHT+IFZuYsHDqscjjw6U5atHRu/Jm5bPjG92uZ8YJc6NiscNKCBw+NDetW5to9ATMl0/VCBNhOBTQ== X-Received: by 2002:a17:907:97d3:b0:ac3:271e:6b1d with SMTP id a640c23a62f3a-ac3303dfca8mr575059966b.51.1741995362431; Fri, 14 Mar 2025 16:36:02 -0700 (PDT) Received: from [192.168.178.107] (2001-1c06-2302-5600-7555-cca3-bbc4-648b.cable.dynamic.v6.ziggo.nl. [2001:1c06:2302:5600:7555:cca3:bbc4:648b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3146aeadbsm284246966b.29.2025.03.14.16.36.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 16:36:01 -0700 (PDT) From: Bryan O'Donoghue Date: Fri, 14 Mar 2025 23:35:57 +0000 Subject: [PATCH v2 4/7] media: qcom: camss: Add VFE680 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: quoted-printable Message-Id: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-4-d163d66fcc0d@linaro.org> References: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-0-d163d66fcc0d@linaro.org> In-Reply-To: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-0-d163d66fcc0d@linaro.org> To: Robert Foss , Todor Tomov , 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.14.2 Add silicon enabling support for VFE680 as found on sm8450, x1e and derivatives thereof. References work from Vladimir Zapolskiy Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/camss/Makefile | 1 + drivers/media/platform/qcom/camss/camss-vfe-680.c | 244 ++++++++++++++++++= ++++ drivers/media/platform/qcom/camss/camss-vfe.h | 1 + 3 files changed, 246 insertions(+) diff --git a/drivers/media/platform/qcom/camss/Makefile b/drivers/media/pla= tform/qcom/camss/Makefile index 71797745f2f712929f76f6b97f75457bc59e35ab..d26a9c24a430a831e0d865db4d9= 6142da5276653 100644 --- a/drivers/media/platform/qcom/camss/Makefile +++ b/drivers/media/platform/qcom/camss/Makefile @@ -18,6 +18,7 @@ qcom-camss-objs +=3D \ camss-vfe-4-8.o \ camss-vfe-17x.o \ camss-vfe-480.o \ + camss-vfe-680.o \ camss-vfe-780.o \ camss-vfe-gen1.o \ camss-vfe.o \ diff --git a/drivers/media/platform/qcom/camss/camss-vfe-680.c b/drivers/me= dia/platform/qcom/camss/camss-vfe-680.c new file mode 100644 index 0000000000000000000000000000000000000000..8da7a3566076c7ab2024c828f3a= a25f1c30edb5c --- /dev/null +++ b/drivers/media/platform/qcom/camss/camss-vfe-680.c @@ -0,0 +1,244 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * camss-vfe-680.c + * + * Qualcomm MSM Camera Subsystem - VFE (Video Front End) Module v680 + * + * Copyright (C) 2025 Linaro Ltd. + */ + +#include +#include +#include +#include + +#include "camss.h" +#include "camss-vfe.h" + +#define VFE_TOP_IRQn_STATUS(vfe, n) ((vfe_is_lite(vfe) ? 0x1c : 0x44) + (= n) * 4) +#define VFE_TOP_IRQn_MASK(vfe, n) ((vfe_is_lite(vfe) ? 0x24 : 0x34) + (n)= * 4) +#define VFE_TOP_IRQn_CLEAR(vfe, n) ((vfe_is_lite(vfe) ? 0x2c : 0x3c) + (n= ) * 4) +#define VFE_IRQ1_SOF(vfe, rdi) ((vfe_is_lite(vfe) ? BIT(2) : BIT(8)) << = ((rdi) * 2)) +#define VFE_IRQ1_EOF(vfe, rdi) ((vfe_is_lite(vfe) ? BIT(3) : BIT(9)) << = ((rdi) * 2)) +#define VFE_TOP_IRQ_CMD(vfe) (vfe_is_lite(vfe) ? 0x38 : 0x30) +#define VFE_TOP_IRQ_CMD_GLOBAL_CLEAR BIT(0) +#define VFE_TOP_DIAG_CONFIG (vfe_is_lite(vfe) ? 0x40 : 0x50) + +#define VFE_TOP_DEBUG_11(vfe) (vfe_is_lite(vfe) ? 0x40 : 0xcc) +#define VFE_TOP_DEBUG_12(vfe) (vfe_is_lite(vfe) ? 0x40 : 0xd0) +#define VFE_TOP_DEBUG_13(vfe) (vfe_is_lite(vfe) ? 0x40 : 0xd4) + +#define VFE_BUS_IRQn_MASK(vfe, n) ((vfe_is_lite(vfe) ? 0x218 : 0xc18) + (= n) * 4) +#define VFE_BUS_IRQn_CLEAR(vfe, n) ((vfe_is_lite(vfe) ? 0x220 : 0xc20) + = (n) * 4) +#define VFE_BUS_IRQn_STATUS(vfe, n) ((vfe_is_lite(vfe) ? 0x228 : 0xc28) += (n) * 4) +#define VFE_BUS_IRQ_GLOBAL_CLEAR(vfe) (vfe_is_lite(vfe) ? 0x230 : 0xc30) +#define VFE_BUS_WR_VIOLATION_STATUS(vfe) (vfe_is_lite(vfe) ? 0x264 : 0xc64) +#define VFE_BUS_WR_OVERFLOW_STATUS(vfe) (vfe_is_lite(vfe) ? 0x268 : 0xc68) +#define VFE_BUS_WR_IMAGE_VIOLATION_STATUS(vfe) (vfe_is_lite(vfe) ? 0x270 := 0xc70) + +#define VFE_BUS_WRITE_CLIENT_CFG(vfe, c) ((vfe_is_lite(vfe) ? 0x400 : 0xe0= 0) + (c) * 0x100) +#define VFE_BUS_WRITE_CLIENT_CFG_EN BIT(0) +#define VFE_BUS_IMAGE_ADDR(vfe, c) ((vfe_is_lite(vfe) ? 0x404 : 0xe04) + = (c) * 0x100) +#define VFE_BUS_FRAME_INCR(vfe, c) ((vfe_is_lite(vfe) ? 0x408 : 0xe08) + = (c) * 0x100) +#define VFE_BUS_IMAGE_CFG0(vfe, c) ((vfe_is_lite(vfe) ? 0x40c : 0xe0c) + = (c) * 0x100) +#define VFE_BUS_IMAGE_CFG0_DATA(h, s) (((h) << 16) | ((s) >> 4)) +#define WM_IMAGE_CFG_0_DEFAULT_WIDTH (0xFFFF) + +#define VFE_BUS_IMAGE_CFG1(vfe, c) ((vfe_is_lite(vfe) ? 0x410 : 0xe10) + = (c) * 0x100) +#define VFE_BUS_IMAGE_CFG2(vfe, c) ((vfe_is_lite(vfe) ? 0x414 : 0xe14) + = (c) * 0x100) +#define VFE_BUS_PACKER_CFG(vfe, c) ((vfe_is_lite(vfe) ? 0x418 : 0xe18) + = (c) * 0x100) +#define VFE_BUS_IRQ_SUBSAMPLE_PERIOD(vfe, c) ((vfe_is_lite(vfe) ? 0x430 : = 0xe30) + (c) * 0x100) +#define VFE_BUS_IRQ_SUBSAMPLE_PATTERN(vfe, c) ((vfe_is_lite(vfe) ? 0x434 := 0xe34) + (c) * 0x100) +#define VFE_BUS_FRAMEDROP_PERIOD(vfe, c) ((vfe_is_lite(vfe) ? 0x438 : 0xe3= 8) + (c) * 0x100) +#define VFE_BUS_FRAMEDROP_PATTERN(vfe, c) ((vfe_is_lite(vfe) ? 0x43c : 0xe= 3c) + (c) * 0x100) +#define VFE_BUS_MMU_PREFETCH_CFG(vfe, c) ((vfe_is_lite(vfe) ? 0x460 : 0xe6= 0) + (c) * 0x100) +#define VFE_BUS_MMU_PREFETCH_CFG_EN BIT(0) +#define VFE_BUS_MMU_PREFETCH_MAX_OFFSET(vfe, c) ((vfe_is_lite(vfe) ? 0x464= : 0xe64) + (c) * 0x100) +#define VFE_BUS_ADDR_STATUS0(vfe, c) ((vfe_is_lite(vfe) ? 0x470 : 0xe70) = + (c) * 0x100) + +/* + * TODO: differentiate the port id based on requested type of RDI, BHIST e= tc + * + * IFE write master IDs + * + * VIDEO_FULL_Y 0 + * VIDEO_FULL_C 1 + * VIDEO_DS_4:1 2 + * VIDEO_DS_16:1 3 + * DISPLAY_FULL_Y 4 + * DISPLAY_FULL_C 5 + * DISPLAY_DS_4:1 6 + * DISPLAY_DS_16:1 7 + * FD_Y 8 + * FD_C 9 + * PIXEL_RAW 10 + * STATS_BE0 11 + * STATS_BHIST0 12 + * STATS_TINTLESS_BG 13 + * STATS_AWB_BG 14 + * STATS_AWB_BFW 15 + * STATS_BAF 16 + * STATS_BHIST 17 + * STATS_RS 18 + * STATS_IHIST 19 + * SPARSE_PD 20 + * PDAF_V2.0_PD_DATA 21 + * PDAF_V2.0_SAD 22 + * LCR 23 + * RDI0 24 + * RDI1 25 + * RDI2 26 + * LTM_STATS 27 + * + * IFE Lite write master IDs + * + * RDI0 0 + * RDI1 1 + * RDI2 2 + * RDI3 3 + * GAMMA 4 + * BE 5 + */ + +/* TODO: assign an ENUM in resources and use the provided master + * id directly for RDI, STATS, AWB_BG, BHIST. + * This macro only works because RDI is all we support right now. + */ +#define RDI_WM(n) ((vfe_is_lite(vfe) ? 0 : 24) + (n)) + +static void vfe_global_reset(struct vfe_device *vfe) +{ + /* VFE680 has no global reset, simply report a completion */ + complete(&vfe->reset_complete); +} + +/* + * vfe_isr - VFE module interrupt handler + * @irq: Interrupt line + * @dev: VFE device + * + * Return IRQ_HANDLED on success + */ +static irqreturn_t vfe_isr(int irq, void *dev) +{ + return IRQ_HANDLED; +} + +/* + * vfe_halt - Trigger halt on VFE module and wait to complete + * @vfe: VFE device + * + * Return 0 on success or a negative error code otherwise + */ +static int vfe_halt(struct vfe_device *vfe) +{ + /* rely on vfe_disable_output() to stop the VFE */ + return 0; +} + +static void vfe_disable_irq(struct vfe_device *vfe) +{ + writel(0u, vfe->base + VFE_TOP_IRQn_MASK(vfe, 0)); + writel(0u, vfe->base + VFE_TOP_IRQn_MASK(vfe, 1)); + writel(0u, vfe->base + VFE_BUS_IRQn_MASK(vfe, 0)); + writel(0u, vfe->base + VFE_BUS_IRQn_MASK(vfe, 1)); +} + +static void vfe_wm_update(struct vfe_device *vfe, u8 rdi, u32 addr, + struct vfe_line *line) +{ + u8 wm =3D RDI_WM(rdi); + + writel(addr, vfe->base + VFE_BUS_IMAGE_ADDR(vfe, wm)); +} + +static void vfe_wm_start(struct vfe_device *vfe, u8 rdi, struct vfe_line *= line) +{ + struct v4l2_pix_format_mplane *pix =3D + &line->video_out.active_fmt.fmt.pix_mp; + u32 stride =3D pix->plane_fmt[0].bytesperline; + u32 cfg; + u8 wm; + + cfg =3D VFE_BUS_IMAGE_CFG0_DATA(pix->height, stride); + wm =3D RDI_WM(rdi); + + writel(cfg, vfe->base + VFE_BUS_IMAGE_CFG0(vfe, wm)); + writel(0, vfe->base + VFE_BUS_IMAGE_CFG1(vfe, wm)); + writel(stride, vfe->base + VFE_BUS_IMAGE_CFG2(vfe, wm)); + writel(0, vfe->base + VFE_BUS_PACKER_CFG(vfe, wm)); + + /* Set total frame increment value */ + writel(pix->plane_fmt[0].bytesperline * pix->height, + vfe->base + VFE_BUS_FRAME_INCR(vfe, wm)); + + /* MMU */ + writel(VFE_BUS_MMU_PREFETCH_CFG_EN, vfe->base + VFE_BUS_MMU_PREFETCH_CFG(= vfe, wm)); + writel(~0u, vfe->base + VFE_BUS_MMU_PREFETCH_MAX_OFFSET(vfe, wm)); + + /* no dropped frames, one irq per frame */ + writel(1, vfe->base + VFE_BUS_FRAMEDROP_PATTERN(vfe, wm)); + writel(0, vfe->base + VFE_BUS_FRAMEDROP_PERIOD(vfe, wm)); + writel(1, vfe->base + VFE_BUS_IRQ_SUBSAMPLE_PATTERN(vfe, wm)); + writel(0, vfe->base + VFE_BUS_IRQ_SUBSAMPLE_PERIOD(vfe, wm)); + + /* We don't process IRQs for VFE in RDI mode at the moment */ + vfe_disable_irq(vfe); + + /* Enable WM */ + writel(VFE_BUS_WRITE_CLIENT_CFG_EN, + vfe->base + VFE_BUS_WRITE_CLIENT_CFG(vfe, wm)); + + dev_dbg(vfe->camss->dev, "RDI%d WM:%d width %d height %d stride %d\n", + rdi, wm, pix->width, pix->height, stride); +} + +static void vfe_wm_stop(struct vfe_device *vfe, u8 rdi) +{ + u8 wm =3D RDI_WM(rdi); + + writel(0, vfe->base + VFE_BUS_WRITE_CLIENT_CFG(vfe, wm)); +} + +static const struct camss_video_ops vfe_video_ops_680 =3D { + .queue_buffer =3D vfe_queue_buffer_v2, + .flush_buffers =3D vfe_flush_buffers, +}; + +static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe) +{ + vfe->video_ops =3D vfe_video_ops_680; +} + +static void vfe_reg_update(struct vfe_device *vfe, enum vfe_line_id line_i= d) +{ + int port_id =3D line_id; + + camss_reg_update(vfe->camss, vfe->id, port_id, false); +} + +static inline void vfe_reg_update_clear(struct vfe_device *vfe, + enum vfe_line_id line_id) +{ + int port_id =3D line_id; + + camss_reg_update(vfe->camss, vfe->id, port_id, true); +} + +const struct vfe_hw_ops vfe_ops_680 =3D { + .global_reset =3D vfe_global_reset, + .hw_version =3D vfe_hw_version, + .isr =3D vfe_isr, + .pm_domain_off =3D vfe_pm_domain_off, + .pm_domain_on =3D vfe_pm_domain_on, + .subdev_init =3D vfe_subdev_init, + .vfe_disable =3D vfe_disable, + .vfe_enable =3D vfe_enable_v2, + .vfe_halt =3D vfe_halt, + .vfe_wm_start =3D vfe_wm_start, + .vfe_wm_stop =3D vfe_wm_stop, + .vfe_buf_done =3D vfe_buf_done, + .vfe_wm_update =3D vfe_wm_update, + .reg_update =3D vfe_reg_update, + .reg_update_clear =3D vfe_reg_update_clear, +}; diff --git a/drivers/media/platform/qcom/camss/camss-vfe.h b/drivers/media/= platform/qcom/camss/camss-vfe.h index 9dec5bc0d1b146fdf6b1ecd47f26b41cfc9e324f..a23f666be7531e0366c73faea44= ed245e7a8e30f 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.h +++ b/drivers/media/platform/qcom/camss/camss-vfe.h @@ -243,6 +243,7 @@ extern const struct vfe_hw_ops vfe_ops_4_7; extern const struct vfe_hw_ops vfe_ops_4_8; extern const struct vfe_hw_ops vfe_ops_170; extern const struct vfe_hw_ops vfe_ops_480; +extern const struct vfe_hw_ops vfe_ops_680; extern const struct vfe_hw_ops vfe_ops_780; =20 int vfe_get(struct vfe_device *vfe); --=20 2.48.1 From nobody Wed Dec 17 19:08:04 2025 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (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 C95711F78F2 for ; Fri, 14 Mar 2025 23:36:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741995367; cv=none; b=KzxkGDQIBjLdw036tu/QO84jbK6UUo9oDB9Cqd6mOQ7PrjMpiv91knimChf4d9XlICMLSdQLSGzMC7NHnLzXextgw7AXs2D8502Pm17A4LE2vyNUSTKFikYUGK6PiBBkUZde271UMOK26OAGFVDpeXKmvF5dxBQfD5/RrCPO27A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741995367; c=relaxed/simple; bh=XO8C73umzqB3ITQwScvoKWMaYVNcoaJRWUZeDGM5cGA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CZvsu7MhGcNjFZM3B/dxMl9rgUb3GjLQZxixbjTOLqL9CDM1LlUbrmZTQT8QVMgJ36mFGgmmRR2ksQQTo4MuLcDese2kAxd5N0PuVjY3iTlLw+p6TKpFjUWkkozpmjnr1hDFsBmbPRVHWl/iYQLFId/N3UZrozfuaAU0VR1ImPs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=DDcmBHhS; arc=none smtp.client-ip=209.85.218.44 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DDcmBHhS" Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-aaee2c5ee6eso387181466b.1 for ; Fri, 14 Mar 2025 16:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741995364; x=1742600164; 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=keDpOrls9Sn/S+3SLtEEautMsDMOcPKZDVim3GD6wto=; b=DDcmBHhSVOsZrbN8iKOndyGIn3Rr/t57Aj6YdDVNjv4/K5Bf4qLG2LrT8V+ey4cO24 izAthAgj5Mz2Ke4OaY1RvRO0TJ+xJjFohso8HQybJY4Vq6sWoDxrz/AepfcycfYi8jGw tijyDv2gc8Ywmy2fVHSVRxzkXFyz4OtE47zFlpKERTtAOqDs+3cXuq0mpebT7OjAkfqr HF8fAVqEuXm4fWVYsQo/CMWrsYB4DRJa8PapEbuvvcUg5ad/3wJ4h8Hqi053QcrLQK92 xq73EmBzEJxSNQMaCqHnjYwPwivNrk/PFPkmxCc2Kur5bD0Vhj2Da+wA27XVIUJLlcjQ ovkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741995364; x=1742600164; 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=keDpOrls9Sn/S+3SLtEEautMsDMOcPKZDVim3GD6wto=; b=TSMIdf9lGX47xauWoVldRcJEQIXHV6FWNBVIRHNto335RuTRZZtysZR7eIg9lJpOFd z7mW/sp8o61ZLzRuchjgNenqPjnJeKdRXWyg4a4kIlfY23dB/w6rIzYc3xcojdl9JyZV McrZX5wb+RlLlqsJnnoN7YrjatDwCfEDAA1KGxaCDWCBQR85pWD8C4G3KIYJjB345ru7 rKeyNL6hlCaGlPsoTGrbMAbTb6qHeYOQxSfQvQ1zTJMf1+zb5US+j6IWVXrws0qpdL98 T1YzD/JLwjzFso34yFt+RLMq7VCZXYRSzn15aZEjhQWHO7xCZ9udTqatXzQlwxsFGYdQ 7Ogg== X-Forwarded-Encrypted: i=1; AJvYcCW+1zIecRvVT98Lhu8lw+0Uztne3ROaxRyCLpBur+EjmK4kyKTt1G3IeRIhR5vM8iLu0K2L4Up+GFEfzUU=@vger.kernel.org X-Gm-Message-State: AOJu0YzfUSBC3i99W4xcnNvSYYW9F4N/fvuX0eG9LK3hnnwvNUtA6k9F 5R7EqMxpY3PsLJMdEm6w8W6JmpzGb+ZpGAwqzG6tutHO9rIiH2CXSqC2xY/6lj6oJAH5GcJfBHW NrwqhwQ== X-Gm-Gg: ASbGncswtLZUxRksN7DEMLP2BZkGu3YC8Tm5YeLvqbD2ZFzssNbA2QOKnW60To4p/YK 0MGPPdqpeFWOPKawxBM/ZKnVxBchI2gB6BSO7TM1btKGaXeHPUGL+z+QnDfE3kaOVn94X9njEjO k6xhzTv7dlpxOAFYpU2Eg3jsMpe5uuzZWHZs5GtX8mKjBj7qEEQGOIvQzTXSQCp4p/ywcsfbVMH L6tvloCjcdLC4ibI8uUBb7YzhnXffUvDLLqNNQqskNyZaFq+Zruosywme2zQsYGw/agGZUTfGxP xAoaDhCx+YzwAhgb0bS42h4getFOs9Pmnmu8Nbg3l/d9NyRGUDPgQHcWfRmu7aNnXkv8Y3Mrv6Y 03gql9+ud/+qfKLKgBH2+gZnlm2rrlmNRGppXtS8Zmt0t/oVdNjZCASYRgnzT1VpFTGzV X-Google-Smtp-Source: AGHT+IFAGvopC9aLmriQ1WG4E3B60V6ITUuBD1z/8RVghyGuUFJrHiuxKd9xoYGYLzs30GOUXV5ZOg== X-Received: by 2002:a17:907:6ea9:b0:ac2:912d:5a80 with SMTP id a640c23a62f3a-ac3301dfbf9mr540041266b.5.1741995363804; Fri, 14 Mar 2025 16:36:03 -0700 (PDT) Received: from [192.168.178.107] (2001-1c06-2302-5600-7555-cca3-bbc4-648b.cable.dynamic.v6.ziggo.nl. [2001:1c06:2302:5600:7555:cca3:bbc4:648b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3146aeadbsm284246966b.29.2025.03.14.16.36.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 16:36:03 -0700 (PDT) From: Bryan O'Donoghue Date: Fri, 14 Mar 2025 23:35:58 +0000 Subject: [PATCH v2 5/7] media: qcom: camss: Add support for 3ph CSIPHY write settle delay 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: quoted-printable Message-Id: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-5-d163d66fcc0d@linaro.org> References: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-0-d163d66fcc0d@linaro.org> In-Reply-To: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-0-d163d66fcc0d@linaro.org> To: Robert Foss , Todor Tomov , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bryan O'Donoghue , Vladimir Zapolskiy X-Mailer: b4 0.14.2 Currently we have an s32 value called delay which has been inherited from the CamX code for PHY init. This unused value relates to a post-write delay latching time. In the silicon test-bench which provides the basis for the CamX code the write settle times are specified in nanoseconds. In the upstream kernel we currently take no notice of the delay value and use all zero in any case. Nanosecond granularity timing from the perspective of the kernel is total overkill, however for some PHY init sequences introduction of a settle delay has a use. Add support to the 3ph init sequence for microsecond level delay. A readback of written data would probably accomplish the same thing but, since the PHY init sequences in the wild provide a delay value - we can just add support here for that delay and consume the values given. Generally these delays are probably not necessary but, they do speak to a theoretical delay that silicon test-benches utilise and therefore are worthwhile to replicate if the given PHY init sequence has the data. Reviewed-by: Vladimir Zapolskiy Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/dri= vers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c index a6cc957b986e16add9da516c2fcb3201f3a65f35..b44939686e4bbf400f145368d3b= a015b56bfb187 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 @@ -59,7 +59,7 @@ struct csiphy_lane_regs { s32 reg_addr; s32 reg_data; - s32 delay; + u32 delay_us; u32 csiphy_param_type; }; =20 @@ -600,6 +600,8 @@ static void csiphy_gen2_config_lanes(struct csiphy_devi= ce *csiphy, break; } writel_relaxed(val, csiphy->base + r->reg_addr); + if (r->delay_us) + udelay(r->delay_us); } } =20 --=20 2.48.1 From nobody Wed Dec 17 19:08:04 2025 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 7CA3C1F8697 for ; Fri, 14 Mar 2025 23:36:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741995368; cv=none; b=r2gKF535qPnuPt6+mqW5AuEjYuPVjaIQmLFp8WfuZNhh+EiEOc6/CrWiwe3AA8hU3vDMx6Dk8qXIcbHSOxIVZ/IHxeaGHZHTMXJ0dtaxSbljKhjmek79XXrsV1LDQiatojlz1g6aq1bsgZBP2DJUx6pVXRQ6klDGK6FAuYu2aGI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741995368; c=relaxed/simple; bh=Vq2uKzeOhWg9BzD0uczH19oCawxDFmiCSfyNb/VvQDY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oDvlo/ZQrqxAvzGLTK5gYf08N5ZjlV+XIVXyFvXjwKi/qo4btMpjCaWdjZukhjRTm50HcfFiODMidTTniHSA3qVIKKNC/D5LWIvs+FMfL+hN2u3yRy2WrHhCA9tSjc7p5ccLY19NEhVSLbdmOrScm/xsHGi+z/qhhVE+dVvnHwo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Bkz3YxiS; arc=none smtp.client-ip=209.85.218.50 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Bkz3YxiS" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-ac339f53df9so182641866b.1 for ; Fri, 14 Mar 2025 16:36:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741995364; x=1742600164; 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=3U+Pt6JpsUTUHyzjN19Q+jXJPU51fOtm+jzvoDFAjpA=; b=Bkz3YxiSsGOA4zxSZLudvhAY6Hnx9WMP+rqX8GZL3bauWr3CCEeI94t5AQ4szfczzz 4X3ALE8vP0HLZo1lWz5iqFZItccKMGqdj4x1zmrcwK2CahwDKluMWfS8TMbBwQsi/jTp PY1WElsM5p76WfE4oub9dNFJhOa3NL5fhJCIIn13KOfV352nNKoVKbWq8wJ2i1l2La0N EssyjxLdZFZAJWcQ+YUT7POon5MZ25TEh6JIMXJBbuUnQ3zY502Cs8g++t94lCduSsUk ayKw5OTD2X0+Wr/frW0/Ha83fdl18g45oLd8GuiKT8fV0yUK2QDecaJHEy8lxWnLHx+8 TZvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741995364; x=1742600164; 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=3U+Pt6JpsUTUHyzjN19Q+jXJPU51fOtm+jzvoDFAjpA=; b=q/r6X3yn6ExsUHXF/K7oUDRtVlAtVU9zIl3pGSC+ygYyYaKOTwFZ2/rDvNOKDpKeBe S+7WXO8fr0kNgWWvvVZk6wplpIIYl5VLRdCN2uefRDAfdMdKRXYkSqKIF1lCtP4E8SBf XzqY5jOSaLXLy5ekcimv1efwIzUrPeoQ8Pmo5cleAI7hznYpdx7GY531SstYPnipLSkL bIHlcOa7sSknN7J5mmt65WTlnj+qzKErizAfQguK3jQvNpNJhxpELOKjHkpqHBwpC15/ Ty1EBa1DCWjb5+szoCnga+MrVbfkSbhkL2jcOlUezHI7JkKfEUlq3WKTEoc8NuyQz5nd otjQ== X-Forwarded-Encrypted: i=1; AJvYcCW7tMvINbnvWaM2lYU2E5fdj5MKhOWe968MOS/NIKuP6B2H/vit7CkZrOs4dcw9HE6uPwhJX6D64qCNc7I=@vger.kernel.org X-Gm-Message-State: AOJu0Yxwfq/0LNgeFE3MYQKjmptMjg7/SKPMYOocqux4jEzuI8/WW51s luXK0aJfKHhPmZJawDn6RpvEN3nfFk8V4GwLjQcr+WakKCurEiryuqCRCGOlzAOn8zEkerW4uQ6 DmkMztg== X-Gm-Gg: ASbGncve7eJaNJ595yVL79A1/IkeK2ud7R1cPnUR/mYcaEwTHSclgCaIody4er/RGop A/Otku0QEcMz5qyDeW0TBlZ05vCd972GKRLWL/VzEY+yJMEwR4gCsN3/7dD9S9BViS3FHTxobrq OuSVTExZlCe/2FkglDGvP4oz3CWWMGL4EfC/iRz3/0CoQwy+RjuUytwLnachqnRtj/+WJFbBzDw EmBIQJsIN/qXO42SZu90VVeBDy+OeuO9YoijwCF7mP7Qly9JWxvWiNvXe/Jjt8moPqqGdNGW4Ri AG22YsWHvgb6IAo9QbfLx/fiQvVM5xc7bGXQzXEkfNJCx9i2YQvyh39r4S6iFROez7hTXxJtlL6 YQlBeQnEo2Xf/PAhE5OF5mtVNUw2J/kR1wl68t00YEg/20jTCR1xKCCrSy9WorPtRU4Gx X-Google-Smtp-Source: AGHT+IFhQMOFUycyNl9NAwVjWQ8rMePZypskVYVYNfryZOS2CgGWpOB2ap4X37XJjZsLcNHBbTgMLA== X-Received: by 2002:a17:906:c10d:b0:ac2:7cf9:7193 with SMTP id a640c23a62f3a-ac3304195a3mr509150366b.48.1741995364518; Fri, 14 Mar 2025 16:36:04 -0700 (PDT) Received: from [192.168.178.107] (2001-1c06-2302-5600-7555-cca3-bbc4-648b.cable.dynamic.v6.ziggo.nl. [2001:1c06:2302:5600:7555:cca3:bbc4:648b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3146aeadbsm284246966b.29.2025.03.14.16.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 16:36:04 -0700 (PDT) From: Bryan O'Donoghue Date: Fri, 14 Mar 2025 23:35:59 +0000 Subject: [PATCH v2 6/7] media: qcom: camss: csiphy-3ph: Add 4nm CSIPHY 2ph 5Gbps DPHY v2.1.2 init sequence 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: quoted-printable Message-Id: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-6-d163d66fcc0d@linaro.org> References: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-0-d163d66fcc0d@linaro.org> In-Reply-To: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-0-d163d66fcc0d@linaro.org> To: Robert Foss , Todor Tomov , 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.14.2 For various SoC skews at 4nm CSIPHY 2.1.2 is used. Add in the init sequence with base control reg offset of 0x1000. This initial version will support X1E80100. Take the silicon verification PHY init parameters as a first/best guess pass. SKEW_CAL is included as received from the qcom silicon init sequence. Signed-off-by: Bryan O'Donoghue --- .../platform/qcom/camss/camss-csiphy-3ph-1-0.c | 121 +++++++++++++++++= ++++ 1 file changed, 121 insertions(+) diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/dri= vers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c index b44939686e4bbf400f145368d3ba015b56bfb187..d5f717f6215c45908c4fc5a8650= d68c00d544db7 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 @@ -55,6 +55,7 @@ #define CSIPHY_DNP_PARAMS 4 #define CSIPHY_2PH_REGS 5 #define CSIPHY_3PH_REGS 6 +#define CSIPHY_SKEW_CAL 7 =20 struct csiphy_lane_regs { s32 reg_addr; @@ -423,6 +424,123 @@ csiphy_lane_regs lane_regs_sm8550[] =3D { {0x0C64, 0x7F, 0x00, CSIPHY_DEFAULT_PARAMS}, }; =20 +/* 4nm 2PH v 2.1.2 2p5Gbps 4 lane DPHY mode */ +static const struct +csiphy_lane_regs lane_regs_x1e80100[] =3D { + /* Power up lanes 2ph mode */ + {0x1014, 0xD5, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x101C, 0x7A, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x1018, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + + {0x0094, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x00A0, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0090, 0x0f, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0098, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0094, 0x07, 0x01, CSIPHY_DEFAULT_PARAMS}, + {0x0030, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0000, 0x8E, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0038, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x002C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0034, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x001C, 0x0A, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0014, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x003C, 0xB8, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0004, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0020, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0008, 0x10, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE}, + {0x0010, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0094, 0xD7, 0x00, CSIPHY_SKEW_CAL}, + {0x005C, 0x00, 0x00, CSIPHY_SKEW_CAL}, + {0x0060, 0xBD, 0x00, CSIPHY_SKEW_CAL}, + {0x0064, 0x7F, 0x00, CSIPHY_SKEW_CAL}, + + {0x0E94, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0EA0, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0E90, 0x0f, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0E98, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0E94, 0x07, 0x01, CSIPHY_DEFAULT_PARAMS}, + {0x0E30, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0E28, 0x04, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0E00, 0x80, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0E0C, 0xFF, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0E38, 0x1F, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0E2C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0E34, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0E1C, 0x0A, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0E14, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0E3C, 0xB8, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0E04, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0E20, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0E08, 0x10, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE}, + {0x0E10, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS}, + + {0x0494, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x04A0, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0490, 0x0f, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0498, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0494, 0x07, 0x01, CSIPHY_DEFAULT_PARAMS}, + {0x0430, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0400, 0x8E, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0438, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x042C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0434, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x041C, 0x0A, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0414, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x043C, 0xB8, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0404, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0420, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0408, 0x10, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE}, + {0x0410, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0494, 0xD7, 0x00, CSIPHY_SKEW_CAL}, + {0x045C, 0x00, 0x00, CSIPHY_SKEW_CAL}, + {0x0460, 0xBD, 0x00, CSIPHY_SKEW_CAL}, + {0x0464, 0x7F, 0x00, CSIPHY_SKEW_CAL}, + + {0x0894, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x08A0, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0890, 0x0f, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0898, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0894, 0x07, 0x01, CSIPHY_DEFAULT_PARAMS}, + {0x0830, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0800, 0x8E, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0838, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x082C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0834, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x081C, 0x0A, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0814, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x083C, 0xB8, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0804, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0820, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0808, 0x10, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE}, + {0x0810, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0894, 0xD7, 0x00, CSIPHY_SKEW_CAL}, + {0x085C, 0x00, 0x00, CSIPHY_SKEW_CAL}, + {0x0860, 0xBD, 0x00, CSIPHY_SKEW_CAL}, + {0x0864, 0x7F, 0x00, CSIPHY_SKEW_CAL}, + + {0x0C94, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0CA0, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0C90, 0x0f, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0C98, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0C94, 0x07, 0x01, CSIPHY_DEFAULT_PARAMS}, + {0x0C30, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0C00, 0x8E, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0C38, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0C2C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0C34, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0C1C, 0x0A, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0C14, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0C3C, 0xB8, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0C04, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0C20, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0C08, 0x10, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE}, + {0x0C10, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0C94, 0xD7, 0x00, CSIPHY_SKEW_CAL}, + {0x0C5C, 0x00, 0x00, CSIPHY_SKEW_CAL}, + {0x0C60, 0xBD, 0x00, CSIPHY_SKEW_CAL}, + {0x0C64, 0x7F, 0x00, CSIPHY_SKEW_CAL}, +}; + static void csiphy_hw_version_read(struct csiphy_device *csiphy, struct device *dev) { @@ -593,6 +711,9 @@ static void csiphy_gen2_config_lanes(struct csiphy_devi= ce *csiphy, case CSIPHY_SETTLE_CNT_LOWER_BYTE: val =3D settle_cnt & 0xff; break; + case CSIPHY_SKEW_CAL: + /* TODO: support application of skew from dt flag */ + continue; case CSIPHY_DNP_PARAMS: continue; default: --=20 2.48.1 From nobody Wed Dec 17 19:08:04 2025 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 384521F9413 for ; Fri, 14 Mar 2025 23:36:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741995370; cv=none; b=aMZ0rMInJXCi0i7X74Nbgbg9upIPWVniEcQEf2i1RXej5ujXesIdXhowX33DM5u9U/MW7Sjmnecka3e7U+4P47IlL87fxqMQxrw9CSMD7uL8xEriMyoFRsnrVOxgbvqH4jEUs9CVpV+FF3qZxp1H71qGPi6AHA15urpDHU5B9tY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741995370; c=relaxed/simple; bh=yjrH4jBh4ajz1wdyB7Gtn6YC10udzCJcBXOAi0gTSb8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oaX6rmUdtuH/6xw1QsEbu7B5YjG1PR2IHfM6Nm0T0tpd15tLEf17r7QpAhUnu1ve59R3+oePtUeC0+ZjR3f8v3CNXxF3SPWmMyspi3Vx5qn2SaGBevPAYBurcGoLt6djh0gfoW+hLCpG0f79x5+WJ5Ut9INLZGc+xArCux8Bv1c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=k1K8eDAN; arc=none smtp.client-ip=209.85.218.50 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="k1K8eDAN" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-abec8b750ebso459430666b.0 for ; Fri, 14 Mar 2025 16:36:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741995366; x=1742600166; 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=wCNZEmVTo279fNDGNObkwysv19trySmF6d8VmDkTHqg=; b=k1K8eDAN5Cn9TAgRgl97teQKxYcHLve4qIvOOwxmJ2JWU/QaUbshwBgiWIz4GryV+O ZEXYSCTzubUgfrYSYkaFy4crqSgHtYYbLA9eJPbuBQvJ3RaoVx3Ns8zhWP69T+pupdFk k8YZQfDDNTtMK3EEHz50ffApIanXNZ2WerWTssfsnYa9AH5D4Bskz4xk1jZUK9mdW675 yx55BbXbdPPZ4W6dLXmDMLMU9xIcVbMzSE3W68YPoNtG2cYf1xHiSlBjkK8P7OJXb+91 yoT0MCSL7l88mWOpHx+cyj/GVZa+v6jgnmBeztGFVyQV0VNP8BTjK0EsAXCUPWE1eGCM HwXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741995366; x=1742600166; 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=wCNZEmVTo279fNDGNObkwysv19trySmF6d8VmDkTHqg=; b=qKUdzwEFLW87aGdSEcrzLAOuVNF/aLMQaMydXKOyZaSuOvhx7DJIqnBtU6qLvalZO8 5A4Fk53iyRbIkk7RukML+vRHl7e6kdBvCnPmFfWPklZrBaQqO2UFANSgueg5TKsfi9n0 DYxN/sbYsFYm+jt/0Y10hTruoVuCL0j6bmwWr0BZ5FJ7//7rZEGXl2LV80/KlOFURGwa xo4JxFD1qqYvwou9E6V41CTulFClt50q79Ve605rbMW6MLWoDaczI3jO02jTNsHWPwK5 Igf8oeuzt8EQqW0EqWs1nNMuKpcgD82T8MAzRJCzybVI/prhzxrQzL8LgL3kO4c9efnf dcYA== X-Forwarded-Encrypted: i=1; AJvYcCWTkgV0hIJqLFQedrl2k6AyHsnFkDt7LAq5bs/nLmSg2GFyxUMpq04KTjldwZi/Mny4MMMCn5Ug8rBpmAY=@vger.kernel.org X-Gm-Message-State: AOJu0Yy2/IuaLfjvPh7BmnlV37mF6T9yvoQFCd04csEpM7hrPTOh1Lts Mz+BZb5Ep3+bk+1/JrU7aNOm87NoGfAlDwo20wQ0Mfq/CAoMW2HHBsjf5tkbJqN2wckxoGmji50 MyskKDg== X-Gm-Gg: ASbGncvfGajMg2Z9Of/lqRueCZNLEv5D7MOTWf0yIwOsA7GyHbRR94qf1K6B1QRh+7c 22asgcPiEGkees64MHqVNonMvbyg8iX3eBCiARH1IyhZW8sI8EqK3LbZ+MfH4f7GfmFuAaqJHCX oh7CsaxTcmWFWOmp2Kjiou8WaX8t2RP3lzbcnIIwN83twReFITHhTb58Td5Xtks/oAYpah/3+ry 2GUZ1MZVGkT3U7roKB4cRlPg8Bn9RBgUh/4RWRtJlX5ZzlgeFSJB+VSqvIFx6bxtjNzESKi5YC+ HfjZjLhEVkWDYlX81wXXvINckIjL0xoD/zaBtFNaMgQsjkJ3P8Zs+9VVNIbYlIl5PuoJUTY0Uw8 rQUR0SIiHN2g7UvKrDLg2BEh1e4CV0OFu3rZSS82N2jAnkuf94CJIkOuTLGiitpX3KEAd X-Google-Smtp-Source: AGHT+IF4CdIPtvfCg2tkoBvxP9H4XdVVs0KtMKLsJfJm3Bfx7K6E/235iVersooxQs8BAL2Ed5hOyA== X-Received: by 2002:a17:907:3e06:b0:ac1:f003:be08 with SMTP id a640c23a62f3a-ac330129030mr565756166b.12.1741995365904; Fri, 14 Mar 2025 16:36:05 -0700 (PDT) Received: from [192.168.178.107] (2001-1c06-2302-5600-7555-cca3-bbc4-648b.cable.dynamic.v6.ziggo.nl. [2001:1c06:2302:5600:7555:cca3:bbc4:648b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3146aeadbsm284246966b.29.2025.03.14.16.36.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 16:36:04 -0700 (PDT) From: Bryan O'Donoghue Date: Fri, 14 Mar 2025 23:36:00 +0000 Subject: [PATCH v2 7/7] media: qcom: camss: Add x1e80100 specific 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: quoted-printable Message-Id: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-7-d163d66fcc0d@linaro.org> References: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-0-d163d66fcc0d@linaro.org> In-Reply-To: <20250314-b4-media-comitters-next-25-03-13-x1e80100-camss-driver-v2-0-d163d66fcc0d@linaro.org> To: Robert Foss , Todor Tomov , 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.14.2 Populate CAMSS with x1e80100 specific hooks. Signed-off-by: Bryan O'Donoghue --- .../platform/qcom/camss/camss-csiphy-3ph-1-0.c | 6 + drivers/media/platform/qcom/camss/camss-vfe.c | 2 + drivers/media/platform/qcom/camss/camss.c | 309 +++++++++++++++++= ++++ drivers/media/platform/qcom/camss/camss.h | 1 + 4 files changed, 318 insertions(+) diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/dri= vers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c index d5f717f6215c45908c4fc5a8650d68c00d544db7..f732a76de93e3e7b787d9553bf7= f31e6c0596c58 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 @@ -749,6 +749,7 @@ static bool csiphy_is_gen2(u32 version) case CAMSS_8280XP: case CAMSS_845: case CAMSS_8550: + case CAMSS_X1E80100: ret =3D true; break; } @@ -837,6 +838,11 @@ static int csiphy_init(struct csiphy_device *csiphy) regs->lane_regs =3D &lane_regs_sc8280xp[0]; regs->lane_array_size =3D ARRAY_SIZE(lane_regs_sc8280xp); break; + case CAMSS_X1E80100: + regs->lane_regs =3D &lane_regs_x1e80100[0]; + regs->lane_array_size =3D ARRAY_SIZE(lane_regs_x1e80100); + regs->offset =3D 0x1000; + break; case CAMSS_8550: regs->lane_regs =3D &lane_regs_sm8550[0]; regs->lane_array_size =3D ARRAY_SIZE(lane_regs_sm8550); diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/= platform/qcom/camss/camss-vfe.c index cf0e8f5c004a20381e05fc8b67e068282fa08c41..33824d66dba6b887228805b2796= dcdc9825af094 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.c +++ b/drivers/media/platform/qcom/camss/camss-vfe.c @@ -346,6 +346,7 @@ static u32 vfe_src_pad_code(struct vfe_line *line, u32 = sink_code, case CAMSS_8280XP: case CAMSS_845: case CAMSS_8550: + case CAMSS_X1E80100: switch (sink_code) { case MEDIA_BUS_FMT_YUYV8_1X16: { @@ -1973,6 +1974,7 @@ static int vfe_bpl_align(struct vfe_device *vfe) case CAMSS_8280XP: case CAMSS_845: case CAMSS_8550: + case CAMSS_X1E80100: ret =3D 16; break; default: diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/plat= form/qcom/camss/camss.c index 9da74da679a28070b101df06a8412e85efdcffcc..cbe9c660095da0100b36d4937be= e9e13d937a70d 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -2483,6 +2483,299 @@ static const struct resources_icc icc_res_sm8550[] = =3D { }, }; =20 +static const struct camss_subdev_resources csiphy_res_x1e80100[] =3D { + /* CSIPHY0 */ + { + .regulators =3D { "vdd-csiphy-0p8-supply", + "vdd-csiphy-1p2-supply" }, + .clock =3D { "csiphy0", "csiphy0_timer" }, + .clock_rate =3D { { 300000000, 400000000, 480000000 }, + { 266666667, 400000000 } }, + .reg =3D { "csiphy0" }, + .interrupt =3D { "csiphy0" }, + .csiphy =3D { + .id =3D 0, + .hw_ops =3D &csiphy_ops_3ph_1_0, + .formats =3D &csiphy_formats_sdm845 + }, + }, + /* CSIPHY1 */ + { + .regulators =3D { "vdd-csiphy-0p8-supply", + "vdd-csiphy-1p2-supply" }, + .clock =3D { "csiphy1", "csiphy1_timer" }, + .clock_rate =3D { { 300000000, 400000000, 480000000 }, + { 266666667, 400000000 } }, + .reg =3D { "csiphy1" }, + .interrupt =3D { "csiphy1" }, + .csiphy =3D { + .id =3D 1, + .hw_ops =3D &csiphy_ops_3ph_1_0, + .formats =3D &csiphy_formats_sdm845 + }, + }, + /* CSIPHY2 */ + { + .regulators =3D { "vdd-csiphy-0p8-supply", + "vdd-csiphy-1p2-supply" }, + .clock =3D { "csiphy2", "csiphy2_timer" }, + .clock_rate =3D { { 300000000, 400000000, 480000000 }, + { 266666667, 400000000 } }, + .reg =3D { "csiphy2" }, + .interrupt =3D { "csiphy2" }, + .csiphy =3D { + .id =3D 2, + .hw_ops =3D &csiphy_ops_3ph_1_0, + .formats =3D &csiphy_formats_sdm845 + }, + }, + /* CSIPHY4 */ + { + .regulators =3D { "vdd-csiphy-0p8-supply", + "vdd-csiphy-1p2-supply" }, + .clock =3D { "csiphy4", "csiphy4_timer" }, + .clock_rate =3D { { 300000000, 400000000, 480000000 }, + { 266666667, 400000000 } }, + .reg =3D { "csiphy4" }, + .interrupt =3D { "csiphy4" }, + .csiphy =3D { + .id =3D 4, + .hw_ops =3D &csiphy_ops_3ph_1_0, + .formats =3D &csiphy_formats_sdm845 + }, + }, +}; + +static const struct camss_subdev_resources csid_res_x1e80100[] =3D { + /* CSID0 */ + { + .regulators =3D {}, + .clock =3D { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb", + "cpas_fast_ahb", "csid", "csid_csiphy_rx" }, + .clock_rate =3D { { 0 }, + { 0 }, + { 64000000, 80000000 }, + { 80000000, 100000000, 200000000, + 300000000, 400000000 }, + { 300000000, 400000000, 480000000 }, + { 300000000, 400000000, 480000000 }, }, + .reg =3D { "csid0" }, + .interrupt =3D { "csid0" }, + .csid =3D { + .hw_ops =3D &csid_ops_680, + .parent_dev_ops =3D &vfe_parent_dev_ops, + .formats =3D &csid_formats_gen2 + }, + }, + /* CSID1 */ + { + .regulators =3D {}, + .clock =3D { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb", + "cpas_fast_ahb", "csid", "csid_csiphy_rx" }, + .clock_rate =3D { { 0 }, + { 0 }, + { 64000000, 80000000 }, + { 80000000, 100000000, 200000000, + 300000000, 400000000 }, + { 300000000, 400000000, 480000000 }, + { 300000000, 400000000, 480000000 }, }, + .reg =3D { "csid1" }, + .interrupt =3D { "csid1" }, + .csid =3D { + .hw_ops =3D &csid_ops_680, + .parent_dev_ops =3D &vfe_parent_dev_ops, + .formats =3D &csid_formats_gen2 + }, + }, + /* CSID2 */ + { + .regulators =3D {}, + .clock =3D { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb", + "cpas_fast_ahb", "csid", "csid_csiphy_rx" }, + .clock_rate =3D { { 0 }, + { 0 }, + { 64000000, 80000000 }, + { 80000000, 100000000, 200000000, + 300000000, 400000000 }, + { 300000000, 400000000, 480000000 }, + { 300000000, 400000000, 480000000 }, }, + .reg =3D { "csid2" }, + .interrupt =3D { "csid2" }, + .csid =3D { + .hw_ops =3D &csid_ops_680, + .parent_dev_ops =3D &vfe_parent_dev_ops, + .formats =3D &csid_formats_gen2 + }, + }, + /* CSID_LITE0 */ + { + .regulators =3D {}, + .clock =3D { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb", + "cpas_fast_ahb", "csid", "csid_csiphy_rx" }, + .clock_rate =3D { { 0 }, + { 0 }, + { 64000000, 80000000 }, + { 80000000, 100000000, 200000000, + 300000000, 400000000 }, + { 300000000, 400000000, 480000000 }, + { 300000000, 400000000, 480000000 }, }, + .reg =3D { "csid_lite0" }, + .interrupt =3D { "csid_lite0" }, + .csid =3D { + .is_lite =3D true, + .hw_ops =3D &csid_ops_680, + .parent_dev_ops =3D &vfe_parent_dev_ops, + .formats =3D &csid_formats_gen2 + } + }, + /* CSID_LITE1 */ + { + .regulators =3D {}, + .clock =3D { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb", + "cpas_fast_ahb", "csid", "csid_csiphy_rx" }, + .clock_rate =3D { { 0 }, + { 0 }, + { 64000000, 80000000 }, + { 80000000, 100000000, 200000000, + 300000000, 400000000 }, + { 300000000, 400000000, 480000000 }, + { 300000000, 400000000, 480000000 }, }, + + .reg =3D { "csid_lite1" }, + .interrupt =3D { "csid_lite1" }, + .csid =3D { + .is_lite =3D true, + .hw_ops =3D &csid_ops_680, + .parent_dev_ops =3D &vfe_parent_dev_ops, + .formats =3D &csid_formats_gen2 + } + }, +}; + +static const struct camss_subdev_resources vfe_res_x1e80100[] =3D { + /* IFE0 */ + { + .regulators =3D {}, + .clock =3D {"camnoc_rt_axi", "camnoc_nrt_axi", "cpas_ahb", + "cpas_fast_ahb", "cpas_vfe0", "vfe0_fast_ahb", + "vfe0" }, + .clock_rate =3D { { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 345600000, 432000000, 594000000, 675000000, + 727000000 }, }, + .reg =3D { "vfe0" }, + .interrupt =3D { "vfe0" }, + .vfe =3D { + .line_num =3D 4, + .pd_name =3D "ife0", + .hw_ops =3D &vfe_ops_680, + .formats_rdi =3D &vfe_formats_rdi_845, + .formats_pix =3D &vfe_formats_pix_845 + }, + }, + /* IFE1 */ + { + .regulators =3D {}, + .clock =3D { "camnoc_rt_axi", "camnoc_nrt_axi", "cpas_ahb", + "cpas_fast_ahb", "cpas_vfe1", "vfe1_fast_ahb", + "vfe1" }, + .clock_rate =3D { { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 345600000, 432000000, 594000000, 675000000, + 727000000 }, }, + .reg =3D { "vfe1" }, + .interrupt =3D { "vfe1" }, + .vfe =3D { + .line_num =3D 4, + .pd_name =3D "ife1", + .hw_ops =3D &vfe_ops_680, + .formats_rdi =3D &vfe_formats_rdi_845, + .formats_pix =3D &vfe_formats_pix_845 + }, + }, + /* IFE_LITE_0 */ + { + .regulators =3D {}, + .clock =3D { "camnoc_rt_axi", "camnoc_nrt_axi", "cpas_ahb", + "vfe_lite_ahb", "cpas_vfe_lite", "vfe_lite", + "vfe_lite_csid" }, + .clock_rate =3D { { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 266666667, 400000000, 480000000 }, + { 266666667, 400000000, 480000000 }, }, + .reg =3D { "vfe_lite0" }, + .interrupt =3D { "vfe_lite0" }, + .vfe =3D { + .is_lite =3D true, + .line_num =3D 4, + .hw_ops =3D &vfe_ops_680, + .formats_rdi =3D &vfe_formats_rdi_845, + .formats_pix =3D &vfe_formats_pix_845 + }, + }, + /* IFE_LITE_1 */ + { + .regulators =3D {}, + .clock =3D { "camnoc_rt_axi", "camnoc_nrt_axi", "cpas_ahb", + "vfe_lite_ahb", "cpas_vfe_lite", "vfe_lite", + "vfe_lite_csid" }, + .clock_rate =3D { { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 266666667, 400000000, 480000000 }, + { 266666667, 400000000, 480000000 }, }, + .reg =3D { "vfe_lite1" }, + .interrupt =3D { "vfe_lite1" }, + .vfe =3D { + .is_lite =3D true, + .line_num =3D 4, + .hw_ops =3D &vfe_ops_680, + .formats_rdi =3D &vfe_formats_rdi_845, + .formats_pix =3D &vfe_formats_pix_845 + }, + }, +}; + +static const struct resources_icc icc_res_x1e80100[] =3D { + { + .name =3D "ahb", + .icc_bw_tbl.avg =3D 150000, + .icc_bw_tbl.peak =3D 300000, + }, + { + .name =3D "hf_mnoc", + .icc_bw_tbl.avg =3D 2097152, + .icc_bw_tbl.peak =3D 2097152, + }, + { + .name =3D "sf_mnoc", + .icc_bw_tbl.avg =3D 2097152, + .icc_bw_tbl.peak =3D 2097152, + }, + { + .name =3D "sf_icp_mnoc", + .icc_bw_tbl.avg =3D 2097152, + .icc_bw_tbl.peak =3D 2097152, + }, +}; + +static const struct resources_wrapper csid_wrapper_res_x1e80100 =3D { + .reg =3D "csid_wrapper", +}; + /* * camss_add_clock_margin - Add margin to clock frequency rate * @rate: Clock frequency rate @@ -3544,6 +3837,21 @@ static const struct camss_resources sm8550_resources= =3D { .link_entities =3D camss_link_entities }; =20 +static const struct camss_resources x1e80100_resources =3D { + .version =3D CAMSS_X1E80100, + .pd_name =3D "top", + .csiphy_res =3D csiphy_res_x1e80100, + .csid_res =3D csid_res_x1e80100, + .vfe_res =3D vfe_res_x1e80100, + .csid_wrapper_res =3D &csid_wrapper_res_x1e80100, + .icc_res =3D icc_res_x1e80100, + .icc_path_num =3D ARRAY_SIZE(icc_res_x1e80100), + .csiphy_num =3D ARRAY_SIZE(csiphy_res_x1e80100), + .csid_num =3D ARRAY_SIZE(csid_res_x1e80100), + .vfe_num =3D ARRAY_SIZE(vfe_res_x1e80100), + .link_entities =3D camss_link_entities +}; + static const struct of_device_id camss_dt_match[] =3D { { .compatible =3D "qcom,msm8916-camss", .data =3D &msm8916_resources }, { .compatible =3D "qcom,msm8953-camss", .data =3D &msm8953_resources }, @@ -3555,6 +3863,7 @@ static const struct of_device_id camss_dt_match[] =3D= { { .compatible =3D "qcom,sdm845-camss", .data =3D &sdm845_resources }, { .compatible =3D "qcom,sm8250-camss", .data =3D &sm8250_resources }, { .compatible =3D "qcom,sm8550-camss", .data =3D &sm8550_resources }, + { .compatible =3D "qcom,x1e80100-camss", .data =3D &x1e80100_resources }, { } }; =20 diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/plat= form/qcom/camss/camss.h index b284b910ce421c98df5e77f942f82486342bfcec..63c0afee154a02194820016ccf5= 54620d6521c8b 100644 --- a/drivers/media/platform/qcom/camss/camss.h +++ b/drivers/media/platform/qcom/camss/camss.h @@ -86,6 +86,7 @@ enum camss_version { CAMSS_8280XP, CAMSS_845, CAMSS_8550, + CAMSS_X1E80100, }; =20 enum icc_count { --=20 2.48.1