]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: rcar-csi2: Correct field size for PHTW writes
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Fri, 30 Aug 2024 20:30:58 +0000 (22:30 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 16 Oct 2024 07:32:37 +0000 (09:32 +0200)
The data and code written thru the Test Interface Write Register (PHTW)
register are 8-bit wide, change the datatype used to reflect this.

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>
drivers/media/platform/renesas/rcar-csi2.c

index c9e2862fcaa536048a1803fdecc2a0b055a52e8f..f23914f6659323a74a7f4263da753bfe6e20c9e4 100644 (file)
@@ -238,13 +238,13 @@ static const struct rcsi2_cphy_setting cphy_setting_table_r8a779g0[] = {
 };
 
 struct phtw_value {
-       u16 data;
-       u16 code;
+       u8 data;
+       u8 code;
 };
 
 struct rcsi2_mbps_reg {
        u16 mbps;
-       u16 reg;
+       u8 reg;
 };
 
 static const struct rcsi2_mbps_reg phtw_mbps_v3u[] = {
@@ -1451,7 +1451,7 @@ static int rcsi2_parse_dt(struct rcar_csi2 *priv)
  * NOTE: Magic values are from the datasheet and lack documentation.
  */
 
-static int rcsi2_phtw_write(struct rcar_csi2 *priv, u16 data, u16 code)
+static int rcsi2_phtw_write(struct rcar_csi2 *priv, u8 data, u8 code)
 {
        unsigned int timeout;
 
@@ -1488,7 +1488,7 @@ static int rcsi2_phtw_write_array(struct rcar_csi2 *priv,
 }
 
 static int rcsi2_phtw_write_mbps(struct rcar_csi2 *priv, unsigned int mbps,
-                                const struct rcsi2_mbps_reg *values, u16 code)
+                                const struct rcsi2_mbps_reg *values, u8 code)
 {
        const struct rcsi2_mbps_reg *value;
        const struct rcsi2_mbps_reg *prev_value = NULL;