]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: i2c: imx: Add note to prevent buggy code re-use
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 18 Aug 2025 15:00:26 +0000 (17:00 +0200)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Mon, 25 Aug 2025 13:40:44 +0000 (15:40 +0200)
Multiple Sony IMX sensor drivers have mixed up logical and line level
for XCLR signal.  They call it a reset signal (it indeed behaves like
that), but drivers assert the reset to operate which is clearly
incorrect and relies on incorrect DTS.

People in discussions copy existing poor code and claim they can repeat
same mistake, so add a note to prevent that.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/i2c/imx219.c
drivers/media/i2c/imx274.c
drivers/media/i2c/imx334.c

index bb78085151783b9d2cd5d0a88fbc0a3caf427836..05f0c2c69fd2cda4baa458b205bb1dd6f515ab48 100644 (file)
@@ -1034,6 +1034,10 @@ static int imx219_power_on(struct device *dev)
                goto reg_off;
        }
 
+       /*
+        * Note: Misinterpretation of reset assertion - do not re-use this code.
+        * XCLR pin is using incorrect (for reset signal) logical level.
+        */
        gpiod_set_value_cansleep(imx219->reset_gpio, 1);
        usleep_range(IMX219_XCLR_MIN_DELAY_US,
                     IMX219_XCLR_MIN_DELAY_US + IMX219_XCLR_DELAY_RANGE_US);
index a2b824986027eef95a0289e73fdeb49857ac3095..d86d08c29174584b26e109a7858542313219c19a 100644 (file)
@@ -826,6 +826,8 @@ static int imx274_start_stream(struct stimx274 *priv)
  * if rst = 0, keep it in reset;
  * if rst = 1, bring it out of reset.
  *
+ * Note: Misinterpretation of reset assertion - do not re-use this code.
+ * XCLR pin is using incorrect (for reset signal) logical level.
  */
 static void imx274_reset(struct stimx274 *priv, int rst)
 {
index 1cf0241aae77407baa52e8cf126cd6540ea17825..9654f9268056f431c174704d6d728e7db2e33dbe 100644 (file)
@@ -1079,6 +1079,10 @@ static int imx334_power_on(struct device *dev)
        struct imx334 *imx334 = to_imx334(sd);
        int ret;
 
+       /*
+        * Note: Misinterpretation of reset assertion - do not re-use this code.
+        * XCLR pin is using incorrect (for reset signal) logical level.
+        */
        gpiod_set_value_cansleep(imx334->reset_gpio, 1);
 
        ret = clk_prepare_enable(imx334->inclk);