You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.3 KiB
54 lines
1.3 KiB
/*
|
|
* Copyright (c) Hisilicon Technologies Co., Ltd. 2013-2020. All rights reserved.
|
|
* Description: osal interface
|
|
* Author: Hisilicon
|
|
* Create: 2013-07-25
|
|
*/
|
|
#include "drv_osal_ext.h"
|
|
#include "soc_log.h"
|
|
#include <linux/string.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/module.h>
|
|
|
|
#include "td_type.h"
|
|
#include "drv_sys_ext.h"
|
|
#include "osal_ext.h"
|
|
|
|
td_s32 ext_drv_osal_request_irq(td_u32 irq, irq_handler_t handler, td_ulong flags, const td_char *name, td_void *dev)
|
|
{
|
|
td_s32 reserved_irq;
|
|
td_s32 ret;
|
|
td_ulong reserved_flags = flags;
|
|
|
|
TD_UNUSED(irq);
|
|
reserved_irq = osal_get_irq_by_name((td_char *)name);
|
|
if (reserved_irq == -1) {
|
|
soc_print("osal_get_irq_by_name:%s failed.\n", name);
|
|
return -1;
|
|
}
|
|
|
|
ret = request_irq(reserved_irq, handler, reserved_flags, name, dev);
|
|
if (ret) {
|
|
soc_print("request_irq failed,[name:%s, irq:%d, flag:%ld],ret:%d \n", name, irq, flags, ret);
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
td_void ext_drv_osal_free_irq(td_u32 irq, const td_char *name, td_void *dev)
|
|
{
|
|
td_s32 reserved_irq;
|
|
|
|
TD_UNUSED(irq);
|
|
reserved_irq = osal_get_irq_by_name((td_char *)name);
|
|
if (reserved_irq == -1) {
|
|
return;
|
|
}
|
|
|
|
free_irq(reserved_irq, dev);
|
|
}
|
|
|
|
EXPORT_SYMBOL(ext_drv_osal_request_irq);
|
|
EXPORT_SYMBOL(ext_drv_osal_free_irq);
|
|
|