Commit b4436a18 authored by Jonathan Marek's avatar Jonathan Marek Committed by Mauro Carvalho Chehab
Browse files

media: camss: add support for SM8250 camss



The Titan 480 camss found on SM8250 has 6 CSIPHY and 4 VFE/CSID.

CSID is compatible with the Titan 170 CSID, but the Titan 480 CSID are
inside the VFE region (between the "top" and "bus" registers), so a
workaround is added to avoid ioremap failure.

[bod] Fixed setting camnoc_axi_clk_src instead of camcc_camnoc_axi_clk
[jgrahsl, bod] Add slow_ahb_src clock values
[jgrahsl, bod] Add cpa_ahb clock values

Signed-off-by: default avatarJonathan Marek <jonathan@marek.ca>
Tested-by: default avatarJulian Grahsl <jgrahsl@snap.com>
Co-developed-by: default avatarJulian Grahsl <jgrahsl@snap.com>
Signed-off-by: default avatarJulian Grahsl <jgrahsl@snap.com>
Reviewed-by: default avatarRobert Foss <robert.foss@linaro.org>
Co-developed-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent e53d6608
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ qcom-camss-objs += \
		camss-csid.o \
		camss-csid-4-1.o \
		camss-csid-4-7.o \
		camss-csid-170.o \
		camss-csid-gen2.o \
		camss-csiphy-2ph-1-0.o \
		camss-csiphy-3ph-1-0.o \
		camss-csiphy.o \
+1 −1
Original line number Diff line number Diff line
@@ -594,7 +594,7 @@ static void csid_subdev_init(struct csid_device *csid)
	csid->testgen.nmodes = CSID_PAYLOAD_MODE_NUM_SUPPORTED_GEN2;
}

const struct csid_hw_ops csid_ops_170 = {
const struct csid_hw_ops csid_ops_gen2 = {
	.configure_stream = csid_configure_stream,
	.configure_testgen_pattern = csid_configure_testgen_pattern,
	.hw_version = csid_hw_version,
+21 −5
Original line number Diff line number Diff line
@@ -25,6 +25,10 @@
#include "camss-csid-gen1.h"
#include "camss.h"

/* offset of CSID registers in VFE region for VFE 480 */
#define VFE_480_CSID_OFFSET 0x1200
#define VFE_480_LITE_CSID_OFFSET 0x200

#define MSM_CSID_NAME "msm_csid"

const char * const csid_testgen_modes[] = {
@@ -559,8 +563,9 @@ int msm_csid_subdev_init(struct camss *camss, struct csid_device *csid,
	} else if (camss->version == CAMSS_8x96 ||
		   camss->version == CAMSS_660) {
		csid->ops = &csid_ops_4_7;
	} else if (camss->version == CAMSS_845) {
		csid->ops = &csid_ops_170;
	} else if (camss->version == CAMSS_845 ||
		   camss->version == CAMSS_8250) {
		csid->ops = &csid_ops_gen2;
	} else {
		return -EINVAL;
	}
@@ -568,9 +573,20 @@ int msm_csid_subdev_init(struct camss *camss, struct csid_device *csid,

	/* Memory */

	if (camss->version == CAMSS_8250) {
		/* for titan 480, CSID registers are inside the VFE region,
		 * between the VFE "top" and "bus" registers. this requires
		 * VFE to be initialized before CSID
		 */
		if (id >= 2) /* VFE/CSID lite */
			csid->base = camss->vfe[id].base + VFE_480_LITE_CSID_OFFSET;
		else
			csid->base = camss->vfe[id].base + VFE_480_CSID_OFFSET;
	} else {
		csid->base = devm_platform_ioremap_resource_byname(pdev, res->reg[0]);
		if (IS_ERR(csid->base))
			return PTR_ERR(csid->base);
	}

	/* Interrupt */

+1 −1
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ extern const char * const csid_testgen_modes[];

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_170;
extern const struct csid_hw_ops csid_ops_gen2;


#endif /* QC_MSM_CAMSS_CSID_H */
+6 −2
Original line number Diff line number Diff line
@@ -586,7 +586,8 @@ int msm_csiphy_subdev_init(struct camss *camss,
		csiphy->ops = &csiphy_ops_3ph_1_0;
		csiphy->formats = csiphy_formats_8x96;
		csiphy->nformats = ARRAY_SIZE(csiphy_formats_8x96);
	} else if (camss->version == CAMSS_845) {
	} else if (camss->version == CAMSS_845 ||
		   camss->version == CAMSS_8250) {
		csiphy->ops = &csiphy_ops_3ph_1_0;
		csiphy->formats = csiphy_formats_sdm845;
		csiphy->nformats = ARRAY_SIZE(csiphy_formats_sdm845);
@@ -680,7 +681,10 @@ int msm_csiphy_subdev_init(struct camss *camss,

		if (!strcmp(clock->name, "csiphy0_timer") ||
		    !strcmp(clock->name, "csiphy1_timer") ||
		    !strcmp(clock->name, "csiphy2_timer"))
		    !strcmp(clock->name, "csiphy2_timer") ||
		    !strcmp(clock->name, "csiphy3_timer") ||
		    !strcmp(clock->name, "csiphy4_timer") ||
		    !strcmp(clock->name, "csiphy5_timer"))
			csiphy->rate_set[i] = true;

		if (camss->version == CAMSS_660 &&
Loading