summarylogtreecommitdiffstats
path: root/0005-camera.patch
blob: 87d72a2a83e1d35675776601ae434fbd95355118 (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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
diff --git a/drivers/staging/media/atomisp/i2c/ov5693/Kconfig b/drivers/staging/media/atomisp/i2c/ov5693/Kconfig
index 9fb1bff..3954b8c 100644
--- a/drivers/staging/media/atomisp/i2c/ov5693/Kconfig
+++ b/drivers/staging/media/atomisp/i2c/ov5693/Kconfig
@@ -1,6 +1,6 @@
 config VIDEO_OV5693
        tristate "Omnivision ov5693 sensor support"
-       depends on I2C && VIDEO_V4L2
+       depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
        ---help---
          This is a Video4Linux2 sensor-level driver for the Micron
          ov5693 5 Mpixel camera.
diff --git a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c
index 1236425..37986f5 100644
--- a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c
+++ b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c
@@ -1332,7 +1332,7 @@ static int power_ctrl(struct v4l2_subdev *sd, bool flag)

 static int gpio_ctrl(struct v4l2_subdev *sd, bool flag)
 {
-	int ret;
+	int ret = 0;
 	struct ov5693_device *dev = to_ov5693_sensor(sd);

 	if (!dev || !dev->platform_data)
@@ -1342,7 +1342,8 @@ static int gpio_ctrl(struct v4l2_subdev *sd, bool flag)
 	if (dev->platform_data->gpio_ctrl)
 		return dev->platform_data->gpio_ctrl(sd, flag);

-	ret = dev->platform_data->gpio0_ctrl(sd, flag);
+	if (dev->platform_data->gpio0_ctrl)
+		ret = dev->platform_data->gpio0_ctrl(sd, flag);

 	return ret;
 }
@@ -1709,7 +1710,7 @@ static int ov5693_detect(struct i2c_client *client)
 					OV5693_SC_CMMN_CHIP_ID_L, &low);
 	id = ((((u16) high) << 8) | (u16) low);

-	if (id != OV5693_ID) {
+	if (id != OV5690_ID && id != OV5693_ID) {
 		dev_err(&client->dev, "sensor ID error 0x%x\n", id);
 		return -ENODEV;
 	}
diff --git a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.h b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.h
index 8c2e679..a657f94 100644
--- a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.h
+++ b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.h
@@ -33,7 +33,7 @@
 #include <linux/v4l2-mediabus.h>
 #include <media/media-entity.h>

-#include "../../include/linux/atomisp_platform.h"
+#include "../../include/linux/atomisp_gmin_platform.h"

 #define OV5693_NAME		"ov5693"

@@ -78,7 +78,8 @@
  * bits 7-0: min f-number denominator
  */
 #define OV5693_F_NUMBER_RANGE 0x180a180a
-#define OV5693_ID	0x5690
+#define OV5690_ID	0x5690
+#define OV5693_ID	0x5693

 #define OV5693_FINE_INTG_TIME_MIN 0
 #define OV5693_FINE_INTG_TIME_MAX_MARGIN 0
diff --git a/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c
index edaae93..ca59c4f 100644
--- a/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c
+++ b/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c
@@ -296,11 +296,13 @@ static const struct gmin_cfg_var ecs7_vars[] = {
 	{"INT33BE:00_CsiFmt", "13"},
 	{"INT33BE:00_CsiBayer", "2"},
 	{"INT33BE:00_CamClk", "0"},
+	{"INT33BE:00_ClkSrc", "1"},
 	{"INT33F0:00_CsiPort", "0"},
 	{"INT33F0:00_CsiLanes", "1"},
 	{"INT33F0:00_CsiFmt", "13"},
 	{"INT33F0:00_CsiBayer", "0"},
 	{"INT33F0:00_CamClk", "1"},
+	{"INT33BE:00_I2CAddr", "-1"},
 	{"gmin_V2P8GPIO", "402"},
 	{},
 };
@@ -325,6 +327,8 @@ static const struct {
 	{ "MRD7", mrd7_vars },
 	{ "ST70408", ecs7_vars },
 	{ "VTA0803", i8880_vars },
+	{ "Surface Book" , ecs7_vars } ,
+	{ "Surface Pro 4" , ecs7_vars } ,
 };


diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 6d22b22..b72b782 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -2277,6 +2277,46 @@ MODULE_PARM_DESC(timeout, "Streaming control requests timeout");
  * though they are compliant.
  */
 static const struct usb_device_id uvc_ids[] = {
+	/* Microsoft Surface Pro 3 Front */
+	{ .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor             = 0x045e,
+	  .idProduct            = 0x07be,
+	  .bInterfaceClass      = USB_CLASS_VIDEO,
+	  .bInterfaceSubClass   = 1,
+	  .bInterfaceProtocol   = 1 },
+	/* Microsoft Surface Pro 3 Rear */
+	{ .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor             = 0x045e,
+	  .idProduct            = 0x07bf,
+	  .bInterfaceClass      = USB_CLASS_VIDEO,
+	  .bInterfaceSubClass   = 1,
+	  .bInterfaceProtocol   = 1 },
+	/* Microsoft Surface Pro 4 Cam */
+	{ .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor             = 0x045e,
+	  .idProduct            = 0x090c,
+	  .bInterfaceClass      = USB_CLASS_VIDEO,
+	  .bInterfaceSubClass   = 1,
+	  .bInterfaceProtocol   = 1 },
+	/* Microsoft Surface Book Cam 1 */
+	{ .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor             = 0x045e,
+	  .idProduct            = 0x090b,
+	  .bInterfaceClass      = USB_CLASS_VIDEO,
+	  .bInterfaceSubClass   = 1,
+	  .bInterfaceProtocol   = 1 },
+	/* Microsoft Surface Book Cam 2 */
+	{ .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor             = 0x045e,
+	  .idProduct            = 0x091a,
+	  .bInterfaceClass      = USB_CLASS_VIDEO,
+	  .bInterfaceSubClass   = 1,
+	  .bInterfaceProtocol   = 1 },
 	/* LogiLink Wireless Webcam */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,