Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: sh-msiof: Enforce fixed DTDL for R-Car H3

Documentation says only DTDL of 200 is allowed for this SoC.

Fixes: 4286db8456f4 ("spi: sh-msiof: Add R-Car Gen 2 and 3 fallback bindings")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://msgid.link/r/20231212081239.14254-1-wsa+renesas@sang-engineering.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Wolfram Sang and committed by
Mark Brown
e5c7bcb4 0d7096c1

+17
+17
drivers/spi/spi-sh-msiof.c
··· 29 29 30 30 #include <asm/unaligned.h> 31 31 32 + #define SH_MSIOF_FLAG_FIXED_DTDL_200 BIT(0) 33 + 32 34 struct sh_msiof_chipdata { 33 35 u32 bits_per_word_mask; 34 36 u16 tx_fifo_size; 35 37 u16 rx_fifo_size; 36 38 u16 ctlr_flags; 37 39 u16 min_div_pow; 40 + u32 flags; 38 41 }; 39 42 40 43 struct sh_msiof_spi_priv { ··· 1075 1072 .min_div_pow = 1, 1076 1073 }; 1077 1074 1075 + static const struct sh_msiof_chipdata rcar_r8a7795_data = { 1076 + .bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(16) | 1077 + SPI_BPW_MASK(24) | SPI_BPW_MASK(32), 1078 + .tx_fifo_size = 64, 1079 + .rx_fifo_size = 64, 1080 + .ctlr_flags = SPI_CONTROLLER_MUST_TX, 1081 + .min_div_pow = 1, 1082 + .flags = SH_MSIOF_FLAG_FIXED_DTDL_200, 1083 + }; 1084 + 1078 1085 static const struct of_device_id sh_msiof_match[] __maybe_unused = { 1079 1086 { .compatible = "renesas,sh-mobile-msiof", .data = &sh_data }, 1080 1087 { .compatible = "renesas,msiof-r8a7743", .data = &rcar_gen2_data }, ··· 1095 1082 { .compatible = "renesas,msiof-r8a7793", .data = &rcar_gen2_data }, 1096 1083 { .compatible = "renesas,msiof-r8a7794", .data = &rcar_gen2_data }, 1097 1084 { .compatible = "renesas,rcar-gen2-msiof", .data = &rcar_gen2_data }, 1085 + { .compatible = "renesas,msiof-r8a7795", .data = &rcar_r8a7795_data }, 1098 1086 { .compatible = "renesas,msiof-r8a7796", .data = &rcar_gen3_data }, 1099 1087 { .compatible = "renesas,rcar-gen3-msiof", .data = &rcar_gen3_data }, 1100 1088 { .compatible = "renesas,rcar-gen4-msiof", .data = &rcar_gen3_data }, ··· 1292 1278 dev_err(&pdev->dev, "failed to obtain device info\n"); 1293 1279 return -ENXIO; 1294 1280 } 1281 + 1282 + if (chipdata->flags & SH_MSIOF_FLAG_FIXED_DTDL_200) 1283 + info->dtdl = 200; 1295 1284 1296 1285 if (info->mode == MSIOF_SPI_TARGET) 1297 1286 ctlr = spi_alloc_target(&pdev->dev,