mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-06 05:02:31 +00:00
Merge branch 'qca_spi-fix-spi-specific-issues'
Stefan Wahren says: ==================== qca_spi: Fix SPI specific issues This small series address two annoying SPI specific issues of the qca_spi driver. ==================== Link: https://patch.msgid.link/20241206184643.123399-1-wahrenst@gmx.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
f136552b7c
@ -54,7 +54,7 @@ MODULE_PARM_DESC(qcaspi_burst_len, "Number of data bytes per burst. Use 1-5000."
|
|||||||
|
|
||||||
#define QCASPI_PLUGGABLE_MIN 0
|
#define QCASPI_PLUGGABLE_MIN 0
|
||||||
#define QCASPI_PLUGGABLE_MAX 1
|
#define QCASPI_PLUGGABLE_MAX 1
|
||||||
static int qcaspi_pluggable = QCASPI_PLUGGABLE_MIN;
|
static int qcaspi_pluggable = QCASPI_PLUGGABLE_MAX;
|
||||||
module_param(qcaspi_pluggable, int, 0);
|
module_param(qcaspi_pluggable, int, 0);
|
||||||
MODULE_PARM_DESC(qcaspi_pluggable, "Pluggable SPI connection (yes/no).");
|
MODULE_PARM_DESC(qcaspi_pluggable, "Pluggable SPI connection (yes/no).");
|
||||||
|
|
||||||
@ -818,7 +818,6 @@ qcaspi_netdev_init(struct net_device *dev)
|
|||||||
|
|
||||||
dev->mtu = QCAFRM_MAX_MTU;
|
dev->mtu = QCAFRM_MAX_MTU;
|
||||||
dev->type = ARPHRD_ETHER;
|
dev->type = ARPHRD_ETHER;
|
||||||
qca->clkspeed = qcaspi_clkspeed;
|
|
||||||
qca->burst_len = qcaspi_burst_len;
|
qca->burst_len = qcaspi_burst_len;
|
||||||
qca->spi_thread = NULL;
|
qca->spi_thread = NULL;
|
||||||
qca->buffer_size = (QCAFRM_MAX_MTU + VLAN_ETH_HLEN + QCAFRM_HEADER_LEN +
|
qca->buffer_size = (QCAFRM_MAX_MTU + VLAN_ETH_HLEN + QCAFRM_HEADER_LEN +
|
||||||
@ -909,17 +908,15 @@ qca_spi_probe(struct spi_device *spi)
|
|||||||
legacy_mode = of_property_read_bool(spi->dev.of_node,
|
legacy_mode = of_property_read_bool(spi->dev.of_node,
|
||||||
"qca,legacy-mode");
|
"qca,legacy-mode");
|
||||||
|
|
||||||
if (qcaspi_clkspeed == 0) {
|
if (qcaspi_clkspeed)
|
||||||
if (spi->max_speed_hz)
|
spi->max_speed_hz = qcaspi_clkspeed;
|
||||||
qcaspi_clkspeed = spi->max_speed_hz;
|
else if (!spi->max_speed_hz)
|
||||||
else
|
spi->max_speed_hz = QCASPI_CLK_SPEED;
|
||||||
qcaspi_clkspeed = QCASPI_CLK_SPEED;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((qcaspi_clkspeed < QCASPI_CLK_SPEED_MIN) ||
|
if (spi->max_speed_hz < QCASPI_CLK_SPEED_MIN ||
|
||||||
(qcaspi_clkspeed > QCASPI_CLK_SPEED_MAX)) {
|
spi->max_speed_hz > QCASPI_CLK_SPEED_MAX) {
|
||||||
dev_err(&spi->dev, "Invalid clkspeed: %d\n",
|
dev_err(&spi->dev, "Invalid clkspeed: %u\n",
|
||||||
qcaspi_clkspeed);
|
spi->max_speed_hz);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -944,14 +941,13 @@ qca_spi_probe(struct spi_device *spi)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev_info(&spi->dev, "ver=%s, clkspeed=%d, burst_len=%d, pluggable=%d\n",
|
dev_info(&spi->dev, "ver=%s, clkspeed=%u, burst_len=%d, pluggable=%d\n",
|
||||||
QCASPI_DRV_VERSION,
|
QCASPI_DRV_VERSION,
|
||||||
qcaspi_clkspeed,
|
spi->max_speed_hz,
|
||||||
qcaspi_burst_len,
|
qcaspi_burst_len,
|
||||||
qcaspi_pluggable);
|
qcaspi_pluggable);
|
||||||
|
|
||||||
spi->mode = SPI_MODE_3;
|
spi->mode = SPI_MODE_3;
|
||||||
spi->max_speed_hz = qcaspi_clkspeed;
|
|
||||||
if (spi_setup(spi) < 0) {
|
if (spi_setup(spi) < 0) {
|
||||||
dev_err(&spi->dev, "Unable to setup SPI device\n");
|
dev_err(&spi->dev, "Unable to setup SPI device\n");
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
@ -89,7 +89,6 @@ struct qcaspi {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* user configurable options */
|
/* user configurable options */
|
||||||
u32 clkspeed;
|
|
||||||
u8 legacy_mode;
|
u8 legacy_mode;
|
||||||
u16 burst_len;
|
u16 burst_len;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user