46 lines
1.3 KiB
Diff
46 lines
1.3 KiB
Diff
|
From a3b8d1eb00bbe351d2674695cb067b14807a5852 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 343/469] 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 b80b9b228a65..e7bbbd3093ca 100644
|
||
|
--- a/drivers/media/i2c/imx258.c
|
||
|
+++ b/drivers/media/i2c/imx258.c
|
||
|
@@ -80,7 +80,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;
|
||
|
@@ -1300,8 +1302,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.34.1
|
||
|
|