regmap: Fix unused warning
[sfrench/cifs-2.6.git] / drivers / media / platform / s5p-cec / s5p_cec.h
1 /* drivers/media/platform/s5p-cec/s5p_cec.h
2  *
3  * Samsung S5P HDMI CEC driver
4  *
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  */
12
13 #ifndef _S5P_CEC_H_
14 #define _S5P_CEC_H_ __FILE__
15
16 #include <linux/clk.h>
17 #include <linux/interrupt.h>
18 #include <linux/kernel.h>
19 #include <linux/mfd/syscon.h>
20 #include <linux/module.h>
21 #include <linux/of.h>
22 #include <linux/platform_device.h>
23 #include <linux/pm_runtime.h>
24 #include <linux/timer.h>
25 #include <linux/workqueue.h>
26 #include <media/cec.h>
27
28 #include "exynos_hdmi_cec.h"
29 #include "regs-cec.h"
30 #include "s5p_cec.h"
31
32 #define CEC_NAME        "s5p-cec"
33
34 #define CEC_STATUS_TX_RUNNING           (1 << 0)
35 #define CEC_STATUS_TX_TRANSFERRING      (1 << 1)
36 #define CEC_STATUS_TX_DONE              (1 << 2)
37 #define CEC_STATUS_TX_ERROR             (1 << 3)
38 #define CEC_STATUS_TX_BYTES             (0xFF << 8)
39 #define CEC_STATUS_RX_RUNNING           (1 << 16)
40 #define CEC_STATUS_RX_RECEIVING         (1 << 17)
41 #define CEC_STATUS_RX_DONE              (1 << 18)
42 #define CEC_STATUS_RX_ERROR             (1 << 19)
43 #define CEC_STATUS_RX_BCAST             (1 << 20)
44 #define CEC_STATUS_RX_BYTES             (0xFF << 24)
45
46 #define CEC_WORKER_TX_DONE              (1 << 0)
47 #define CEC_WORKER_RX_MSG               (1 << 1)
48
49 /* CEC Rx buffer size */
50 #define CEC_RX_BUFF_SIZE                16
51 /* CEC Tx buffer size */
52 #define CEC_TX_BUFF_SIZE                16
53
54 enum cec_state {
55         STATE_IDLE,
56         STATE_BUSY,
57         STATE_DONE,
58         STATE_ERROR
59 };
60
61 struct cec_notifier;
62
63 struct s5p_cec_dev {
64         struct cec_adapter      *adap;
65         struct clk              *clk;
66         struct device           *dev;
67         struct mutex            lock;
68         struct regmap           *pmu;
69         struct cec_notifier     *notifier;
70         int                     irq;
71         void __iomem            *reg;
72
73         enum cec_state          rx;
74         enum cec_state          tx;
75         struct cec_msg          msg;
76 };
77
78 #endif /* _S5P_CEC_H_ */