Skip to content

Commit

Permalink
staging/atomisp: Add support for the Intel IPU v2
Browse files Browse the repository at this point in the history
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 <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Mar 6, 2017
1 parent 372499b commit a49d253
Show file tree
Hide file tree
Showing 920 changed files with 204,645 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/staging/media/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ source "drivers/staging/media/lirc/Kconfig"

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

source "drivers/staging/media/atomisp/Kconfig"
endif
1 change: 1 addition & 0 deletions drivers/staging/media/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ obj-$(CONFIG_LIRC_STAGING) += lirc/
obj-$(CONFIG_VIDEO_DM365_VPFE) += davinci_vpfe/
obj-$(CONFIG_VIDEO_OMAP4) += omap4iss/
obj-$(CONFIG_VIDEO_STI_HDMI_CEC) += st-cec/
obj-$(CONFIG_INTEL_ATOMISP) += atomisp/
11 changes: 11 additions & 0 deletions drivers/staging/media/atomisp/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
menuconfig INTEL_ATOMISP
bool "Enable support to Intel MIPI camera drivers"
depends on X86
help
Enable support for the Intel ISP2 camera interfaces and MIPI
sensor drivers.

if INTEL_ATOMISP
source "drivers/staging/media/atomisp/pci/Kconfig"
source "drivers/staging/media/atomisp/i2c/Kconfig"
endif
8 changes: 8 additions & 0 deletions drivers/staging/media/atomisp/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Makefile for camera drivers.
#

obj-$(CONFIG_INTEL_ATOMISP) += pci/
obj-$(CONFIG_INTEL_ATOMISP) += i2c/
obj-$(CONFIG_INTEL_ATOMISP) += platform/
LINUXINCLUDE += -I drivers/staging/media/atomisp/include/
64 changes: 64 additions & 0 deletions drivers/staging/media/atomisp/TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
1. A single AtomISP driver needs to be implemented to support both BYT and
CHT platforms. The current driver is a mechanical and hand combined merge
of the two using an ifdef ISP2401 to select the CHT version, which at the
moment is not enabled. Eventually this should become a runtime if check,
but there are some quite tricky things that need sorting out before that
will be possible.

2. The file structure needs to get tidied up to resemble a normal Linux
driver.

3. Lots of the midlayer glue. unused code and abstraction needs removing.

3. The sensor drivers read MIPI settings from EFI variables or default to the
settings hard-coded in the platform data file for different platforms.
This isn't ideal but may be hard to improve as this is how existing
platforms work.

4. The sensor drivers use the regulator framework API. In the ideal world it
would be using ACPI but that's not how the existing devices work.

5. The AtomISP driver includes some special IOCTLS (ATOMISP_IOC_XXXX_XXXX)
that may need some cleaning up.

6. Correct Coding Style. Please don't send coding style patches for this
driver until the other work is done.

7. The ISP code depends on the exact FW version. The version defined in
BYT:
drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
static const char *release_version = STR(irci_stable_candrpv_0415_20150521_0458);
CHT:
drivers/staging/media/atomisp/pci/atomisp2/css/sh_css_firmware.c
static const char *release_version = STR(irci_ecr-master_20150911_0724);

At some point we may need to round up a few driver versions and see if
there are any specific things that can be done to fold in support for
multiple firmware versions.


Limitations:

1. Currently the patch only support some camera sensors
gc2235/gc0310/0v2680/ov2722/ov5693/mt9m114...

2. To test the patches, you also need the ISP firmware

for BYT:/lib/firmware/shisp_2400b0_v21.bin
for CHT:/lib/firmware/shisp_2401a0_v21.bin

The firmware files will usually be found in /etc/firmware on an Android
device but can also be extracted from the upgrade kit if you've managed
to lose them somehow.

3. Without a 3A libary the capture behaviour is not very good. To take a good
picture, you need tune ISP parameters by IOCTL functions or use a 3A libary
such as libxcam.

4. The driver is intended to drive the PCI exposed versions of the device.
It will not detect those devices enumerated via ACPI as a field of the
i915 GPU driver.

