[PATCH 19/29] crypto: talitos - Introduce struct talitos_ops

From: Paul Louvel

Date: Thu May 28 2026 - 05:17:45 EST


Add struct talitos_ops containing function pointers for IRQ probing,
tasklet initialization, device and channel reset, device configuration,
descriptor DMA mapping, request header retrieval and error handling.

Add an ops pointer to struct talitos_private. The ops pointer will be
initialized at probe time based on the detected hardware and used to
dispatch SEC1/SEC2-specific behaviour.


Signed-off-by: Paul Louvel <paul.louvel@xxxxxxxxxxx>
---
drivers/crypto/talitos/talitos.h | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

diff --git a/drivers/crypto/talitos/talitos.h b/drivers/crypto/talitos/talitos.h
index 904fdc9dec80..46de1bf1ef27 100644
--- a/drivers/crypto/talitos/talitos.h
+++ b/drivers/crypto/talitos/talitos.h
@@ -14,6 +14,7 @@
#include <linux/dma-mapping.h>
#include <linux/hw_random.h>
#include <linux/interrupt.h>
+#include <linux/platform_device.h>
#include <linux/scatterlist.h>
#include <linux/types.h>

@@ -139,6 +140,25 @@ struct talitos_channel {
int tail;
};

+struct talitos_ops {
+ int (*probe_irq)(struct platform_device *ofdev);
+ void (*init_task)(struct device *dev);
+ int (*reset_device)(struct device *dev);
+ int (*reset_channel)(struct device *dev, int ch);
+ void (*configure_device)(struct device *dev);
+
+ void (*dma_map_request)(struct device *dev,
+ struct talitos_request *request,
+ struct talitos_desc *desc);
+ void (*dma_unmap_request)(struct device *dev,
+ struct talitos_request *request);
+ __be32 (*get_request_hdr)(struct device *dev,
+ struct talitos_request *request);
+ __be32 (*search_desc_hdr_in_request)(struct talitos_request *request,
+ dma_addr_t cpdr);
+ int (*handle_error)(struct device *dev, u32 isr, u32 isr_lo);
+};
+
struct talitos_private {
struct device *dev;
struct platform_device *ofdev;
@@ -162,6 +182,8 @@ struct talitos_private {
unsigned int exec_units;
unsigned int desc_types;

+ const struct talitos_ops *ops;
+
/* SEC Compatibility info */
unsigned long features;


--
2.54.0