xref: /linux/arch/sh/include/asm/push-switch.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2f15cbe6fSPaul Mundt #ifndef __ASM_SH_PUSH_SWITCH_H
3f15cbe6fSPaul Mundt #define __ASM_SH_PUSH_SWITCH_H
4f15cbe6fSPaul Mundt 
5f15cbe6fSPaul Mundt #include <linux/timer.h>
6f15cbe6fSPaul Mundt #include <linux/interrupt.h>
7f15cbe6fSPaul Mundt #include <linux/workqueue.h>
8f15cbe6fSPaul Mundt #include <linux/platform_device.h>
9f15cbe6fSPaul Mundt 
10f15cbe6fSPaul Mundt struct push_switch {
11f15cbe6fSPaul Mundt 	/* switch state */
12f15cbe6fSPaul Mundt 	unsigned int		state:1;
13f15cbe6fSPaul Mundt 	/* debounce timer */
14f15cbe6fSPaul Mundt 	struct timer_list	debounce;
15f15cbe6fSPaul Mundt 	/* workqueue */
16f15cbe6fSPaul Mundt 	struct work_struct	work;
17f15cbe6fSPaul Mundt 	/* platform device, for workqueue handler */
18f15cbe6fSPaul Mundt 	struct platform_device	*pdev;
19f15cbe6fSPaul Mundt };
20f15cbe6fSPaul Mundt 
21f15cbe6fSPaul Mundt struct push_switch_platform_info {
22f15cbe6fSPaul Mundt 	/* IRQ handler */
23f15cbe6fSPaul Mundt 	irqreturn_t		(*irq_handler)(int irq, void *data);
24f15cbe6fSPaul Mundt 	/* Special IRQ flags */
25f15cbe6fSPaul Mundt 	unsigned int		irq_flags;
26f15cbe6fSPaul Mundt 	/* Bit location of switch */
27f15cbe6fSPaul Mundt 	unsigned int		bit;
28f15cbe6fSPaul Mundt 	/* Symbolic switch name */
29f15cbe6fSPaul Mundt 	const char		*name;
30f15cbe6fSPaul Mundt };
31f15cbe6fSPaul Mundt 
32f15cbe6fSPaul Mundt #endif /* __ASM_SH_PUSH_SWITCH_H */
33