diff options
| author | Benoît Monin <benoit.monin@bootlin.com> | 2025-10-02 14:14:38 +0200 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2025-10-13 11:27:36 +0100 |
| commit | fe8cc44dd173cde5788ab4e3730ac61f3d316d9c (patch) | |
| tree | 445844c8952cfcb11a85a8011b3cf817490bea00 /scripts/gdb/linux/xarray.py | |
| parent | b926b15547d29a88932de3c24a05c12826fc1dbc (diff) | |
spi: dw: add target mode support
Implement target mode for the DesignWare controller with the following
changes:
Allocate an SPI controller of the correct type based on the spi-slave
property in dw_spi_add_controller() and set the controller properties
depending on its type. Since they are only relevant when acting as a host
controller, settings related to chip-select control and the set_cs()
callback are only set in host mode, as are the loopback support, the
memory operations and the maximum frequency. The target_abort() callback
is set only when configured in target mode.
The number of chip-select is set to 1 in dw_spi_hw_init() since the
controller only has one CS input in target mode.
In dw_spi_update_config(), return after setting the CTRLR0 register as
the other registers are only relevant in host mode and are read-only
in target mode. This function is called as part of the transfer_one()
callback, which is identical in both the host and target mode.
Move the code implementing the handle_err() callback to a new function
named dw_spi_abort(), and use it to implement both the handle_err()
and the target_abort() callbacks.
Finally, drop the error path on the spi-slave property in
dw_spi_mmio_probe(), as it is now a valid configuration.
Signed-off-by: Benoît Monin <benoit.monin@bootlin.com>
Link: https://patch.msgid.link/20251002-spi-dw-target-v1-2-993e91c1a712@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'scripts/gdb/linux/xarray.py')
0 files changed, 0 insertions, 0 deletions
