Skip to content

Commit f953599

Browse files
committed
Merge tag 'spi-fix-v6.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi fixes from Mark Brown: "A few small driver specific fixes (including some of the widespread work on fixing missing ID tables for module autoloading and the revert of some problematic PM work in spi-rockchip), some improvements to the MAINTAINERS information for the NXP drivers and the addition of a new device ID to spidev" * tag 'spi-fix-v6.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: MAINTAINERS: SPI: Add mailing list [email protected] for nxp spi drivers MAINTAINERS: SPI: Add freescale lpspi maintainer information spi: spi-fsl-lpspi: Fix off-by-one in prescale max spi: spidev: Add missing spi_device_id for jg10309-01 spi: bcm63xx: Enable module autoloading spi: intel: Add check devm_kasprintf() returned value spi: spidev: Add an entry for elgin,jg10309-01 spi: rockchip: Resolve unbalanced runtime PM / system PM handling
2 parents 2a66044 + c9ca76e commit f953599

File tree

6 files changed

+26
-18
lines changed

6 files changed

+26
-18
lines changed

MAINTAINERS

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8864,6 +8864,7 @@ F: drivers/dma/fsldma.*
88648864
FREESCALE DSPI DRIVER
88658865
M: Vladimir Oltean <[email protected]>
88668866
8867+
88678868
S: Maintained
88688869
F: Documentation/devicetree/bindings/spi/fsl,dspi*.yaml
88698870
F: drivers/spi/spi-fsl-dspi.c
@@ -8948,6 +8949,14 @@ S: Maintained
89488949
F: Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.yaml
89498950
F: drivers/i2c/busses/i2c-imx-lpi2c.c
89508951

8952+
FREESCALE IMX LPSPI DRIVER
8953+
M: Frank Li <[email protected]>
8954+
8955+
8956+
S: Maintained
8957+
F: Documentation/devicetree/bindings/spi/spi-fsl-lpspi.yaml
8958+
F: drivers/spi/spi-fsl-lpspi.c
8959+
89518960
FREESCALE MPC I2C DRIVER
89528961
M: Chris Packham <[email protected]>
89538962
@@ -8984,6 +8993,7 @@ F: include/linux/fsl/ptp_qoriq.h
89848993
FREESCALE QUAD SPI DRIVER
89858994
M: Han Xu <[email protected]>
89868995
8996+
89878997
S: Maintained
89888998
F: Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
89898999
F: drivers/spi/spi-fsl-qspi.c
@@ -16408,6 +16418,7 @@ M: Han Xu <[email protected]>
1640816418
M: Haibo Chen <[email protected]>
1640916419
R: Yogesh Gaur <[email protected]>
1641016420
16421+
1641116422
S: Maintained
1641216423
F: Documentation/devicetree/bindings/spi/spi-nxp-fspi.yaml
1641316424
F: drivers/spi/spi-nxp-fspi.c

drivers/spi/spi-bcm63xx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ static const struct of_device_id bcm63xx_spi_of_match[] = {
472472
{ .compatible = "brcm,bcm6358-spi", .data = &bcm6358_spi_reg_offsets },
473473
{ },
474474
};
475+
MODULE_DEVICE_TABLE(of, bcm63xx_spi_of_match);
475476

