Lines Matching +full:mask +full:- +full:reset

1 /* SPDX-License-Identifier: GPL-2.0 or MIT */
10 #include <linux/io-pgtable.h>
34 * enum panthor_device_pm_state - PM state
51 * struct panthor_irq - IRQ data
62 /** @mask: Current mask being applied to xxx_INT_MASK. */
63 u32 mask; member
70 * struct panthor_device - Panthor device
130 /** @reset: Reset related fields. */
132 /** @wq: Ordered worqueud used to schedule reset operations. */
135 /** @work: Reset work. */
138 /** @pending: Set to true if a reset is pending. */
140 } reset; member
168 * struct panthor_file - Panthor file
185 * panthor_device_schedule_reset() - Schedules a reset operation
189 if (!atomic_cmpxchg(&ptdev->reset.pending, 0, 1) && in panthor_device_schedule_reset()
190 atomic_read(&ptdev->pm.state) == PANTHOR_DEVICE_PM_STATE_ACTIVE) in panthor_device_schedule_reset()
191 queue_work(ptdev->reset.wq, &ptdev->reset.work); in panthor_device_schedule_reset()
195 * panthor_device_reset_is_pending() - Checks if a reset is pending.
197 * Return: true if a reset is pending, false otherwise.
201 return atomic_read(&ptdev->reset.pending) != 0; in panthor_device_reset_is_pending()
263 * panthor_exception_is_fault() - Checks if an exception is a fault.
277 * PANTHOR_IRQ_HANDLER() - Define interrupt handlers and the interrupt
280 * The boiler-plate to gracefully deal with shared interrupts is
281 * auto-generated. All you have to do is call PANTHOR_IRQ_HANDLER()
290 struct panthor_device *ptdev = pirq->ptdev; \
292 if (atomic_read(&pirq->suspended)) \
304 struct panthor_device *ptdev = pirq->ptdev; \
308 u32 status = gpu_read(ptdev, __reg_prefix ## _INT_RAWSTAT) & pirq->mask; \
319 if (!atomic_read(&pirq->suspended)) \
320 gpu_write(ptdev, __reg_prefix ## _INT_MASK, pirq->mask); \
327 pirq->mask = 0; \
328 gpu_write(pirq->ptdev, __reg_prefix ## _INT_MASK, 0); \
329 synchronize_irq(pirq->irq); \
330 atomic_set(&pirq->suspended, true); \
333 static inline void panthor_ ## __name ## _irq_resume(struct panthor_irq *pirq, u32 mask) \
335 atomic_set(&pirq->suspended, false); \
336 pirq->mask = mask; \
337 gpu_write(pirq->ptdev, __reg_prefix ## _INT_CLEAR, mask); \
338 gpu_write(pirq->ptdev, __reg_prefix ## _INT_MASK, mask); \
343 int irq, u32 mask) \
345 pirq->ptdev = ptdev; \
346 pirq->irq = irq; \
347 panthor_ ## __name ## _irq_resume(pirq, mask); \
349 return devm_request_threaded_irq(ptdev->base.dev, irq, \
352 IRQF_SHARED, KBUILD_MODNAME "-" # __name, \