| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. |
|---|
| 2 | | - * |
|---|
| 3 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 4 | | - * it under the terms of the GNU General Public License version 2 and |
|---|
| 5 | | - * only version 2 as published by the Free Software Foundation. |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 8 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 9 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 10 | | - * GNU General Public License for more details. |
|---|
| 11 | 3 | */ |
|---|
| 12 | 4 | |
|---|
| 13 | 5 | #ifndef _DPU_HW_INTERRUPTS_H |
|---|
| .. | .. |
|---|
| 19 | 11 | #include "dpu_hw_catalog.h" |
|---|
| 20 | 12 | #include "dpu_hw_util.h" |
|---|
| 21 | 13 | #include "dpu_hw_mdss.h" |
|---|
| 22 | | - |
|---|
| 23 | | -#define IRQ_SOURCE_MDP BIT(0) |
|---|
| 24 | | -#define IRQ_SOURCE_DSI0 BIT(4) |
|---|
| 25 | | -#define IRQ_SOURCE_DSI1 BIT(5) |
|---|
| 26 | | -#define IRQ_SOURCE_HDMI BIT(8) |
|---|
| 27 | | -#define IRQ_SOURCE_EDP BIT(12) |
|---|
| 28 | | -#define IRQ_SOURCE_MHL BIT(16) |
|---|
| 29 | 14 | |
|---|
| 30 | 15 | /** |
|---|
| 31 | 16 | * dpu_intr_type - HW Interrupt Type |
|---|
| .. | .. |
|---|
| 96 | 81 | */ |
|---|
| 97 | 82 | struct dpu_hw_intr_ops { |
|---|
| 98 | 83 | /** |
|---|
| 99 | | - * set_mask - Programs the given interrupt register with the |
|---|
| 100 | | - * given interrupt mask. Register value will get overwritten. |
|---|
| 101 | | - * @intr: HW interrupt handle |
|---|
| 102 | | - * @reg_off: MDSS HW register offset |
|---|
| 103 | | - * @irqmask: IRQ mask value |
|---|
| 104 | | - */ |
|---|
| 105 | | - void (*set_mask)( |
|---|
| 106 | | - struct dpu_hw_intr *intr, |
|---|
| 107 | | - uint32_t reg, |
|---|
| 108 | | - uint32_t irqmask); |
|---|
| 109 | | - |
|---|
| 110 | | - /** |
|---|
| 111 | 84 | * irq_idx_lookup - Lookup IRQ index on the HW interrupt type |
|---|
| 112 | 85 | * Used for all irq related ops |
|---|
| 113 | 86 | * @intr_type: Interrupt type defined in dpu_intr_type |
|---|
| .. | .. |
|---|
| 177 | 150 | struct dpu_hw_intr *intr); |
|---|
| 178 | 151 | |
|---|
| 179 | 152 | /** |
|---|
| 180 | | - * clear_interrupt_status - Clears HW interrupt status based on given |
|---|
| 181 | | - * lookup IRQ index. |
|---|
| 182 | | - * @intr: HW interrupt handle |
|---|
| 183 | | - * @irq_idx: Lookup irq index return from irq_idx_lookup |
|---|
| 184 | | - */ |
|---|
| 185 | | - void (*clear_interrupt_status)( |
|---|
| 186 | | - struct dpu_hw_intr *intr, |
|---|
| 187 | | - int irq_idx); |
|---|
| 188 | | - |
|---|
| 189 | | - /** |
|---|
| 190 | 153 | * clear_intr_status_nolock() - clears the HW interrupts without lock |
|---|
| 191 | 154 | * @intr: HW interrupt handle |
|---|
| 192 | 155 | * @irq_idx: Lookup irq index return from irq_idx_lookup |
|---|
| .. | .. |
|---|
| 206 | 169 | struct dpu_hw_intr *intr, |
|---|
| 207 | 170 | int irq_idx, |
|---|
| 208 | 171 | bool clear); |
|---|
| 209 | | - |
|---|
| 210 | | - /** |
|---|
| 211 | | - * get_valid_interrupts - Gets a mask of all valid interrupt sources |
|---|
| 212 | | - * within DPU. These are actually status bits |
|---|
| 213 | | - * within interrupt registers that specify the |
|---|
| 214 | | - * source of the interrupt in IRQs. For example, |
|---|
| 215 | | - * valid interrupt sources can be MDP, DSI, |
|---|
| 216 | | - * HDMI etc. |
|---|
| 217 | | - * @intr: HW interrupt handle |
|---|
| 218 | | - * @mask: Returning the interrupt source MASK |
|---|
| 219 | | - * @return: 0 for success, otherwise failure |
|---|
| 220 | | - */ |
|---|
| 221 | | - int (*get_valid_interrupts)( |
|---|
| 222 | | - struct dpu_hw_intr *intr, |
|---|
| 223 | | - uint32_t *mask); |
|---|
| 224 | 172 | }; |
|---|
| 225 | 173 | |
|---|
| 226 | 174 | /** |
|---|
| .. | .. |
|---|
| 239 | 187 | u32 *save_irq_status; |
|---|
| 240 | 188 | u32 irq_idx_tbl_size; |
|---|
| 241 | 189 | spinlock_t irq_lock; |
|---|
| 190 | + unsigned long irq_mask; |
|---|
| 242 | 191 | }; |
|---|
| 243 | 192 | |
|---|
| 244 | 193 | /** |
|---|