mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:04:41 +01:00
spi: geni-qcom: Add target abort support
SPI target mode currently lacks a mechanism to gracefully abort ongoing transfers when the client or core needs to cancel active transactions. Implement spi_geni_target_abort() to handle aborting SPI target operations when the client and core want to cancel ongoing transfers. This provides a mechanism for graceful termination of active SPI transactions in target mode. Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://patch.msgid.link/20260204162854.1206323-5-praveen.talari@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
9934383f98
commit
6516169fa7
1 changed files with 14 additions and 0 deletions
|
|
@ -1003,6 +1003,17 @@ static irqreturn_t geni_spi_isr(int irq, void *data)
|
|||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static int spi_geni_target_abort(struct spi_controller *spi)
|
||||
{
|
||||
if (!spi->cur_msg)
|
||||
return 0;
|
||||
|
||||
handle_se_timeout(spi);
|
||||
spi_finalize_current_transfer(spi);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int spi_geni_probe(struct platform_device *pdev)
|
||||
{
|
||||
int ret, irq;
|
||||
|
|
@ -1076,6 +1087,9 @@ static int spi_geni_probe(struct platform_device *pdev)
|
|||
init_completion(&mas->rx_reset_done);
|
||||
spin_lock_init(&mas->lock);
|
||||
|
||||
if (spi->target)
|
||||
spi->target_abort = spi_geni_target_abort;
|
||||
|
||||
ret = geni_icc_get(&mas->se, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue