From patchwork Tue Feb 14 13:40:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 9572001 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8800F6045F for ; Tue, 14 Feb 2017 13:41:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A48C27F4B for ; Tue, 14 Feb 2017 13:41:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D0C027FA8; Tue, 14 Feb 2017 13:41:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 045C227F4B for ; Tue, 14 Feb 2017 13:41:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754066AbdBNNlJ (ORCPT ); Tue, 14 Feb 2017 08:41:09 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:59145 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754039AbdBNNkj (ORCPT ); Tue, 14 Feb 2017 08:40:39 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 35A8181812; Tue, 14 Feb 2017 14:40:27 +0100 (CET) Date: Tue, 14 Feb 2017 14:40:26 +0100 From: Pavel Machek To: sakari.ailus@iki.fi Cc: sre@kernel.org, pali.rohar@gmail.com, pavel@ucw.cz, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, laurent.pinchart@ideasonboard.com, mchehab@kernel.org, ivo.g.dimitrov.75@gmail.com Subject: [RFC 12/13] Enable camera on N900. Message-ID: <20170214134026.GA8651@amd> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP --- arch/arm/boot/dts/omap3-n900.dts | 158 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 157 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts index 87ca50b..aa4170f9 100644 --- a/arch/arm/boot/dts/omap3-n900.dts +++ b/arch/arm/boot/dts/omap3-n900.dts @@ -144,6 +144,59 @@ io-channel-names = "temp", "bsi", "vbat"; }; + rear_camera: camera@0 { + compatible = "linux,camera"; + + module { + model = "TCM8341MD"; + sensor = <&cam1>; + }; + }; + + front_camera: camera@1 { + compatible = "linux,camera"; + + module { + model = "VS6555"; + sensor = <&cam2>; + }; + }; + + video-bus-switch { + compatible = "video-bus-switch-gpio"; + + switch-gpios = <&gpio4 1 GPIO_ACTIVE_HIGH>; /* 97 */ + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + csi_switch_in: endpoint { + remote-endpoint = <&csi_isp>; + }; + }; + + port@1 { + reg = <1>; + + csi_switch_out1: endpoint { + remote-endpoint = <&csi_cam1>; + }; + }; + + port@2 { + reg = <2>; + + csi_switch_out2: endpoint { + remote-endpoint = <&csi_cam2>; + }; + }; + }; + }; + pwm9: dmtimer-pwm { compatible = "ti,omap-dmtimer-pwm"; #pwm-cells = <3>; @@ -157,6 +210,32 @@ }; }; +&isp { + vdds_csib-supply = <&vaux2>; + + pinctrl-names = "default"; + pinctrl-0 = <&camera_pins>; + ti,camera-flashes = <&adp1653 &cam1 &ad5820 &cam1>; + + ports { + port@1 { + reg = <1>; + + csi_isp: endpoint { + remote-endpoint = <&csi_switch_in>; + bus-type = <3>; /* CCP2 */ + clock-lanes = <0>; + data-lanes = <1>; + lane-polarity = <0 0>; + clock-inv = <0>; + /* Select strobe = <1> for back camera, <0> for front camera */ + strobe = <1>; + crc = <0>; + }; + }; + }; +}; + &omap3_pmx_core { pinctrl-names = "default"; @@ -319,6 +398,22 @@ OMAP3_CORE1_IOPAD(0x218e, PIN_OUTPUT | MUX_MODE4) /* gpio 157 => cmt_bsi */ >; }; + + camera_pins: pinmux_camera { + pinctrl-single,pins = < + OMAP3_CORE1_IOPAD(0x210c, PIN_OUTPUT | MUX_MODE7) /* cam_hs */ + OMAP3_CORE1_IOPAD(0x210e, PIN_OUTPUT | MUX_MODE7) /* cam_vs */ + OMAP3_CORE1_IOPAD(0x2110, PIN_OUTPUT | MUX_MODE0) /* cam_xclka */ + OMAP3_CORE1_IOPAD(0x211e, PIN_OUTPUT | MUX_MODE7) /* cam_d4 */ + OMAP3_CORE1_IOPAD(0x2122, PIN_INPUT | MUX_MODE0) /* cam_d6 */ + OMAP3_CORE1_IOPAD(0x2124, PIN_INPUT | MUX_MODE0) /* cam_d7 */ + OMAP3_CORE1_IOPAD(0x2126, PIN_INPUT | MUX_MODE0) /* cam_d8 */ + OMAP3_CORE1_IOPAD(0x2128, PIN_INPUT | MUX_MODE0) /* cam_d9 */ + OMAP3_CORE1_IOPAD(0x212a, PIN_OUTPUT | MUX_MODE7) /* cam_d10 */ + OMAP3_CORE1_IOPAD(0x212e, PIN_OUTPUT | MUX_MODE7) /* cam_xclkb */ + OMAP3_CORE1_IOPAD(0x2132, PIN_OUTPUT | MUX_MODE0) /* cam_strobe */ + >; + }; }; &i2c1 { @@ -507,6 +602,28 @@ clock-frequency = <100000>; + cam2: camera@10 { + compatible = "nokia,smia"; + reg = <0x10>; + + vana-supply = <&vaux4>; + + clocks = <&isp 0>; + clock-frequency = <9600000>; + + port { + csi_cam2: endpoint { + link-frequencies = /bits/ 64 <60000000>; + bus-type = <3>; /* CCP2 */ + strobe = <0>; + clock-inv = <0>; + crc = <0>; + + remote-endpoint = <&csi_switch_out2>; + }; + }; + }; + tlv320aic3x: tlv320aic3x@18 { compatible = "ti,tlv320aic3x"; reg = <0x18>; @@ -716,18 +833,57 @@ st,max-limit-y = <32>; st,max-limit-z = <32>; }; + + cam1: camera@3e { + compatible = "toshiba,et8ek8"; + reg = <0x3e>; + + vana-supply = <&vaux4>; + + clocks = <&isp 0>; + clock-names = "extclk"; + clock-frequency = <9600000>; + + reset-gpio = <&gpio4 6 GPIO_ACTIVE_HIGH>; /* 102 */ + + port { + csi_cam1: endpoint { + bus-type = <3>; /* CCP2 */ + strobe = <1>; + clock-inv = <0>; + crc = <1>; + + remote-endpoint = <&csi_switch_out1>; + }; + }; + }; + + /* D/A converter for auto-focus */ + ad5820: dac@0c { + compatible = "adi,ad5820"; + reg = <0x0c>; + + VANA-supply = <&vaux4>; + + #io-channel-cells = <0>; + }; }; &mmc1 { + slot-name = "external"; pinctrl-names = "default"; pinctrl-0 = <&mmc1_pins>; vmmc-supply = <&vmmc1>; bus-width = <4>; - cd-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>; /* 160 */ + /* For debugging, it is often good idea to remove this GPIO. + It means you can remove back cover (to reboot by removing + battery) and still use the MMC card. */ +// cd-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>; /* 160 */ }; /* most boards use vaux3, only some old versions use vmmc2 instead */ &mmc2 { + slot-name = "internal"; pinctrl-names = "default"; pinctrl-0 = <&mmc2_pins>; vmmc-supply = <&vaux3>;