diff options
author | Scott Jiang <scott.jiang.linux@gmail.com> | 2012-03-08 15:44:17 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-03-19 14:08:20 -0400 |
commit | 63b1a90da93e019adcafa2b2b1b921fc97debec5 (patch) | |
tree | 1b90018dd9b9ac89207293be1672427ac377c33e /include/media/blackfin | |
parent | f877ed9780f43da51a4544e5b90b7f4a145964ff (diff) |
[media] add blackfin capture bridge driver
This is a v4l2 bridge driver for Blackfin video capture device, support ppi and eppi interface.
Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media/blackfin')
-rw-r--r-- | include/media/blackfin/bfin_capture.h | 37 | ||||
-rw-r--r-- | include/media/blackfin/ppi.h | 74 |
2 files changed, 111 insertions, 0 deletions
diff --git a/include/media/blackfin/bfin_capture.h b/include/media/blackfin/bfin_capture.h new file mode 100644 index 000000000000..2038a8a3f8aa --- /dev/null +++ b/include/media/blackfin/bfin_capture.h | |||
@@ -0,0 +1,37 @@ | |||
1 | #ifndef _BFIN_CAPTURE_H_ | ||
2 | #define _BFIN_CAPTURE_H_ | ||
3 | |||
4 | #include <linux/i2c.h> | ||
5 | |||
6 | struct v4l2_input; | ||
7 | struct ppi_info; | ||
8 | |||
9 | struct bcap_route { | ||
10 | u32 input; | ||
11 | u32 output; | ||
12 | }; | ||
13 | |||
14 | struct bfin_capture_config { | ||
15 | /* card name */ | ||
16 | char *card_name; | ||
17 | /* inputs available at the sub device */ | ||
18 | struct v4l2_input *inputs; | ||
19 | /* number of inputs supported */ | ||
20 | int num_inputs; | ||
21 | /* routing information for each input */ | ||
22 | struct bcap_route *routes; | ||
23 | /* i2c bus adapter no */ | ||
24 | int i2c_adapter_id; | ||
25 | /* i2c subdevice board info */ | ||
26 | struct i2c_board_info board_info; | ||
27 | /* ppi board info */ | ||
28 | const struct ppi_info *ppi_info; | ||
29 | /* ppi control */ | ||
30 | unsigned long ppi_control; | ||
31 | /* ppi interrupt mask */ | ||
32 | u32 int_mask; | ||
33 | /* horizontal blanking clocks */ | ||
34 | int blank_clocks; | ||
35 | }; | ||
36 | |||
37 | #endif | ||
diff --git a/include/media/blackfin/ppi.h b/include/media/blackfin/ppi.h new file mode 100644 index 000000000000..8f72f8a0b3d0 --- /dev/null +++ b/include/media/blackfin/ppi.h | |||
@@ -0,0 +1,74 @@ | |||
1 | /* | ||
2 | * Analog Devices PPI header file | ||
3 | * | ||
4 | * Copyright (c) 2011 Analog Devices Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
18 | */ | ||
19 | |||
20 | #ifndef _PPI_H_ | ||
21 | #define _PPI_H_ | ||
22 | |||
23 | #include <linux/interrupt.h> | ||
24 | |||
25 | #ifdef EPPI_EN | ||
26 | #define PORT_EN EPPI_EN | ||
27 | #define DMA32 0 | ||
28 | #define PACK_EN PACKEN | ||
29 | #endif | ||
30 | |||
31 | struct ppi_if; | ||
32 | |||
33 | struct ppi_params { | ||
34 | int width; | ||
35 | int height; | ||
36 | int bpp; | ||
37 | unsigned long ppi_control; | ||
38 | u32 int_mask; | ||
39 | int blank_clocks; | ||
40 | }; | ||
41 | |||
42 | struct ppi_ops { | ||
43 | int (*attach_irq)(struct ppi_if *ppi, irq_handler_t handler); | ||
44 | void (*detach_irq)(struct ppi_if *ppi); | ||
45 | int (*start)(struct ppi_if *ppi); | ||
46 | int (*stop)(struct ppi_if *ppi); | ||
47 | int (*set_params)(struct ppi_if *ppi, struct ppi_params *params); | ||
48 | void (*update_addr)(struct ppi_if *ppi, unsigned long addr); | ||
49 | }; | ||
50 | |||
51 | enum ppi_type { | ||
52 | PPI_TYPE_PPI, | ||
53 | PPI_TYPE_EPPI, | ||
54 | }; | ||
55 | |||
56 | struct ppi_info { | ||
57 | enum ppi_type type; | ||
58 | int dma_ch; | ||
59 | int irq_err; | ||
60 | void __iomem *base; | ||
61 | const unsigned short *pin_req; | ||
62 | }; | ||
63 | |||
64 | struct ppi_if { | ||
65 | unsigned long ppi_control; | ||
66 | const struct ppi_ops *ops; | ||
67 | const struct ppi_info *info; | ||
68 | bool err_int; | ||
69 | void *priv; | ||
70 | }; | ||
71 | |||
72 | struct ppi_if *ppi_create_instance(const struct ppi_info *info); | ||
73 | void ppi_delete_instance(struct ppi_if *ppi); | ||
74 | #endif | ||