Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4266170yba; Tue, 9 Apr 2019 15:02:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBj169LyNwerXEaPaIxge4JVnaNif1+pF2rNSO1+9kri1DVK+WBBSabjQQd1H0m7XA+/x3 X-Received: by 2002:a62:4d43:: with SMTP id a64mr39791829pfb.157.1554847373788; Tue, 09 Apr 2019 15:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554847373; cv=none; d=google.com; s=arc-20160816; b=O7BkYG1FVVWLa92nVnuagLnTM+FkC98FXdCk9G3CESPMHJyZY7H4O/vXT6mhVVJnZ5 msc9oAhLojAE+ymso0oHjP+ouRXQdgCNOS1BqAKuSTqvUktj767NPJxd3YKMwiuTtE2F M4cWwrIdUtsFPtFMN4XWX1MjXBiVi15SkPO21K1ChC99vuoV6zBVcaEKptOJ4TmWm+Gq VxuEhIgXoSPeKNZOHRJ8K0H3hZ6trV9PrMcqp0RrlbQ0acjWEYAV0Zv10UkqBl0fmbpt JUUUNvjmKj2gGVTCEpGaZDpVwegWplrKFHjEQBiWmk2mZeEroUVvZ/FVM3QhbdCiEkGa jXyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:dkim-signature; bh=uKDStQ3ZxyXfFlWsCkIg+cm1iD4X46KwO+/EyOpXfiw=; b=syx3bAUYCg7K3qz70DW5l3t8kvRdtgbc5bCpcrr6j96uVeYAPl9mHdwFXWA2Xj/Npf YBm8qh84bRUYX+PIVpgay2iFsa+TvfWqCJUBBDKsRfsncD2n3RAXc8uLUNdEbv4lPRTd M2mxmmH0kctDDV60byIHivoq9TY7qPoYgdiUXXmwsDEIJX3H/Qx1vB9nbI+kKu/JCHRy dtdgdZsu8F/V/j9cIdzxtZ6c9EjvKHgmNhgvG1dcOAAgz8ouhJgLwzXNawilet971SXB dMhhgwBLo3/F/f9MOearCYbvFaV7RtmdTumRQPSovHP4PN99aAkB/uFVFBoEGhLGKUlU qfyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=jmd7zXS4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=megous.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e26si30059486pfi.54.2019.04.09.15.02.37; Tue, 09 Apr 2019 15:02:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=jmd7zXS4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=megous.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726640AbfDIWAo (ORCPT + 99 others); Tue, 9 Apr 2019 18:00:44 -0400 Received: from vps.xff.cz ([195.181.215.36]:47896 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726568AbfDIWAn (ORCPT ); Tue, 9 Apr 2019 18:00:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1554847240; bh=qcNC0APQkwtDIo5GDKLxptbVItoD4PQj7iG6Im1qrow=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jmd7zXS4FWc5lI0dCbmS4VlBYIFxdlaHfMwXmxwQY5vMMvqkQkxJY5dkAMlGp2hSB BazKByhSOfnjFlIoGHqTYwdoShSML3JHNmbvW7d84GqKundQuvnZQe/n7MC9zAhCMK euNUfdev97vxhVgF6yKpG0yvPBLCYlNgwNcOxfDY= Date: Wed, 10 Apr 2019 00:00:40 +0200 From: =?utf-8?Q?Ond=C5=99ej?= Jirman To: Maxime Ripard Cc: Chen-Yu Tsai , Mark Rutland , devicetree , Stephen Boyd , Michael Turquette , linux-kernel , Paul Kocialkowski , Chen-Yu Tsai , Rob Herring , Yong Deng , Mauro Carvalho Chehab , linux-clk , linux-arm-kernel , Linux Media Mailing List Subject: Re: [PATCH 4/6] ARM: dts: sun8i: a83t: Add device node for CSI (Camera Sensor Interface) Message-ID: <20190409220040.3sx456gefmjq3t3g@core.my.home> Mail-Followup-To: Maxime Ripard , Chen-Yu Tsai , Mark Rutland , devicetree , Stephen Boyd , Michael Turquette , linux-kernel , Paul Kocialkowski , Chen-Yu Tsai , Rob Herring , Yong Deng , Mauro Carvalho Chehab , linux-clk , linux-arm-kernel , Linux Media Mailing List References: <20190408165744.11672-1-wens@kernel.org> <20190408165744.11672-5-wens@kernel.org> <20190409075804.4zrwjil7ie2gjigu@flea> <20190409082818.z33mq2qrxethldzf@flea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190409082818.z33mq2qrxethldzf@flea> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 09, 2019 at 10:28:18AM +0200, Maxime Ripard wrote: > On Tue, Apr 09, 2019 at 04:07:34PM +0800, Chen-Yu Tsai wrote: > > On Tue, Apr 9, 2019 at 3:58 PM Maxime Ripard wrote: > > > On Tue, Apr 09, 2019 at 12:57:42AM +0800, Chen-Yu Tsai wrote: > > > > From: Chen-Yu Tsai > > > > > > > > The A83T SoC has a camera sensor interface (known as CSI in Allwinner > > > > lingo), which is similar to the one found on the A64 and H3. The only > > > > difference seems to be that support of MIPI CSI through a connected > > > > MIPI CSI-2 bridge. > > > > > > > > Add a device node for it, and pinctrl nodes for the commonly used MCLK > > > > and 8-bit parallel interface. The property /omit-if-no-ref/ is added to > > > > the pinctrl nodes to keep the device tree blob size down if they are > > > > unused. > > > > > > > > Signed-off-by: Chen-Yu Tsai > > > > --- > > > > arch/arm/boot/dts/sun8i-a83t.dtsi | 31 +++++++++++++++++++++++++++++++ > > > > 1 file changed, 31 insertions(+) > > > > > > > > diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi > > > > index f739b88efb53..0c52f945fd5f 100644 > > > > --- a/arch/arm/boot/dts/sun8i-a83t.dtsi > > > > +++ b/arch/arm/boot/dts/sun8i-a83t.dtsi > > > > @@ -682,6 +682,20 @@ > > > > #interrupt-cells = <3>; > > > > #gpio-cells = <3>; > > > > > > > > + /omit-if-no-ref/ > > > > + csi_8bit_parallel_pins: csi-8bit-parallel-pins { > > > > + pins = "PE0", "PE2", "PE3", "PE6", "PE7", > > > > + "PE8", "PE9", "PE10", "PE11", > > > > + "PE12", "PE13"; > > > > + function = "csi"; > > > > + }; > > > > + > > > > + /omit-if-no-ref/ > > > > + csi_mclk_pin: csi-mclk-pin { > > > > + pins = "PE1"; > > > > + function = "csi"; > > > > + }; > > > > + > > > > emac_rgmii_pins: emac-rgmii-pins { > > > > pins = "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", > > > > "PD11", "PD12", "PD13", "PD14", "PD18", > > > > @@ -994,6 +1008,23 @@ > > > > interrupts = ; > > > > }; > > > > > > > > + csi: camera@1cb0000 { > > > > + compatible = "allwinner,sun8i-a83t-csi"; > > > > + reg = <0x01cb0000 0x1000>; > > > > + interrupts = ; > > > > + clocks = <&ccu CLK_BUS_CSI>, > > > > + <&ccu CLK_CSI_SCLK>, > > > > + <&ccu CLK_DRAM_CSI>; > > > > + clock-names = "bus", "mod", "ram"; > > > > + resets = <&ccu RST_BUS_CSI>; > > > > + status = "disabled"; > > > > + > > > > + csi_in: port { > > > > + #address-cells = <1>; > > > > + #size-cells = <0>; > > > > > > If we expect a single enpoint, then we don't need the address-cells > > > and size-cells properties. > > > > I wouldn't bet on anything. The way the Q8 tablets did front/back cameras > > is kind of genius if not very hacky. They have two "identical" sensors > > on the same I2C bus and CSI bus, with shared reset line but separate > > shutdown lines. Since they are identical, they also have the same I2C > > address. I haven't figured out how to model this in the device tree. > > > > The point is, it's perfectly possible to have two or more sensors use > > the same controller, provided only one be active at a time. > > Right, but I guess the common case would be to have a single sensor, > where that wouldn't be needed. > > In odd cases, we can always specify it in the DTS, and if it becomes > common enough, we can move it to the DTSI. I'm planning on having two sensors there, in a less arcane setup, though - no shared resets, and different I2C addresses. Anyway, I can confirm that CSI driver works fine on A83T with just a DTSI patch, even without the clock patch in this series. I've been running it for quite a while that way without any issues (different camera chip than the ones being used by wens). regards, o. > Maxime > > -- > Maxime Ripard, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel