Skip to content

Commit a49d253

Browse files
Alan Coxgregkh
authored andcommitted
staging/atomisp: Add support for the Intel IPU v2
This patch adds support for the Intel IPU v2 as found on Android and IoT Baytrail-T and Baytrail-CR platforms (those with the IPU PCI mapped). You will also need the firmware files from your device (Android usually puts them into /etc) - or you can find them in the downloadable restore/upgrade kits if you blew them away for some reason. It may be possible to extend the driver to handle the BYT/T windows platforms such as the ASUS T100TA. These platforms don't expose the IPU via the PCI interface but via ACPI buried in the GPU description and with the camera information somewhere unknown so would need a platform driver interface adding to the codebase *IFF* the firmware works on such devices. To get good results you also need a suitable support library such as libxcam. The camera is intended to be driven from Android so it has a lot of features that many desktop apps don't fully spport. In theory all the pieces are there to build it with -DISP2401 and some differing files to get CherryTrail/T support, but unifying the drivers properlly is a work in progress. The IPU driver represents the work of a lot of people within Intel over many years. It's historical goal was portability rather than Linux upstream. Any queries about the upstream aimed driver should be sent to me not to the original authors. Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 372499b commit a49d253

File tree

920 files changed

+204645
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

920 files changed

+204645
-0
lines changed

drivers/staging/media/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ source "drivers/staging/media/lirc/Kconfig"
3434

3535
source "drivers/staging/media/st-cec/Kconfig"
3636

37+
source "drivers/staging/media/atomisp/Kconfig"
3738
endif

drivers/staging/media/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ obj-$(CONFIG_LIRC_STAGING) += lirc/
55
obj-$(CONFIG_VIDEO_DM365_VPFE) += davinci_vpfe/
66
obj-$(CONFIG_VIDEO_OMAP4) += omap4iss/
77
obj-$(CONFIG_VIDEO_STI_HDMI_CEC) += st-cec/
8+
obj-$(CONFIG_INTEL_ATOMISP) += atomisp/

drivers/staging/media/atomisp/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
menuconfig INTEL_ATOMISP
2+
bool "Enable support to Intel MIPI camera drivers"
3+
depends on X86
4+
help
5+
Enable support for the Intel ISP2 camera interfaces and MIPI
6+
sensor drivers.
7+
8+
if INTEL_ATOMISP
9+
source "drivers/staging/media/atomisp/pci/Kconfig"
10+
source "drivers/staging/media/atomisp/i2c/Kconfig"
11+
endif
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Makefile for camera drivers.
3+
#
4+
5+
obj-$(CONFIG_INTEL_ATOMISP) += pci/
6+
obj-$(CONFIG_INTEL_ATOMISP) += i2c/
7+
obj-$(CONFIG_INTEL_ATOMISP) += platform/
8+
LINUXINCLUDE += -I drivers/staging/media/atomisp/include/