476477
static int bcm63xx_spi_probe(struct platform_device *pdev)
477478
{

drivers/spi/spi-fsl-lpspi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static struct fsl_lpspi_devtype_data imx93_lpspi_devtype_data = {
136136
};
137137

138138
static struct fsl_lpspi_devtype_data imx7ulp_lpspi_devtype_data = {
139-
.prescale_max = 8,
139+
.prescale_max = 7,
140140
};
141141

142142
static const struct of_device_id fsl_lpspi_dt_ids[] = {
@@ -336,7 +336,7 @@ static int fsl_lpspi_set_bitrate(struct fsl_lpspi_data *fsl_lpspi)
336336

337337
div = DIV_ROUND_UP(perclk_rate, config.speed_hz);
338338

339-
for (prescale = 0; prescale < prescale_max; prescale++) {
339+
for (prescale = 0; prescale <= prescale_max; prescale++) {
340340
scldiv = div / (1 << prescale) - 2;
341341
if (scldiv < 256) {
342342
fsl_lpspi->config.prescale = prescale;

drivers/spi/spi-intel.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,9 @@ static int intel_spi_populate_chip(struct intel_spi *ispi)
13901390

13911391
pdata->name = devm_kasprintf(ispi->dev, GFP_KERNEL, "%s-chip1",
13921392
dev_name(ispi->dev));
1393+
if (!pdata->name)
1394+
return -ENOMEM;
1395+
13931396
pdata->nr_parts = 1;
13941397
parts = devm_kcalloc(ispi->dev, pdata->nr_parts, sizeof(*parts),
13951398
GFP_KERNEL);

drivers/spi/spi-rockchip.c

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -945,14 +945,16 @@ static int rockchip_spi_suspend(struct device *dev)
945945
{
946946
int ret;
947947
struct spi_controller *ctlr = dev_get_drvdata(dev);
948-
struct rockchip_spi *rs = spi_controller_get_devdata(ctlr);
949948

950949
ret = spi_controller_suspend(ctlr);
951950
if (ret < 0)
952951
return ret;
953952

954-
clk_disable_unprepare(rs->spiclk);
955-
clk_disable_unprepare(rs->apb_pclk);
953+
ret = pm_runtime_force_suspend(dev);
954+
if (ret < 0) {
955+
spi_controller_resume(ctlr);
956+
return ret;
957+
}
956958

957959
pinctrl_pm_select_sleep_state(dev);
958960

@@ -963,25 +965,14 @@ static int rockchip_spi_resume(struct device *dev)
963965
{
964966
int ret;
965967
struct spi_controller *ctlr = dev_get_drvdata(dev);
966-
struct rockchip_spi *rs = spi_controller_get_devdata(ctlr);
967968

968969
pinctrl_pm_select_default_state(dev);
969970

970-
ret = clk_prepare_enable(rs->apb_pclk);
971+
ret = pm_runtime_force_resume(dev);
971972
if (ret < 0)
972973
return ret;
973974

974-
ret = clk_prepare_enable(rs->spiclk);
975-
if (ret < 0)
976-
clk_disable_unprepare(rs->apb_pclk);
977-
978-
ret = spi_controller_resume(ctlr);
979-
if (ret < 0) {
980-
clk_disable_unprepare(rs->spiclk);
981-
clk_disable_unprepare(rs->apb_pclk);
982-
}
983-
984-
return 0;
975+
return spi_controller_resume(ctlr);
985976
}
986977
#endif /* CONFIG_PM_SLEEP */
987978

drivers/spi/spidev.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ static const struct class spidev_class = {
702702
static const struct spi_device_id spidev_spi_ids[] = {
703703
{ .name = "bh2228fv" },
704704
{ .name = "dh2228fv" },
705+
{ .name = "jg10309-01" },
705706
{ .name = "ltc2488" },
706707
{ .name = "sx1301" },
707708
{ .name = "bk4" },
@@ -731,6 +732,7 @@ static int spidev_of_check(struct device *dev)
731732
static const struct of_device_id spidev_dt_ids[] = {
732733
{ .compatible = "cisco,spi-petra", .data = &spidev_of_check },
733734
{ .compatible = "dh,dhcom-board", .data = &spidev_of_check },
735+
{ .compatible = "elgin,jg10309-01", .data = &spidev_of_check },
734736
{ .compatible = "lineartechnology,ltc2488", .data = &spidev_of_check },
735737
{ .compatible = "lwn,bk4", .data = &spidev_of_check },
736738
{ .compatible = "menlo,m53cpld", .data = &spidev_of_check },

0 commit comments

Comments
 (0)