197fb5e8dSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 225fdd593SJeykumar Sankaran /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. 325fdd593SJeykumar Sankaran */ 425fdd593SJeykumar Sankaran 525fdd593SJeykumar Sankaran #ifndef __DPU_CORE_IRQ_H__ 625fdd593SJeykumar Sankaran #define __DPU_CORE_IRQ_H__ 725fdd593SJeykumar Sankaran 825fdd593SJeykumar Sankaran #include "dpu_kms.h" 925fdd593SJeykumar Sankaran #include "dpu_hw_interrupts.h" 1025fdd593SJeykumar Sankaran 1125fdd593SJeykumar Sankaran /** 1225fdd593SJeykumar Sankaran * dpu_core_irq_preinstall - perform pre-installation of core IRQ handler 13dd77ce4dSDmitry Baryshkov * @kms: MSM KMS handle 1425fdd593SJeykumar Sankaran * @return: none 1525fdd593SJeykumar Sankaran */ 16dd77ce4dSDmitry Baryshkov void dpu_core_irq_preinstall(struct msm_kms *kms); 1725fdd593SJeykumar Sankaran 1825fdd593SJeykumar Sankaran /** 1925fdd593SJeykumar Sankaran * dpu_core_irq_uninstall - uninstall core IRQ handler 20dd77ce4dSDmitry Baryshkov * @kms: MSM KMS handle 2125fdd593SJeykumar Sankaran * @return: none 2225fdd593SJeykumar Sankaran */ 23dd77ce4dSDmitry Baryshkov void dpu_core_irq_uninstall(struct msm_kms *kms); 2425fdd593SJeykumar Sankaran 2525fdd593SJeykumar Sankaran /** 2625fdd593SJeykumar Sankaran * dpu_core_irq - core IRQ handler 27dd77ce4dSDmitry Baryshkov * @kms: MSM KMS handle 2825fdd593SJeykumar Sankaran * @return: interrupt handling status 2925fdd593SJeykumar Sankaran */ 30dd77ce4dSDmitry Baryshkov irqreturn_t dpu_core_irq(struct msm_kms *kms); 3125fdd593SJeykumar Sankaran 3225fdd593SJeykumar Sankaran /** 3325fdd593SJeykumar Sankaran * dpu_core_irq_read - IRQ helper function for reading IRQ status 3425fdd593SJeykumar Sankaran * @dpu_kms: DPU handle 3525fdd593SJeykumar Sankaran * @irq_idx: irq index 3625fdd593SJeykumar Sankaran * @return: non-zero if irq detected; otherwise no irq detected 3725fdd593SJeykumar Sankaran */ 3825fdd593SJeykumar Sankaran u32 dpu_core_irq_read( 3925fdd593SJeykumar Sankaran struct dpu_kms *dpu_kms, 4052db0f2bSDmitry Baryshkov int irq_idx); 4125fdd593SJeykumar Sankaran 4225fdd593SJeykumar Sankaran /** 4325fdd593SJeykumar Sankaran * dpu_core_irq_register_callback - For registering callback function on IRQ 4425fdd593SJeykumar Sankaran * interrupt 4525fdd593SJeykumar Sankaran * @dpu_kms: DPU handle 4625fdd593SJeykumar Sankaran * @irq_idx: irq index 47*c929ac60SDmitry Baryshkov * @irq_cb: IRQ callback funcion. 48*c929ac60SDmitry Baryshkov * @irq_arg: IRQ callback argument. 4925fdd593SJeykumar Sankaran * @return: 0 for success registering callback, otherwise failure 5025fdd593SJeykumar Sankaran * 5125fdd593SJeykumar Sankaran * This function supports registration of multiple callbacks for each interrupt. 5225fdd593SJeykumar Sankaran */ 5325fdd593SJeykumar Sankaran int dpu_core_irq_register_callback( 5425fdd593SJeykumar Sankaran struct dpu_kms *dpu_kms, 5525fdd593SJeykumar Sankaran int irq_idx, 56*c929ac60SDmitry Baryshkov void (*irq_cb)(void *arg, int irq_idx), 57*c929ac60SDmitry Baryshkov void *irq_arg); 5825fdd593SJeykumar Sankaran 5925fdd593SJeykumar Sankaran /** 6025fdd593SJeykumar Sankaran * dpu_core_irq_unregister_callback - For unregistering callback function on IRQ 6125fdd593SJeykumar Sankaran * interrupt 6225fdd593SJeykumar Sankaran * @dpu_kms: DPU handle 6325fdd593SJeykumar Sankaran * @irq_idx: irq index 6425fdd593SJeykumar Sankaran * @return: 0 for success registering callback, otherwise failure 6525fdd593SJeykumar Sankaran * 6625fdd593SJeykumar Sankaran * This function supports registration of multiple callbacks for each interrupt. 6725fdd593SJeykumar Sankaran */ 6825fdd593SJeykumar Sankaran int dpu_core_irq_unregister_callback( 6925fdd593SJeykumar Sankaran struct dpu_kms *dpu_kms, 70*c929ac60SDmitry Baryshkov int irq_idx); 7125fdd593SJeykumar Sankaran 7225fdd593SJeykumar Sankaran /** 7325fdd593SJeykumar Sankaran * dpu_debugfs_core_irq_init - register core irq debugfs 7425fdd593SJeykumar Sankaran * @dpu_kms: pointer to kms 7525fdd593SJeykumar Sankaran * @parent: debugfs directory root 7625fdd593SJeykumar Sankaran */ 773d688410SJordan Crouse void dpu_debugfs_core_irq_init(struct dpu_kms *dpu_kms, 7825fdd593SJeykumar Sankaran struct dentry *parent); 7925fdd593SJeykumar Sankaran 8025fdd593SJeykumar Sankaran #endif /* __DPU_CORE_IRQ_H__ */ 81