]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
media: i2c: ds90ub960: Fix UB9702 refclk register access
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Fri, 6 Dec 2024 08:26:38 +0000 (10:26 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 19 Dec 2024 11:50:15 +0000 (12:50 +0100)
UB9702 has the refclk freq register at a different offset than UB960,
but the code uses the UB960's offset for both chips. Fix this.

The refclk freq is only used for a debug print, so there's no functional
change here.

Cc: stable@vger.kernel.org
Fixes: afe267f2d368 ("media: i2c: add DS90UB960 driver")
Reviewed-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/ds90ub960.c

index 33f362a008757578e4c96e6ea7bed2e590776d8d..734ed32b151205e08f424f2a2258fb767e30ae43 100644 (file)
 
 #define UB960_SR_I2C_RX_ID(n)                  (0xf8 + (n)) /* < UB960_FPD_RX_NPORTS */
 
+#define UB9702_SR_REFCLK_FREQ                  0x3d
+
 /* Indirect register blocks */
 #define UB960_IND_TARGET_PAT_GEN               0x00
 #define UB960_IND_TARGET_RX_ANA(n)             (0x01 + (n))
@@ -3834,7 +3836,10 @@ static int ub960_enable_core_hw(struct ub960_data *priv)
        if (ret)
                goto err_pd_gpio;
 
-       ret = ub960_read(priv, UB960_XR_REFCLK_FREQ, &refclk_freq);
+       if (priv->hw_data->is_ub9702)
+               ret = ub960_read(priv, UB9702_SR_REFCLK_FREQ, &refclk_freq);
+       else
+               ret = ub960_read(priv, UB960_XR_REFCLK_FREQ, &refclk_freq);
        if (ret)
                goto err_pd_gpio;