summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-05 15:26:03 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-05 15:26:03 +0300
commit72674e86b6fe2f656c93564635b675bcdf012844 (patch)
tree39234969ad4fb5816732f2e33f75ce87c9f94803 /drivers/spi
parente67adaa1754d5383583c35a703518507e457482b (diff)
parent4f45f3404960109843eaa92c8a4a850d6bdd9981 (diff)
downloadlinux-72674e86b6fe2f656c93564635b675bcdf012844.tar.xz
Merge tag 'fpga-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga into char-misc-next
Moritz writes: FPGA Manager changes for 5.15-rc1 FPGA Manager - Colin's change is a simple spelling cleanup. DFL - Martin's fist change exposes DFL feature revision to client drivers - Martin's second change modifies a SPI driver to populate different spi_board_info modaliases based on the DFL feature revision All patches have been reviewed on the mailing list, and have been in the last few linux-next releases (as part of my for-next branch) without issues. Signed-off-by: Moritz Fischer <mdf@kernel.org> * tag 'fpga-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga: spi: spi-altera-dfl: support n5010 feature revision fpga: dfl: expose feature revision from struct dfl_device fpga: Fix spelling mistake "eXchnage" -> "exchange" in Kconfig
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-altera-dfl.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/spi/spi-altera-dfl.c b/drivers/spi/spi-altera-dfl.c
index 39a3e1a032e0..44fc9ee13fc7 100644
--- a/drivers/spi/spi-altera-dfl.c
+++ b/drivers/spi/spi-altera-dfl.c
@@ -104,13 +104,6 @@ static const struct regmap_config indirect_regbus_cfg = {
.reg_read = indirect_bus_reg_read,
};
-static struct spi_board_info m10_bmc_info = {
- .modalias = "m10-d5005",
- .max_speed_hz = 12500000,
- .bus_num = 0,
- .chip_select = 0,
-};
-
static void config_spi_master(void __iomem *base, struct spi_master *master)
{
u64 v;
@@ -130,6 +123,7 @@ static void config_spi_master(void __iomem *base, struct spi_master *master)
static int dfl_spi_altera_probe(struct dfl_device *dfl_dev)
{
+ struct spi_board_info board_info = { 0 };
struct device *dev = &dfl_dev->dev;
struct spi_master *master;
struct altera_spi *hw;
@@ -170,9 +164,18 @@ static int dfl_spi_altera_probe(struct dfl_device *dfl_dev)
goto exit;
}
- if (!spi_new_device(master, &m10_bmc_info)) {
+ if (dfl_dev->revision == FME_FEATURE_REV_MAX10_SPI_N5010)
+ strscpy(board_info.modalias, "m10-n5010", SPI_NAME_SIZE);
+ else
+ strscpy(board_info.modalias, "m10-d5005", SPI_NAME_SIZE);
+
+ board_info.max_speed_hz = 12500000;
+ board_info.bus_num = 0;
+ board_info.chip_select = 0;
+
+ if (!spi_new_device(master, &board_info)) {
dev_err(dev, "%s failed to create SPI device: %s\n",
- __func__, m10_bmc_info.modalias);
+ __func__, board_info.modalias);
}
return 0;