5. The driver supports only v2 of the IPU/Camera. It will not work with the
versions of the hardware in other SoCs.

105 changes: 105 additions & 0 deletions drivers/staging/media/atomisp/i2c/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#
# Kconfig for sensor drivers
#

source "drivers/staging/media/atomisp/i2c/ov5693/Kconfig"
source "drivers/staging/media/atomisp/i2c/imx/Kconfig"

config VIDEO_OV2722
tristate "OVT ov2722 sensor support"
depends on I2C && VIDEO_V4L2
---help---
This is a Video4Linux2 sensor-level driver for the OVT
OV2722 raw camera.

OVT is a 2M raw sensor.

It currently only works with the atomisp driver.

config VIDEO_GC2235
tristate "Galaxy gc2235 sensor support"
depends on I2C && VIDEO_V4L2
---help---
This is a Video4Linux2 sensor-level driver for the OVT
GC2235 raw camera.

GC2235 is a 2M raw sensor.

It currently only works with the atomisp driver.

config VIDEO_OV8858
tristate "Omnivision ov8858 sensor support"
depends on I2C && VIDEO_V4L2 && VIDEO_ATOMISP
---help---
This is a Video4Linux2 sensor-level driver for the Omnivision
ov8858 RAW sensor.

OV8858 is a 8M raw sensor.

It currently only works with the atomisp driver.

config VIDEO_MSRLIST_HELPER
tristate "Helper library to load, parse and apply large register lists."
depends on I2C
---help---
This is a helper library to be used from a sensor driver to load, parse
and apply large register lists.

To compile this driver as a module, choose M here: the
module will be called libmsrlisthelper.

config VIDEO_MT9M114
tristate "Aptina mt9m114 sensor support"
depends on I2C && VIDEO_V4L2
---help---
This is a Video4Linux2 sensor-level driver for the Micron
mt9m114 1.3 Mpixel camera.

mt9m114 is video camera sensor.

It currently only works with the atomisp driver.

config VIDEO_AP1302
tristate "AP1302 external ISP support"
depends on I2C && VIDEO_V4L2
---help---
This is a Video4Linux2 sensor-level driver for the external
ISP AP1302.

AP1302 is an exteral ISP.

It currently only works with the atomisp driver.

config VIDEO_GC0310
tristate "GC0310 sensor support"
depends on I2C && VIDEO_V4L2
---help---
This is a Video4Linux2 sensor-level driver for the Galaxycore
GC0310 0.3MP sensor.

config VIDEO_OV2680
tristate "Omnivision OV2680 sensor support"
depends on I2C && VIDEO_V4L2
---help---
This is a Video4Linux2 sensor-level driver for the Omnivision
OV2680 raw camera.

ov2680 is a 2M raw sensor.

It currently only works with the atomisp driver.

#
# Kconfig for flash drivers
#

config VIDEO_LM3554
tristate "LM3554 flash light driver"
depends on VIDEO_V4L2 && I2C
---help---
This is a Video4Linux2 sub-dev driver for the LM3554
flash light driver.

To compile this driver as a module, choose M here: the
module will be called lm3554


23 changes: 23 additions & 0 deletions drivers/staging/media/atomisp/i2c/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# Makefile for sensor drivers
#

obj-$(CONFIG_VIDEO_IMX) += imx/
obj-$(CONFIG_VIDEO_OV5693) += ov5693/
obj-$(CONFIG_VIDEO_MT9M114) += mt9m114.o
obj-$(CONFIG_VIDEO_GC2235) += gc2235.o
obj-$(CONFIG_VIDEO_OV2722) += ov2722.o
obj-$(CONFIG_VIDEO_OV2680) += ov2680.o
obj-$(CONFIG_VIDEO_GC0310) += gc0310.o

obj-$(CONFIG_VIDEO_MSRLIST_HELPER) += libmsrlisthelper.o

obj-$(CONFIG_VIDEO_AP1302) += ap1302.o

# Makefile for flash drivers
#

obj-$(CONFIG_VIDEO_LM3554) += lm3554.o

ccflags-y += -Werror

Loading

0 comments on commit a49d253

Please sign in to comment.