Skip to content

Commit

Permalink
Merge pull request torvalds#64 from mpredfearn/ci20-v3.18-camera
Browse files Browse the repository at this point in the history
Ci20 v3.18 camera support
  • Loading branch information
ZubairLK committed Aug 11, 2015
2 parents 9d0c486 + 01ab9cb commit 311124e
Show file tree
Hide file tree
Showing 11 changed files with 2,805 additions and 1 deletion.
40 changes: 40 additions & 0 deletions Documentation/devicetree/bindings/media/i2c/ov5640.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Omnivision 5Mp CMOS Digital Image Sensor

The Omnivision OV5640 is a CMOS active pixel digital image sensor with an active
array size of 2592H x 1944V. It is programmable through a simple two-wire serial
interface.

Required Properties:
- compatible: value should be "omnivision,ov5640"
- core-supply: phandle to regulator for core 1.5V
- analog-supply: phandle to regulator for analog 2.8V

Optional Properties:
- gpio-enable: handle to GPIO connected to enable pin
- gpio-reset: handle to GPIO connected to reset pin

For further reading on port node refer to
Documentation/devicetree/bindings/media/video-interfaces.txt.

Example:

i2c_master {
ov5640@0x3C {
compatible = "omnivision,ov5640";
reg = <0x3C>;

core-supply = <&vcim1v5_reg>;
analog-supply = <&vcim2v8_reg>;

gpio-enable = <&gpb 18 0>;
gpio-reset = <&gpb 26 0>;

remote = <&pxa_camera>;
port {
ov5640_1: endpoint {
bus-width = <8>;
remote-endpoint = <&pxa_camera>;
};
};
};
};
46 changes: 46 additions & 0 deletions Documentation/devicetree/bindings/media/jz4780-camera.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Ingenic JZ4780 camera host interface

Required properties:
- compatible: Should be "ingenic,jz4780-cim"
- reg: register base and size
- interrupts: the interrupt number
- clocks : phandles to the module & baud clocks.
- clock-names: tuple listing input clock names.
Required elements: "cim", "module"

Optional properties:
- clock-frequency: host interface is driving MCLK, and MCLK rate is this rate

For further reading on port node refer to
Documentation/devicetree/bindings/media/video-interfaces.txt.

Example:
cim: jz4780-cim@0x13060000 {
compatible = "ingenic,jz4780-cim";
reg = <0x13060000 0x68>;
reg-shift = <2>;

interrupt-parent = <&intc>;
interrupts = <30>;

pinctrl-names = "default";
pinctrl-0 = <&pins_cim>;

clocks = <&cgu JZ4780_CLK_CIM>, <&cgu JZ4780_CLK_CIMMCLK>;
clock-names = "cim", "module";
clock-frequency = <24000000>;

port {
#address-cells = <1>;
#size-cells = <0>;

/* Parallel bus endpoint */
camera: endpoint@0 {
reg = <0>; /* Local endpoint # */
remote-endpoint = <&ov5640_1>;
hsync-active = <1>; /* Active high */
vsync-active = <1>; /* Active high */
pclk-sample = <0>; /* Falling */
};
};
};
37 changes: 37 additions & 0 deletions arch/mips/boot/dts/ci20.dts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,25 @@
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pins_i2c2_data>;

ov5640@0x3C {
compatible = "omnivision,ov5640";
reg = <0x3C>;

core-supply = <&vcim1v5_reg>;
analog-supply = <&vcim2v8_reg>;

gpio-enable = <&gpb 18 0>;
gpio-reset = <&gpb 26 0>;

remote = <&cim>;
port {
ov5640_1: endpoint {
bus-width = <8>;
remote-endpoint = <&cim>;
};
};
};
};

&i2c3 {
Expand All @@ -322,3 +341,21 @@
pinctrl-names = "default";
pinctrl-0 = <&pins_i2c4_data_pf>;
};

&cim {
clock-frequency = <24000000>;

port {
#address-cells = <1>;
#size-cells = <0>;

/* Parallel bus endpoint */
camera: endpoint@0 {
reg = <0>; /* Local endpoint # */
remote-endpoint = <&ov5640_1>;
hsync-active = <1>; /* Active high */
vsync-active = <1>; /* Active high */
pclk-sample = <0>; /* Falling */
};
};
};
32 changes: 32 additions & 0 deletions arch/mips/boot/dts/jz4780.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,23 @@
&gpf 24 1 &pincfg_nobias>; /* hdmi_sck */
};
};

