aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/ti-vpe/cal.c
diff options
context:
space:
mode:
authorBenoit Parrot <bparrot@ti.com>2019-11-12 15:53:42 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2019-12-09 11:31:08 +0100
commit7a3b9684cede12dd60b50af874646527e25eb4d2 (patch)
tree0297d193d746fcd3f41120558a9006199456a3c9 /drivers/media/platform/ti-vpe/cal.c
parent5fa3144be4fceb0d9eace26de404738a7d68f302 (diff)
media: ti-vpe: cal: Add AM654 support
Add the needed control module register bit layout to support the AM654 family of devices. Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/ti-vpe/cal.c')
-rw-r--r--drivers/media/platform/ti-vpe/cal.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
index 0ed517b3c00d..58d2edc087fb 100644
--- a/drivers/media/platform/ti-vpe/cal.c
+++ b/drivers/media/platform/ti-vpe/cal.c
@@ -317,6 +317,24 @@ static const struct cal_data dra76x_cal_data = {
.num_csi2_phy = ARRAY_SIZE(dra76x_cal_csi_phy),
};
+static struct reg_field am654_ctrl_core_csi0_reg_fields[F_MAX_FIELDS] = {
+ [F_CTRLCLKEN] = REG_FIELD(0, 15, 15),
+ [F_CAMMODE] = REG_FIELD(0, 24, 25),
+ [F_LANEENABLE] = REG_FIELD(0, 0, 4),
+};
+
+static struct cal_csi2_phy am654_cal_csi_phy[] = {
+ {
+ .base_fields = am654_ctrl_core_csi0_reg_fields,
+ .num_lanes = 5,
+ },
+};
+
+static const struct cal_data am654_cal_data = {
+ .csi2_phy_core = am654_cal_csi_phy,
+ .num_csi2_phy = ARRAY_SIZE(am654_cal_csi_phy),
+};
+
/*
* there is one cal_dev structure in the driver, it is shared by
* all instances.
@@ -543,7 +561,9 @@ static void camerarx_phy_enable(struct cal_ctx *ctx)
/* Always enable all lanes at the phy control level */
max_lanes = (1 << cal_data_get_phy_max_lanes(ctx)) - 1;
regmap_field_write(phy->fields[F_LANEENABLE], max_lanes);
- regmap_field_write(phy->fields[F_CSI_MODE], 1);
+ /* F_CSI_MODE is not present on every architecture */
+ if (phy->fields[F_CSI_MODE])
+ regmap_field_write(phy->fields[F_CSI_MODE], 1);
regmap_field_write(phy->fields[F_CTRLCLKEN], 1);
}
@@ -2321,6 +2341,10 @@ static const struct of_device_id cal_of_match[] = {
.compatible = "ti,dra76-cal",
.data = (void *)&dra76x_cal_data,
},
+ {
+ .compatible = "ti,am654-cal",
+ .data = (void *)&am654_cal_data,
+ },
{},
};
MODULE_DEVICE_TABLE(of, cal_of_match);

Privacy Policy