kernel-brax3-ubuntu-touch/drivers/misc/mediatek/apusys/mdla/common/mdla_cmd_proc.h
erascape f319b992b1 kernel-5.15: Initial import brax3 UT kernel
* halium configs enabled

Signed-off-by: erascape <erascape@proton.me>
2025-09-23 15:17:10 +00:00

56 lines
1.6 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2019 MediaTek Inc.
*/
#ifndef __MDLA_CMD_PROC_H__
#define __MDLA_CMD_PROC_H__
#include <common/mdla_device.h>
struct apusys_cmd_handle;
typedef int (*run_sync_t)(struct mdla_run_cmd_sync *cmd_data,
struct mdla_dev *mdla_info,
struct apusys_cmd_handle *apusys_hd,
uint32_t priority);
typedef int (*ut_run_sync_t)(void *run_cmd, void *wait_cmd,
struct mdla_dev *mdla_info);
/* command operations */
struct mdla_cmd_ops {
run_sync_t run_sync;
ut_run_sync_t ut_run_sync;
void (*lock)(struct mdla_dev *mdla_device);
void (*unlock)(struct mdla_dev *mdla_device);
void (*list_lock)(struct mdla_dev *mdla_device);
void (*list_unlock)(struct mdla_dev *mdla_device);
};
const struct mdla_cmd_ops *mdla_cmd_ops_get(void);
void mdla_cmd_setup(run_sync_t sync, ut_run_sync_t ut_sync);
/* platform callback functions */
struct mdla_cmd_cb_func {
int (*pre_cmd_handle)(u32 core_id, struct command_entry *ce);
void (*pre_cmd_info)(u32 core_id);
int (*process_command)(u32 core_id, struct command_entry *ce);
int (*process_command_no_lock)(u32 core_id, struct command_entry *ce);
int (*post_cmd_handle)(u32 core_id, struct command_entry *ce);
void (*post_cmd_info)(u32 core_id);
int (*wait_cmd_handle)(u32 core_id, struct command_entry *ce);
unsigned long (*get_wait_time)(u32 core_id);
int (*get_irq_num)(u32 core_id);
/* HW error handing */
int (*wait_cmd_hw_detect)(u32 core_id);
int (*post_cmd_hw_detect)(u32 core_id);
};
struct mdla_cmd_cb_func *mdla_cmd_plat_cb(void);
#endif /* __MDLA_CMD_PROC_H__ */