From patchwork Tue Oct 1 02:35:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Acayan X-Patchwork-Id: 13817333 Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.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 5D8582CCAA; Tue, 1 Oct 2024 02:36:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727750206; cv=none; b=FfQYo+I0lrwzAwaioHP8glSF4K7ffeupzZdL4oxukikU8oHDhj1WOw6gvhao8OjUmTpaRw0DiS61BjmV7FWpmnEVZHX7Cxt/rwSp/pMgkH7XwPnTrUu6xLcnJwPmW6BRETl4Dyd/B54kGFc8+C38/qhX5RtApUSQu4wQSLWw0j4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727750206; c=relaxed/simple; bh=na5bkUReY3TGX9GGsfxNPj1JrPn0PMoukBIU7xCpFyM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X9XGOMA6yllNg07JliBRnZyVl2OcZGZVDGV5oNHzC/7870fnRorzoJu01oDb5s6XezON4VVCFzMtmCv2PXRxJI7OxvCZIEOHcH1MG6tr911VuGoU3eMCfcea9iKtQxVV5eEi1K5rnFz+Y6JKgb7d6f6RbgCsbURwlkjyWv0kkZc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IBvsK/uH; arc=none smtp.client-ip=209.85.219.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IBvsK/uH" Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-6c582ca168fso35541286d6.2; Mon, 30 Sep 2024 19:36:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727750203; x=1728355003; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eT4qWTXziBJHDGV9bG7BE2H7PamlKS+V21Q5fFg84tY=; b=IBvsK/uHyiIQo3vH2gpQ05NSVMxDeQ6UbC0v/9HDcU0hvZIQrvxqiyh+z9qQ57kvqI fYO/zuNllQlxpah0NfR6RqGQ4Fx4GeNuCS5gJbdGz1xTD2LIigCN3yP8UdD+t8h2z+Dl 3sjlWJA2ynptJ4xECtN9NZzc1BunbuW+5CNLALzT6VV20e6YYoj1op1ixW4YPKQD9L1i xMOMS8k4r+OAYbnwXcwdFYaTb6POPRRbRaLmiESKygDuMoPSZ3prg0iuyEAtIGxrIX+u INzmWrvRe2u1SG1aLjh7HGHTfcczri2HpT976m68cHy3Hgme/U0i98bNzEUNxLtn13R2 Wb1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727750203; x=1728355003; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eT4qWTXziBJHDGV9bG7BE2H7PamlKS+V21Q5fFg84tY=; b=JIVwOuEli7jyXUyR26WtHbddrrNZ5uwlVj7H8jnWjhsstuMWi8QWiJacwJFnAKRSiu Ou8gdNLmcXsb0TMOgUIBxLNXCmjmLgqpjrVHVKujgHd6TlulKiOvLaHpEJVKYmp16Npy smXQTosYFqxnZC1cus8Ix7mIuRjeZ2uyEnydL+WOIV/fG4qEOZQXr4TdxbazORU4YeP1 U/lp3QM3NiOkWlYhP5a5awDhO9uHzRM1dheKf0l1eYM8RRL8wrCZKB9ZETa+RqJmLpsR PKb6l3GaQrDylh94hzNuE6Fw+libSa65KrvBlYeqjozGhdmLeu3wKm6P2Y6KNoXlnH2f +e7Q== X-Forwarded-Encrypted: i=1; AJvYcCW9r3Fr6zu2UMTcs8GHjbJtBsJgl01OpVtbAQN/b6eNhEHcoQvGzmPYYe23lUw8LBD7gJyvQ81iL6H2@vger.kernel.org, AJvYcCX9PyxkOsxQYwjJCPXq4XCcivLwVKoX72zc/ehNQ4YqtcP8vVjiI3oOpFQpS36JVwrWgVNgdfHjwua9eLXuYg==@vger.kernel.org, AJvYcCXBplljtTaW9wXdNlQOtLZC8Rx5oG+NY/78VhVZ2OQJPLC5Acb6zRRe3ayBxRpGf4awstvJnRBJ8ZDy@vger.kernel.org, AJvYcCXR7FNuuXdDlgojhiASZh9H+CufgZP8tLeXiNHmuBNpqn+XxKRumTVSJgU5KDCSf0l0IwvamVjJ1jma@vger.kernel.org, AJvYcCXqaqXqQFzfcuRGivuitcnHY2MGeafwmwTEPo+rsRBMhwviJ2ErcRzP2PKpnKtZEDphjp3ah/hJSnfzO9w=@vger.kernel.org X-Gm-Message-State: AOJu0Yw8KnN9e6eR1n8BaXm9pMYKqCLOUTNScRYSVqWQOmEtZcuf77KE vgf0E9qP/ZqbLDUiL6T3gDexyL8RlHxoVbe5Tu/LDrpR83F1reg3 X-Google-Smtp-Source: AGHT+IEcYmO/U8N+9v+jZmJBqoBYopw06HsbbyXms800Vm4pMPhUmcfM23h/l1kGFavk7xelRkx9+w== X-Received: by 2002:a05:6214:3187:b0:6cb:3643:3370 with SMTP id 6a1803df08f44-6cb3b5e8b2cmr262126206d6.23.1727750203235; Mon, 30 Sep 2024 19:36:43 -0700 (PDT) Received: from localhost ([2607:fea8:52a3:d200::1a17]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6cb3b60fbccsm45386836d6.45.2024.09.30.19.36.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 19:36:42 -0700 (PDT) From: Richard Acayan To: Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Loic Poulain , Robert Foss , Andi Shyti , Todor Tomov , "Bryan O'Donoghue" , Mauro Carvalho Chehab , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-i2c@vger.kernel.org, linux-media@vger.kernel.org Cc: Vladimir Zapolskiy , Richard Acayan Subject: [PATCH v5 5/7] media: qcom: camss: add support for SDM670 camss Date: Mon, 30 Sep 2024 22:35:26 -0400 Message-ID: <20241001023520.547271-14-mailingradian@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241001023520.547271-9-mailingradian@gmail.com> References: <20241001023520.547271-9-mailingradian@gmail.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The camera subsystem for the SDM670 the same as on SDM845 except with 3 CSIPHY ports instead of 4. Add support for the SDM670 camera subsystem. Signed-off-by: Richard Acayan Reviewed-by: Bryan O'Donoghue Acked-by: Bryan O'Donoghue Reviewed-by: Vladimir Zapolskiy --- drivers/media/platform/qcom/camss/camss.c | 191 ++++++++++++++++++++++ 1 file changed, 191 insertions(+) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index d64985ca6e88..4694f5219654 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -584,6 +584,185 @@ static const struct camss_subdev_resources vfe_res_660[] = { } }; +static const struct camss_subdev_resources csiphy_res_670[] = { + /* CSIPHY0 */ + { + .regulators = {}, + .clock = { "soc_ahb", "cpas_ahb", + "csiphy0", "csiphy0_timer" }, + .clock_rate = { { 0 }, + { 0 }, + { 0 }, + { 19200000, 240000000, 269333333 } }, + .reg = { "csiphy0" }, + .interrupt = { "csiphy0" }, + .csiphy = { + .hw_ops = &csiphy_ops_3ph_1_0, + .formats = &csiphy_formats_sdm845 + } + }, + + /* CSIPHY1 */ + { + .regulators = {}, + .clock = { "soc_ahb", "cpas_ahb", + "csiphy1", "csiphy1_timer" }, + .clock_rate = { { 0 }, + { 0 }, + { 0 }, + { 19200000, 240000000, 269333333 } }, + .reg = { "csiphy1" }, + .interrupt = { "csiphy1" }, + .csiphy = { + .hw_ops = &csiphy_ops_3ph_1_0, + .formats = &csiphy_formats_sdm845 + } + }, + + /* CSIPHY2 */ + { + .regulators = {}, + .clock = { "soc_ahb", "cpas_ahb", + "csiphy2", "csiphy2_timer" }, + .clock_rate = { { 0 }, + { 0 }, + { 0 }, + { 19200000, 240000000, 269333333 } }, + .reg = { "csiphy2" }, + .interrupt = { "csiphy2" }, + .csiphy = { + .hw_ops = &csiphy_ops_3ph_1_0, + .formats = &csiphy_formats_sdm845 + } + } +}; + +static const struct camss_subdev_resources csid_res_670[] = { + /* CSID0 */ + { + .regulators = { "vdda-phy", "vdda-pll" }, + .clock = { "cpas_ahb", "soc_ahb", "vfe0", + "vfe0_cphy_rx", "csi0" }, + .clock_rate = { { 0 }, + { 0 }, + { 100000000, 320000000, 404000000, 480000000, 600000000 }, + { 384000000 }, + { 19200000, 75000000, 384000000, 538666667 } }, + .reg = { "csid0" }, + .interrupt = { "csid0" }, + .csid = { + .hw_ops = &csid_ops_gen2, + .parent_dev_ops = &vfe_parent_dev_ops, + .formats = &csid_formats_gen2 + } + }, + + /* CSID1 */ + { + .regulators = { "vdda-phy", "vdda-pll" }, + .clock = { "cpas_ahb", "soc_ahb", "vfe1", + "vfe1_cphy_rx", "csi1" }, + .clock_rate = { { 0 }, + { 0 }, + { 100000000, 320000000, 404000000, 480000000, 600000000 }, + { 384000000 }, + { 19200000, 75000000, 384000000, 538666667 } }, + .reg = { "csid1" }, + .interrupt = { "csid1" }, + .csid = { + .hw_ops = &csid_ops_gen2, + .parent_dev_ops = &vfe_parent_dev_ops, + .formats = &csid_formats_gen2 + } + }, + + /* CSID2 */ + { + .regulators = { "vdda-phy", "vdda-pll" }, + .clock = { "cpas_ahb", "soc_ahb", "vfe_lite", + "vfe_lite_cphy_rx", "csi2" }, + .clock_rate = { { 0 }, + { 0 }, + { 100000000, 320000000, 404000000, 480000000, 600000000 }, + { 384000000 }, + { 19200000, 75000000, 384000000, 538666667 } }, + .reg = { "csid2" }, + .interrupt = { "csid2" }, + .csid = { + .is_lite = true, + .hw_ops = &csid_ops_gen2, + .parent_dev_ops = &vfe_parent_dev_ops, + .formats = &csid_formats_gen2 + } + } +}; + +static const struct camss_subdev_resources vfe_res_670[] = { + /* VFE0 */ + { + .regulators = {}, + .clock = { "camnoc_axi", "cpas_ahb", "soc_ahb", + "vfe0", "vfe0_axi" }, + .clock_rate = { { 0 }, + { 0 }, + { 0 }, + { 100000000, 320000000, 404000000, 480000000, 600000000 }, + { 0 } }, + .reg = { "vfe0" }, + .interrupt = { "vfe0" }, + .vfe = { + .line_num = 4, + .has_pd = true, + .pd_name = "ife0", + .hw_ops = &vfe_ops_170, + .formats_rdi = &vfe_formats_rdi_845, + .formats_pix = &vfe_formats_pix_845 + } + }, + + /* VFE1 */ + { + .regulators = {}, + .clock = { "camnoc_axi", "cpas_ahb", "soc_ahb", + "vfe1", "vfe1_axi" }, + .clock_rate = { { 0 }, + { 0 }, + { 0 }, + { 100000000, 320000000, 404000000, 480000000, 600000000 }, + { 0 } }, + .reg = { "vfe1" }, + .interrupt = { "vfe1" }, + .vfe = { + .line_num = 4, + .has_pd = true, + .pd_name = "ife1", + .hw_ops = &vfe_ops_170, + .formats_rdi = &vfe_formats_rdi_845, + .formats_pix = &vfe_formats_pix_845 + } + }, + + /* VFE-lite */ + { + .regulators = {}, + .clock = { "camnoc_axi", "cpas_ahb", "soc_ahb", + "vfe_lite" }, + .clock_rate = { { 0 }, + { 0 }, + { 0 }, + { 100000000, 320000000, 404000000, 480000000, 600000000 } }, + .reg = { "vfe_lite" }, + .interrupt = { "vfe_lite" }, + .vfe = { + .is_lite = true, + .line_num = 4, + .hw_ops = &vfe_ops_170, + .formats_rdi = &vfe_formats_rdi_845, + .formats_pix = &vfe_formats_pix_845 + } + } +}; + static const struct camss_subdev_resources csiphy_res_845[] = { /* CSIPHY0 */ { @@ -2404,6 +2583,17 @@ static const struct camss_resources sdm660_resources = { .link_entities = camss_link_entities }; +static const struct camss_resources sdm670_resources = { + .version = CAMSS_845, + .csiphy_res = csiphy_res_670, + .csid_res = csid_res_670, + .vfe_res = vfe_res_670, + .csiphy_num = ARRAY_SIZE(csiphy_res_670), + .csid_num = ARRAY_SIZE(csid_res_670), + .vfe_num = ARRAY_SIZE(vfe_res_670), + .link_entities = camss_link_entities +}; + static const struct camss_resources sdm845_resources = { .version = CAMSS_845, .csiphy_res = csiphy_res_845, @@ -2448,6 +2638,7 @@ static const struct of_device_id camss_dt_match[] = { { .compatible = "qcom,msm8916-camss", .data = &msm8916_resources }, { .compatible = "qcom,msm8996-camss", .data = &msm8996_resources }, { .compatible = "qcom,sdm660-camss", .data = &sdm660_resources }, + { .compatible = "qcom,sdm670-camss", .data = &sdm670_resources }, { .compatible = "qcom,sdm845-camss", .data = &sdm845_resources }, { .compatible = "qcom,sm8250-camss", .data = &sm8250_resources }, { .compatible = "qcom,sc8280xp-camss", .data = &sc8280xp_resources },