46 lines
1.3 KiB
Diff
46 lines
1.3 KiB
Diff
From 78adece4368fd5fa6e0edac9b8cf9c818bcd3834 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
|
|
Date: Fri, 22 Oct 2021 18:11:26 +0200
|
|
Subject: [PATCH 344/389] media: i2c: imx258: Don't be too strict about clock
|
|
rate
|
|
|
|
On Pinephone Pro, we are not able to set 19.2MHz precisely.
|
|
Allow some slack in clock rate.
|
|
|
|
Signed-off-by: Ondrej Jirman <megi@xff.cz>
|
|
---
|
|
drivers/media/i2c/imx258.c | 9 +++++++--
|
|
1 file changed, 7 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c
|
|
index 3c7e4c1a0c10..24c3a20eef0e 100644
|
|
--- a/drivers/media/i2c/imx258.c
|
|
+++ b/drivers/media/i2c/imx258.c
|
|
@@ -79,7 +79,9 @@
|
|
#define REG_CONFIG_FLIP_TEST_PATTERN 0x02
|
|
|
|
/* Input clock frequency in Hz */
|
|
+#define IMX258_INPUT_CLOCK_FREQ_MIN 19000000
|
|
#define IMX258_INPUT_CLOCK_FREQ 19200000
|
|
+#define IMX258_INPUT_CLOCK_FREQ_MAX 19400000
|
|
|
|
struct imx258_reg {
|
|
u16 address;
|
|
@@ -1277,8 +1279,11 @@ static int imx258_probe(struct i2c_client *client)
|
|
} else {
|
|
val = clk_get_rate(imx258->clk);
|
|
}
|
|
- if (val != IMX258_INPUT_CLOCK_FREQ) {
|
|
- dev_err(&client->dev, "input clock frequency not supported\n");
|
|
+
|
|
+ if (val < IMX258_INPUT_CLOCK_FREQ_MIN
|
|
+ || val > IMX258_INPUT_CLOCK_FREQ_MAX) {
|
|
+ dev_err(&client->dev, "input clock frequency %u not supported\n",
|
|
+ val);
|
|
return -EINVAL;
|
|
}
|
|
|
|
--
|
|
2.35.3
|
|
|