summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-03-13 11:07:37 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2024-03-13 11:07:37 -0700
commit6cdebf62a159f31351946685b02941c968b96e49 (patch)
tree06aa5c4552b7991b5cdde855cdf6b9a8892372ba /drivers/staging
parent21ac5a96513c6588c9a71bffa16d665675930a60 (diff)
parentbe84be4a35fa99cca7e81e6dd21516a324cca413 (diff)
Merge tag 'spi-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi updates from Mark Brown: "This release sees some exciting changes from David Lechner which implements some optimisations that have been talked about for a long time which allows client drivers to pre-prepare SPI messages for repeated or low latency use. This lets us move work out of latency sensitive paths and avoid repeating work for frequently performed operations. As well as being useful in itself this will also be used in future to allow controllers to directly trigger SPI operations (eg, from interrupts). Otherwise this release has mostly been focused on cleanups, plus a couple of new devices: - Support for pre-optimising messages - A big set of updates from Uwe Kleine-König moving drivers to use APIs with more modern terminology for controllers - Major overhaul of the s3c64xx driver - Support for Google GS101 and Samsung Exynos850" * tag 'spi-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (122 commits) spi: Introduce SPI_INVALID_CS and is_valid_cs() spi: Fix types of the last chip select storage variables spi: Consistently use BIT for cs_index_mask spi: Exctract spi_dev_check_cs() helper spi: Exctract spi_set_all_cs_unused() helper spi: s3c64xx: switch exynos850 to new port config data spi: s3c64xx: switch gs101 to new port config data spi: s3c64xx: deprecate fifo_lvl_mask, rx_lvl_offset and port_id spi: s3c64xx: get rid of the OF alias ID dependency spi: s3c64xx: introduce s3c64xx_spi_set_port_id() spi: s3c64xx: let the SPI core determine the bus number spi: s3c64xx: allow FIFO depth to be determined from the compatible spi: s3c64xx: retrieve the FIFO depth from the device tree spi: s3c64xx: determine the fifo depth only once spi: s3c64xx: allow full FIFO masks spi: s3c64xx: define a magic value spi: dt-bindings: introduce FIFO depth properties spi: axi-spi-engine: use struct_size() macro spi: axi-spi-engine: use __counted_by() attribute spi: axi-spi-engine: remove p from struct spi_engine_message_state ...
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/fbtft/fbtft-core.c4
-rw-r--r--drivers/staging/greybus/spilib.c66
2 files changed, 35 insertions, 35 deletions
diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
index 3626f429b002..68add4d598ae 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -794,7 +794,7 @@ int fbtft_register_framebuffer(struct fb_info *fb_info)
if (par->txbuf.buf && par->txbuf.len >= 1024)
sprintf(text1, ", %zu KiB buffer memory", par->txbuf.len >> 10);
if (spi)
- sprintf(text2, ", spi%d.%d at %d MHz", spi->master->bus_num,
+ sprintf(text2, ", spi%d.%d at %d MHz", spi->controller->bus_num,
spi_get_chipselect(spi, 0), spi->max_speed_hz / 1000000);
dev_info(fb_info->dev,
"%s frame buffer, %dx%d, %d KiB video memory%s, fps=%lu%s\n",
@@ -1215,7 +1215,7 @@ int fbtft_probe_common(struct fbtft_display *display,
/* 9-bit SPI setup */
if (par->spi && display->buswidth == 9) {
- if (par->spi->master->bits_per_word_mask & SPI_BPW_MASK(9)) {
+ if (par->spi->controller->bits_per_word_mask & SPI_BPW_MASK(9)) {
par->spi->bits_per_word = 9;
} else {
dev_warn(&par->spi->dev,
diff --git a/drivers/staging/greybus/spilib.c b/drivers/staging/greybus/spilib.c
index efb3bec58e15..34f10685139f 100644
--- a/drivers/staging/greybus/spilib.c
+++ b/drivers/staging/greybus/spilib.c
@@ -42,7 +42,7 @@ struct gb_spilib {
#define XFER_TIMEOUT_TOLERANCE 200
-static struct spi_master *get_master_from_spi(struct gb_spilib *spi)
+static struct spi_controller *get_controller_from_spi(struct gb_spilib *spi)
{
return gb_connection_get_data(spi->connection);
}
@@ -324,10 +324,10 @@ static void gb_spi_decode_response(struct gb_spilib *spi,
}
}
-static int gb_spi_transfer_one_message(struct spi_master *master,
+static int gb_spi_transfer_one_message(struct spi_controller *ctlr,
struct spi_message *msg)
{
- struct gb_spilib *spi = spi_master_get_devdata(master);
+ struct gb_spilib *spi = spi_controller_get_devdata(ctlr);
struct gb_connection *connection = spi->connection;
struct gb_spi_transfer_response *response;
struct gb_operation *operation;
@@ -371,21 +371,21 @@ static int gb_spi_transfer_one_message(struct spi_master *master,
out:
msg->status = ret;
clean_xfer_state(spi);
- spi_finalize_current_message(master);
+ spi_finalize_current_message(ctlr);
return ret;
}
-static int gb_spi_prepare_transfer_hardware(struct spi_master *master)
+static int gb_spi_prepare_transfer_hardware(struct spi_controller *ctlr)
{
- struct gb_spilib *spi = spi_master_get_devdata(master);
+ struct gb_spilib *spi = spi_controller_get_devdata(ctlr);
return spi->ops->prepare_transfer_hardware(spi->parent);
}
-static int gb_spi_unprepare_transfer_hardware(struct spi_master *master)
+static int gb_spi_unprepare_transfer_hardware(struct spi_controller *ctlr)
{
- struct gb_spilib *spi = spi_master_get_devdata(master);
+ struct gb_spilib *spi = spi_controller_get_devdata(ctlr);
spi->ops->unprepare_transfer_hardware(spi->parent);
@@ -440,7 +440,7 @@ static int gb_spi_get_master_config(struct gb_spilib *spi)
static int gb_spi_setup_device(struct gb_spilib *spi, u8 cs)
{
- struct spi_master *master = get_master_from_spi(spi);
+ struct spi_controller *ctlr = get_controller_from_spi(spi);
struct gb_spi_device_config_request request;
struct gb_spi_device_config_response response;
struct spi_board_info spi_board = { {0} };
@@ -471,11 +471,11 @@ static int gb_spi_setup_device(struct gb_spilib *spi, u8 cs)
return -EINVAL;
spi_board.mode = le16_to_cpu(response.mode);
- spi_board.bus_num = master->bus_num;
+ spi_board.bus_num = ctlr->bus_num;
spi_board.chip_select = cs;
spi_board.max_speed_hz = le32_to_cpu(response.max_speed_hz);
- spidev = spi_new_device(master, &spi_board);
+ spidev = spi_new_device(ctlr, &spi_board);
if (!spidev)
return -EINVAL;
@@ -486,52 +486,52 @@ int gb_spilib_master_init(struct gb_connection *connection, struct device *dev,
struct spilib_ops *ops)
{
struct gb_spilib *spi;
- struct spi_master *master;
+ struct spi_controller *ctlr;
int ret;
u8 i;
/* Allocate master with space for data */
- master = spi_alloc_master(dev, sizeof(*spi));
- if (!master) {
+ ctlr = spi_alloc_master(dev, sizeof(*spi));
+ if (!ctlr) {
dev_err(dev, "cannot alloc SPI master\n");
return -ENOMEM;
}
- spi = spi_master_get_devdata(master);
+ spi = spi_controller_get_devdata(ctlr);
spi->connection = connection;
- gb_connection_set_data(connection, master);
+ gb_connection_set_data(connection, ctlr);
spi->parent = dev;
spi->ops = ops;
- /* get master configuration */
+ /* get controller configuration */
ret = gb_spi_get_master_config(spi);
if (ret)
goto exit_spi_put;
- master->bus_num = -1; /* Allow spi-core to allocate it dynamically */
- master->num_chipselect = spi->num_chipselect;
- master->mode_bits = spi->mode;
- master->flags = spi->flags;
- master->bits_per_word_mask = spi->bits_per_word_mask;
+ ctlr->bus_num = -1; /* Allow spi-core to allocate it dynamically */
+ ctlr->num_chipselect = spi->num_chipselect;
+ ctlr->mode_bits = spi->mode;
+ ctlr->flags = spi->flags;
+ ctlr->bits_per_word_mask = spi->bits_per_word_mask;
/* Attach methods */
- master->cleanup = gb_spi_cleanup;
- master->setup = gb_spi_setup;
- master->transfer_one_message = gb_spi_transfer_one_message;
+ ctlr->cleanup = gb_spi_cleanup;
+ ctlr->setup = gb_spi_setup;
+ ctlr->transfer_one_message = gb_spi_transfer_one_message;
if (ops && ops->prepare_transfer_hardware) {
- master->prepare_transfer_hardware =
+ ctlr->prepare_transfer_hardware =
gb_spi_prepare_transfer_hardware;
}
if (ops && ops->unprepare_transfer_hardware) {
- master->unprepare_transfer_hardware =
+ ctlr->unprepare_transfer_hardware =
gb_spi_unprepare_transfer_hardware;
}
- master->auto_runtime_pm = true;
+ ctlr->auto_runtime_pm = true;
- ret = spi_register_master(master);
+ ret = spi_register_controller(ctlr);
if (ret < 0)
goto exit_spi_put;
@@ -548,12 +548,12 @@ int gb_spilib_master_init(struct gb_connection *connection, struct device *dev,
return 0;
exit_spi_put:
- spi_master_put(master);
+ spi_controller_put(ctlr);
return ret;
exit_spi_unregister:
- spi_unregister_master(master);
+ spi_unregister_controller(ctlr);
return ret;
}
@@ -561,9 +561,9 @@ EXPORT_SYMBOL_GPL(gb_spilib_master_init);
void gb_spilib_master_exit(struct gb_connection *connection)
{
- struct spi_master *master = gb_connection_get_data(connection);
+ struct spi_controller *ctlr = gb_connection_get_data(connection);
- spi_unregister_master(master);
+ spi_unregister_controller(ctlr);
}
EXPORT_SYMBOL_GPL(gb_spilib_master_exit);