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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'spi-v6.2-rc8-abi' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fix from Mark Brown:
"One more last minute patch for v6.2 updating the parsing of the newly
added spi-cs-setup-delay-ns.

It's been pointed out that due to the way DT parsing works the change
in property size is ABI visible so let's not let a release go out
without it being fixed. The change got split from some earlier ABI
related fixes to the property since the first version sent had a build
error"

* tag 'spi-v6.2-rc8-abi' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
spi: Use a 32-bit DT property for spi-cs-setup-delay-ns

+18 -5
+18 -5
drivers/spi/spi.c
··· 2220 2220 /*-------------------------------------------------------------------------*/ 2221 2221 2222 2222 #if defined(CONFIG_OF) 2223 + static void of_spi_parse_dt_cs_delay(struct device_node *nc, 2224 + struct spi_delay *delay, const char *prop) 2225 + { 2226 + u32 value; 2227 + 2228 + if (!of_property_read_u32(nc, prop, &value)) { 2229 + if (value > U16_MAX) { 2230 + delay->value = DIV_ROUND_UP(value, 1000); 2231 + delay->unit = SPI_DELAY_UNIT_USECS; 2232 + } else { 2233 + delay->value = value; 2234 + delay->unit = SPI_DELAY_UNIT_NSECS; 2235 + } 2236 + } 2237 + } 2238 + 2223 2239 static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi, 2224 2240 struct device_node *nc) 2225 2241 { 2226 2242 u32 value; 2227 - u16 cs_setup; 2228 2243 int rc; 2229 2244 2230 2245 /* Mode (clock phase/polarity/etc.) */ ··· 2325 2310 if (!of_property_read_u32(nc, "spi-max-frequency", &value)) 2326 2311 spi->max_speed_hz = value; 2327 2312 2328 - if (!of_property_read_u16(nc, "spi-cs-setup-delay-ns", &cs_setup)) { 2329 - spi->cs_setup.value = cs_setup; 2330 - spi->cs_setup.unit = SPI_DELAY_UNIT_NSECS; 2331 - } 2313 + /* Device CS delays */ 2314 + of_spi_parse_dt_cs_delay(nc, &spi->cs_setup, "spi-cs-setup-delay-ns"); 2332 2315 2333 2316 return 0; 2334 2317 }