summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>2024-10-02 11:23:31 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2024-10-16 09:32:38 +0200
commit6c872b782aeaec31042643e57d6aedba1464d0b9 (patch)
treee334b6f770e986d54cfbe04188b19dc5777335d1 /drivers/staging
parent9350219aa3570ae89cd3cad59d3d00ecf44e7f48 (diff)
media: staging: max96712: Add support for MAX96724
The MAX96724 is almost identical to the MAX96712 and can be supported by the same driver, add support for it. For the staging driver which only supports patter generation the big difference is that the datasheet (rev 4) for MAX96724 do not describe the DEBUG_EXTRA register, which is at offset 0x0009 on MAX96712. It's not clear if this register is removed or moved to a different offset. What is known is writing to register 0x0009 have no effect on MAX96724. This makes it impossible to increase the test pattern clock frequency from 25 MHz to 75Mhz on MAX96724. To be able to get a stable test pattern the DPLL frequency have to be increase instead to compensate for this. The frequency selected is found by experimentation as the MAX96724 datasheet is much sparser then what's available for MAX96712. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/media/max96712/max96712.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/staging/media/max96712/max96712.c b/drivers/staging/media/max96712/max96712.c
index 0ee66022026e..ede02e8c891c 100644
--- a/drivers/staging/media/max96712/max96712.c
+++ b/drivers/staging/media/max96712/max96712.c
@@ -27,6 +27,7 @@ enum max96712_pattern {
struct max96712_info {
unsigned int dpllfreq;
+ bool have_debug_extra;
};
struct max96712_priv {
@@ -173,8 +174,9 @@ static void max96712_pattern_enable(struct max96712_priv *priv, bool enable)
return;
}
- /* PCLK 75MHz. */
- max96712_write(priv, DEBUG_EXTRA_REG, DEBUG_EXTRA_PCLK_75MHZ);
+ /* Set PCLK to 75MHz if device have DEBUG_EXTRA register. */
+ if (priv->info->have_debug_extra)
+ max96712_write(priv, DEBUG_EXTRA_REG, DEBUG_EXTRA_PCLK_75MHZ);
/* Configure Video Timing Generator for 1920x1080 @ 30 fps. */
max96712_write_bulk_value(priv, 0x1052, 0, 3);
@@ -455,10 +457,16 @@ static void max96712_remove(struct i2c_client *client)
static const struct max96712_info max96712_info_max96712 = {
.dpllfreq = 1000,
+ .have_debug_extra = true,
+};
+
+static const struct max96712_info max96712_info_max96724 = {
+ .dpllfreq = 1200,
};
static const struct of_device_id max96712_of_table[] = {
{ .compatible = "maxim,max96712", .data = &max96712_info_max96712 },
+ { .compatible = "maxim,max96724", .data = &max96712_info_max96724 },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, max96712_of_table);