[PATCH v3 2/2] mailbox: pcc: add peek_data handler

From: Andrea Tomassetti
Date: Tue Dec 02 2025 - 05:13:27 EST


peek_data is mapped to pcc_mbox_error_check_and_clear, so that it
returns true if no error occurred while the platform processed last
message, and therefore clients can fetch response data provided by the
platform.

Tested-by: Thibault Cantori <thibault.cantori@xxxxxxxxxxx>
Co-developed-by: Olivier Dautricourt <olivier.dautricourt@xxxxxxxxxxx>
Signed-off-by: Olivier Dautricourt <olivier.dautricourt@xxxxxxxxxxx>
Signed-off-by: Andrea Tomassetti <andrea.tomassetti@xxxxxxxxxxx>
---
drivers/mailbox/pcc.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
index 418007020439..ccd50b33409b 100644
--- a/drivers/mailbox/pcc.c
+++ b/drivers/mailbox/pcc.c
@@ -502,11 +502,17 @@ static void pcc_shutdown(struct mbox_chan *chan)
devm_free_irq(chan->mbox->dev, pchan->plat_irq, chan);
}

+static bool pcc_peek_data(struct mbox_chan *chan)
+{
+ return pcc_mbox_error_check_and_clear(chan->con_priv) == 0;
+}
+
static const struct mbox_chan_ops pcc_chan_ops = {
.send_data = pcc_send_data,
.startup = pcc_startup,
.shutdown = pcc_shutdown,
.last_tx_done = pcc_last_tx_done,
+ .peek_data = pcc_peek_data,
};

/**
--
2.51.2