pinfunc_cim: cim {
pins_cim: cim-pb {
ingenic,pins = <&gpb 6 0 &pincfg_nobias
&gpb 7 0 &pincfg_nobias
&gpb 8 0 &pincfg_nobias
&gpb 9 0 &pincfg_nobias
&gpb 10 0 &pincfg_nobias
&gpb 11 0 &pincfg_nobias
&gpb 12 0 &pincfg_nobias
&gpb 13 0 &pincfg_nobias
&gpb 14 0 &pincfg_nobias
&gpb 15 0 &pincfg_nobias
&gpb 16 0 &pincfg_nobias
&gpb 17 0 &pincfg_nobias>;
};
};
};

spi_gpio {
Expand Down Expand Up @@ -581,6 +598,21 @@
ddc = <&i2c4>;
};

cim: jz4780-cim@0x13060000 {
compatible = "ingenic,jz4780-cim";
reg = <0x13060000 0x68>;
reg-shift = <2>;

interrupt-parent = <&intc>;
interrupts = <30>;

pinctrl-names = "default";
pinctrl-0 = <&pins_cim>;

clocks = <&cgu JZ4780_CLK_CIM>, <&cgu JZ4780_CLK_CIMMCLK>;
clock-names = "cim", "module";
};

hdmi: jz4780-hdmi3@0x10180000 {
compatible = "synopsys,dwc-hdmi";
reg = <0x10180000 0x8000>;
Expand Down
8 changes: 7 additions & 1 deletion arch/mips/configs/ci20_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -472,12 +472,14 @@ CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_ACT8600=y
CONFIG_REGULATOR_JZ4780_LCR=y
CONFIG_MEDIA_SUPPORT=m
CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
CONFIG_MEDIA_RADIO_SUPPORT=y
CONFIG_MEDIA_RC_SUPPORT=y
CONFIG_MEDIA_CONTROLLER=y
CONFIG_VIDEO_V4L2_SUBDEV_API=y
# CONFIG_DVB_NET is not set
CONFIG_LIRC=m
CONFIG_RC_DEVICES=y
Expand Down Expand Up @@ -606,6 +608,9 @@ CONFIG_VIDEO_EM28XX=m
CONFIG_VIDEO_EM28XX_V4L2=m
CONFIG_VIDEO_EM28XX_ALSA=m
CONFIG_VIDEO_EM28XX_DVB=m
CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_SOC_CAMERA=y
CONFIG_VIDEO_JZ4780=y
CONFIG_RADIO_SI470X=y
CONFIG_USB_SI470X=m
CONFIG_RADIO_SI4713=m
Expand All @@ -617,6 +622,7 @@ CONFIG_RADIO_SHARK2=m
CONFIG_USB_KEENE=m
CONFIG_USB_RAREMONO=m
CONFIG_USB_MA901=m
CONFIG_SOC_CAMERA_OV5640=m
CONFIG_DRM=y
CONFIG_DRM_JZ4780=y
CONFIG_DRM_JZ4780_HDMI_AUDIO=y
Expand Down
6 changes: 6 additions & 0 deletions drivers/media/i2c/soc_camera/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ config SOC_CAMERA_OV2640
help
This is a ov2640 camera driver

config SOC_CAMERA_OV5640
tristate "ov5640 sensor support"
depends on SOC_CAMERA && I2C
---help---
This is a V4L2 camera driver for the OmniVision OV5640 sensor

config SOC_CAMERA_OV5642
tristate "ov5642 camera support"
depends on SOC_CAMERA && I2C
Expand Down
1 change: 1 addition & 0 deletions drivers/media/i2c/soc_camera/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ obj-$(CONFIG_SOC_CAMERA_MT9T031) += mt9t031.o
obj-$(CONFIG_SOC_CAMERA_MT9T112) += mt9t112.o
obj-$(CONFIG_SOC_CAMERA_MT9V022) += mt9v022.o
obj-$(CONFIG_SOC_CAMERA_OV2640) += ov2640.o
obj-$(CONFIG_SOC_CAMERA_OV5640) += ov5640.o
obj-$(CONFIG_SOC_CAMERA_OV5642) += ov5642.o
obj-$(CONFIG_SOC_CAMERA_OV6650) += ov6650.o
obj-$(CONFIG_SOC_CAMERA_OV772X) += ov772x.o
Expand Down
Loading

0 comments on commit 311124e

Please sign in to comment.