aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/samsung/fimc/csis.h
blob: fe0d689ba1fff493825d65c547d5c3d1aaca474d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* linux/drivers/media/video/samsung/csis.h
 *
 * Copyright (c) 2010 Samsung Electronics Co,. Ltd.
 *	http://www.samsung.com/
 *
 * Header file for Samsung MIPI-CSI2 driver
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
*/

#ifndef __CSIS_H
#define __CSIS_H __FILE__

#define S3C_CSIS_NAME		"s3c-csis"
#define S3C_CSIS_NR_LANES	1

#define CSIS_PKTSIZE		0x1000

#ifdef CONFIG_ARCH_EXYNOS4
#define S3C_CSIS_CH_NUM		2
#else
#define S3C_CSIS_CH_NUM		1
#endif

#define info(args...)	\
	do { printk(KERN_INFO S3C_CSIS_NAME ": " args); } while (0)
#define err(args...)	\
	do { printk(KERN_ERR  S3C_CSIS_NAME ": " args); } while (0)

enum mipi_format {
	MIPI_CSI_YCBCR422_8BIT	= 0x1e,
	MIPI_CSI_RAW8		= 0x2a,
	MIPI_CSI_RAW10		= 0x2b,
	MIPI_CSI_RAW12		= 0x2c,
	MIPI_USER_DEF_PACKET_1	= 0x30,	/* User defined Byte-based packet 1 */
};

struct csis_pkt_set {
	int			id;
	u32			pktdata[1024];
	struct list_head	list;
};

struct s3c_csis_info {
	char		name[16];
	struct device	*dev;
	struct clk	*clock;
	void __iomem	*regs;
	struct resource *regs_res;
	int		irq;
	int		nr_lanes;
	bool		pktdata_enable;

	struct csis_pkt_set	bufs;
	spinlock_t		csis_spinlock;
};

#endif /* __CSIS_H */