forked from intel/linux-intel-lts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ti960.h
110 lines (90 loc) · 2.61 KB
/
ti960.h
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2020 Intel Corporation */
#ifndef TI960_H
#define TI960_H
#include <linux/i2c.h>
#include <linux/regmap.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#define TI960_NAME "ti960"
#define TI960_I2C_ADDRESS 0x32
#define TI960_I2C_ADDRESS_2 0x3d
#define PIXEL_ORDER_GRBG 0
#define PIXEL_ORDER_RGGB 1
#define PIXEL_ORDER_BGGR 2
#define PIXEL_ORDER_GBRG 3
#define NR_OF_TI960_VCS_PER_SINK_PAD 2
#define NR_OF_TI960_VCS_SOURCE_PAD 4
#define NR_OF_TI960_SOURCE_PADS 1
#define NR_OF_TI960_SINK_PADS 4
#define NR_OF_TI960_PADS \
(NR_OF_TI960_SOURCE_PADS + NR_OF_TI960_SINK_PADS)
/* 4port * 2vc/port * 8 stream total */
#define NR_OF_TI960_STREAMS \
(NR_OF_TI960_SINK_PADS * NR_OF_TI960_VCS_PER_SINK_PAD \
* NR_OF_TI960_VCS_SOURCE_PAD)
#define NR_OF_GPIOS_PER_PORT 2
#define NR_OF_TI960_GPIOS \
(NR_OF_TI960_SINK_PADS * NR_OF_GPIOS_PER_PORT)
#define TI960_PAD_SOURCE 4
#define TI960_MIN_WIDTH 640
#define TI960_MIN_HEIGHT 480
#define TI960_MAX_WIDTH 1920
#define TI960_MAX_HEIGHT 1200
struct ti960_csi_data_format {
u32 code;
u8 width;
u8 compressed;
u8 pixel_order;
u8 mipi_dt_code;
};
struct ti960_subdev_info {
struct i2c_board_info board_info;
int i2c_adapter_id;
unsigned short rx_port;
unsigned short phy_i2c_addr;
unsigned short ser_alias;
const char suffix; /* suffix for subdevs */
};
struct ti960_pdata {
unsigned int subdev_num;
struct ti960_subdev_info *subdev_info;
unsigned int reset_gpio;
int FPD_gpio;
const char suffix;
};
#define TI960_MAX_GPIO_POWERUP_SEQ 4
/* set this flag if this module needs serializer initialization */
#define TI960_FL_INIT_SER BIT(0)
/* set this flag if this module has extra powerup sequence */
#define TI960_FL_POWERUP BIT(1)
/* set this flag if this module needs reset signal */
#define TI960_FL_RESET BIT(2)
/* set this flag if it need to init serial clk only */
#define TI960_FL_INIT_SER_CLK BIT(4)
struct ti960_subdev_pdata {
unsigned short i2c_addr;
unsigned short i2c_adapter;
unsigned int lanes; /* Number of CSI-2 lanes */
/* specify gpio pins of Deser for PWDN, FSIN, RESET. */
int xshutdown;
int fsin;
int reset;
/* specify gpio pins boot timing. */
/* Bit 3 write 0/1 on GPIO3
* Bit 2 write 0/1 on GPIO2
* Bit 1 write 0/1 on GPIO1
* Bit 0 write 0/1 on GPIO0
*/
char gpio_powerup_seq[TI960_MAX_GPIO_POWERUP_SEQ];
/* module_flags can be:
* TI960_FL_INIT_SER
* TI960_FL_POWERUP
* TI960_FL_RESET
*/
unsigned int module_flags;
char module_name[16]; /* module name from ACPI */
char suffix; /* suffix to identify multi sensors, abcd.. */
};
#endif