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-fix-v6.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
"A few SPI fixes: clock rate calculation fixes for the Kunpeng and lpsi
drivers and a missing registration of a device ID for spidev (which
had only been updated for DT cases, causing warnings)"

* tag 'spi-fix-v6.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
spi: spi-fsl-lpspi: Fix scldiv calculation
spi: spidev: Add missing spi_device_id for bh2228fv
spi: hisi-kunpeng: Add verification for the max_frequency provided by the firmware
spi: hisi-kunpeng: Add validation for the minimum value of speed_hz

+9 -2
+4 -2
drivers/spi/spi-fsl-lpspi.c
··· 296 296 static int fsl_lpspi_set_bitrate(struct fsl_lpspi_data *fsl_lpspi) 297 297 { 298 298 struct lpspi_config config = fsl_lpspi->config; 299 - unsigned int perclk_rate, scldiv; 299 + unsigned int perclk_rate, scldiv, div; 300 300 u8 prescale; 301 301 302 302 perclk_rate = clk_get_rate(fsl_lpspi->clk_per); ··· 313 313 return -EINVAL; 314 314 } 315 315 316 + div = DIV_ROUND_UP(perclk_rate, config.speed_hz); 317 + 316 318 for (prescale = 0; prescale < 8; prescale++) { 317 - scldiv = perclk_rate / config.speed_hz / (1 << prescale) - 2; 319 + scldiv = div / (1 << prescale) - 2; 318 320 if (scldiv < 256) { 319 321 fsl_lpspi->config.prescale = prescale; 320 322 break;
+4
drivers/spi/spi-hisi-kunpeng.c
··· 481 481 return -EINVAL; 482 482 } 483 483 484 + if (host->max_speed_hz == 0) 485 + return dev_err_probe(dev, -EINVAL, "spi-max-frequency can't be 0\n"); 486 + 484 487 ret = device_property_read_u16(dev, "num-cs", 485 488 &host->num_chipselect); 486 489 if (ret) ··· 498 495 host->transfer_one = hisi_spi_transfer_one; 499 496 host->handle_err = hisi_spi_handle_err; 500 497 host->dev.fwnode = dev->fwnode; 498 + host->min_speed_hz = DIV_ROUND_UP(host->max_speed_hz, CLK_DIV_MAX); 501 499 502 500 hisi_spi_hw_init(hs); 503 501
+1
drivers/spi/spidev.c
··· 700 700 }; 701 701 702 702 static const struct spi_device_id spidev_spi_ids[] = { 703 + { .name = "bh2228fv" }, 703 704 { .name = "dh2228fv" }, 704 705 { .name = "ltc2488" }, 705 706 { .name = "sx1301" },