drivers/staging/media/atomisp/TODO

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
1. A single AtomISP driver needs to be implemented to support both BYT and
2+
CHT platforms. The current driver is a mechanical and hand combined merge
3+
of the two using an ifdef ISP2401 to select the CHT version, which at the
4+
moment is not enabled. Eventually this should become a runtime if check,
5+
but there are some quite tricky things that need sorting out before that
6+
will be possible.
7+
8+
2. The file structure needs to get tidied up to resemble a normal Linux
9+
driver.
10+
11+
3. Lots of the midlayer glue. unused code and abstraction needs removing.
12+
13+
3. The sensor drivers read MIPI settings from EFI variables or default to the
14+
settings hard-coded in the platform data file for different platforms.
15+
This isn't ideal but may be hard to improve as this is how existing
16+
platforms work.
17+
18+
4. The sensor drivers use the regulator framework API. In the ideal world it
19+
would be using ACPI but that's not how the existing devices work.
20+
21+
5. The AtomISP driver includes some special IOCTLS (ATOMISP_IOC_XXXX_XXXX)
22+
that may need some cleaning up.
23+
24+
6. Correct Coding Style. Please don't send coding style patches for this
25+
driver until the other work is done.
26+
27+
7. The ISP code depends on the exact FW version. The version defined in
28+
BYT:
29+
drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
30+
static const char *release_version = STR(irci_stable_candrpv_0415_20150521_0458);
31+
CHT:
32+
drivers/staging/media/atomisp/pci/atomisp2/css/sh_css_firmware.c
33+
static const char *release_version = STR(irci_ecr-master_20150911_0724);
34+
35+
At some point we may need to round up a few driver versions and see if
36+
there are any specific things that can be done to fold in support for
37+
multiple firmware versions.
38+
39+
40+
Limitations:
41+
42+
1. Currently the patch only support some camera sensors
43+
gc2235/gc0310/0v2680/ov2722/ov5693/mt9m114...
44+
45+
2. To test the patches, you also need the ISP firmware
46+
47+
for BYT:/lib/firmware/shisp_2400b0_v21.bin
48+
for CHT:/lib/firmware/shisp_2401a0_v21.bin
49+
50+
The firmware files will usually be found in /etc/firmware on an Android
51+
device but can also be extracted from the upgrade kit if you've managed
52+
to lose them somehow.
53+
54+
3. Without a 3A libary the capture behaviour is not very good. To take a good
55+
picture, you need tune ISP parameters by IOCTL functions or use a 3A libary
56+
such as libxcam.
57+
58+
4. The driver is intended to drive the PCI exposed versions of the device.
59+
It will not detect those devices enumerated via ACPI as a field of the
60+
i915 GPU driver.
61+
62+
5. The driver supports only v2 of the IPU/Camera. It will not work with the
63+
versions of the hardware in other SoCs.
64+
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
#
2+
# Kconfig for sensor drivers
3+
#
4+
5+
source "drivers/staging/media/atomisp/i2c/ov5693/Kconfig"
6+
source "drivers/staging/media/atomisp/i2c/imx/Kconfig"
7+
8+
config VIDEO_OV2722
9+
tristate "OVT ov2722 sensor support"
10+
depends on I2C && VIDEO_V4L2
11+
---help---
12+
This is a Video4Linux2 sensor-level driver for the OVT
13+
OV2722 raw camera.
14+
15+
OVT is a 2M raw sensor.
16+
17+
It currently only works with the atomisp driver.
18+
19+
config VIDEO_GC2235
20+
tristate "Galaxy gc2235 sensor support"
21+
depends on I2C && VIDEO_V4L2
22+
---help---
23+
This is a Video4Linux2 sensor-level driver for the OVT
24+
GC2235 raw camera.
25+
26+
GC2235 is a 2M raw sensor.
27+
28+
It currently only works with the atomisp driver.
29+
30+
config VIDEO_OV8858
31+
tristate "Omnivision ov8858 sensor support"
32+
depends on I2C && VIDEO_V4L2 && VIDEO_ATOMISP
33+
---help---
34+
This is a Video4Linux2 sensor-level driver for the Omnivision
35+
ov8858 RAW sensor.
36+
37+
OV8858 is a 8M raw sensor.
38+
39+
It currently only works with the atomisp driver.
40+
41+
config VIDEO_MSRLIST_HELPER
42+
tristate "Helper library to load, parse and apply large register lists."
43+
depends on I2C
44+
---help---
45+
This is a helper library to be used from a sensor driver to load, parse
46+
and apply large register lists.
47+
48+
To compile this driver as a module, choose M here: the
49+
module will be called libmsrlisthelper.
50+
51+
config VIDEO_MT9M114
52+
tristate "Aptina mt9m114 sensor support"
53+
depends on I2C && VIDEO_V4L2
54+
---help---
55+
This is a Video4Linux2 sensor-level driver for the Micron
56+
mt9m114 1.3 Mpixel camera.
57+
58+
mt9m114 is video camera sensor.
59+
60+
It currently only works with the atomisp driver.
61+
62+
config VIDEO_AP1302
63+
tristate "AP1302 external ISP support"
64+
depends on I2C && VIDEO_V4L2
65+
---help---
66+
This is a Video4Linux2 sensor-level driver for the external
67+
ISP AP1302.
68+
69+
AP1302 is an exteral ISP.
70+
71+
It currently only works with the atomisp driver.
72+
73+
config VIDEO_GC0310
74+
tristate "GC0310 sensor support"
75+
depends on I2C && VIDEO_V4L2
76+
---help---
77+
This is a Video4Linux2 sensor-level driver for the Galaxycore
78+
GC0310 0.3MP sensor.
79+
80+
config VIDEO_OV2680
81+
tristate "Omnivision OV2680 sensor support"
82+
depends on I2C && VIDEO_V4L2
83+
---help---
84+
This is a Video4Linux2 sensor-level driver for the Omnivision
85+
OV2680 raw camera.
86+
87+
ov2680 is a 2M raw sensor.
88+
89+
It currently only works with the atomisp driver.
90+
91+
#
92+
# Kconfig for flash drivers
93+
#
94+
95+
config VIDEO_LM3554
96+
tristate "LM3554 flash light driver"
97+
depends on VIDEO_V4L2 && I2C
98+
---help---
99+
This is a Video4Linux2 sub-dev driver for the LM3554
100+
flash light driver.
101+
102+
To compile this driver as a module, choose M here: the
103+
module will be called lm3554
104+
105+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Makefile for sensor drivers
3+
#
4+
5+
obj-$(CONFIG_VIDEO_IMX) += imx/
6+
obj-$(CONFIG_VIDEO_OV5693) += ov5693/
7+
obj-$(CONFIG_VIDEO_MT9M114) += mt9m114.o
8+
obj-$(CONFIG_VIDEO_GC2235) += gc2235.o
9+
obj-$(CONFIG_VIDEO_OV2722) += ov2722.o
10+
obj-$(CONFIG_VIDEO_OV2680) += ov2680.o
11+
obj-$(CONFIG_VIDEO_GC0310) += gc0310.o
12+
13+
obj-$(CONFIG_VIDEO_MSRLIST_HELPER) += libmsrlisthelper.o
14+
15+
obj-$(CONFIG_VIDEO_AP1302) += ap1302.o
16+
17+
# Makefile for flash drivers
18+
#
19+
20+
obj-$(CONFIG_VIDEO_LM3554) += lm3554.o
21+
22+
ccflags-y += -Werror
23+

0 commit comments

Comments
 (0)