Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp315194imm; Tue, 25 Sep 2018 22:27:04 -0700 (PDT) X-Google-Smtp-Source: ACcGV61RRYY2PbtshK5eXMekZMxwHhWmoWeSHs/qx6/FInYiXnasu0rUn3AUGBdh5PEKS2Rg3c// X-Received: by 2002:a63:31c8:: with SMTP id x191-v6mr3869375pgx.229.1537939624648; Tue, 25 Sep 2018 22:27:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537939624; cv=none; d=google.com; s=arc-20160816; b=kQAhTaDGv6t6ELagU/9s2L4WJPTMp5CP2OKsjVBw+m+9gsiSgisHzKPDpoPHGICbmT NALdFSL7Rz/z0eGLSHoMaQMmUJ5wwwK4onL1ZRxm6ib46vOlMYkRJjdF/oK7FYkg79Jk N1KBJrp52NxpX2WMr9R8ISbp0jgx8c8VkE17GSDQ2oDfJvOGx6UtE2RgtTb9d7lJJcdd kQwcWPjtcOt7xiSjA9HMr1ZqUdIMtHF89UwtZ6yzr9mQZEW76buKy0ny40t65UKYaUKn cWsMGiIRYuqL52fTEKUVFeBH0VyWZLK5fkCYQ6mYKaeMZdKq0J17JxzIMlydcJcPlfqp C8Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=BYZ2G8ahY1GvKCtO/HIaj1MAq+s/9diqsMKQJyc29p0=; b=G6W1kEEfpm3PUqlBXSW+iQUCFCpHv1IfFxoDjvCWCtSEUH4Ers520QU+L18s5dFHqg lp7MZwQIhhIGCA9rNQFqhfV6Hqm8dr+aPn+nAx3IBu9ZMHskArXa4Tx8IJhyrwsmxtzO OS6xJ9G6ld8jeAjgiIlSQga9+Nf/4OLHGdk7JlbpZ/DXOxnqBKsgWBi+N3Tqfj3ZfWgG l0SQ0ZwnqBIbRBiw4KHklA1mmMwKVmnyYxzLCgKoGNujEzcQqp5/wPIsCu8amiefnKiF 3w27o8xikx7i5LPoblUqkFWtm1LGJUm9uRbeNp9xEyZ1NILLjB/BlPa+Tkdhv1h4mz3f 6Q3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ff+dQvB3; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9-v6si4225564pgg.423.2018.09.25.22.26.48; Tue, 25 Sep 2018 22:27:04 -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=@gmail.com header.s=20161025 header.b=ff+dQvB3; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726436AbeIZLhv (ORCPT + 99 others); Wed, 26 Sep 2018 07:37:51 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:39181 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726355AbeIZLhv (ORCPT ); Wed, 26 Sep 2018 07:37:51 -0400 Received: by mail-lj1-f194.google.com with SMTP id 5-v6so9347349lju.6; Tue, 25 Sep 2018 22:26:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=BYZ2G8ahY1GvKCtO/HIaj1MAq+s/9diqsMKQJyc29p0=; b=ff+dQvB3F/M3sHrXhpIBKpxa7p5cTlnSATWmLGFrmk4oXNewJVwF2jTWhRsMNzRjPS UhD4h4ar+n+/6BDZdRS8lGoKH4wAaIXBIYw9Zr8F/8lxFrtKKR8p+MkdWRotE8yvQVQL jL5M57kshV69GRBCJH6K0DZLKoNl7Y5BvWd4KiVixgk1bBqNleHeOD3mdYMXqYiZE9IU E1LDnHgMr4BXAJp2+R/R/nqj9rQ+p5NjsZ9VCe/5eS8PcREVT4yDbcvtnkv833rSCxIR 5XPESe7GgnFbCDLHFR95y273opDq3uBS6dliGfrhnkdPyYswxrJWL4mIsTk/XWxPgmq7 J7Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=BYZ2G8ahY1GvKCtO/HIaj1MAq+s/9diqsMKQJyc29p0=; b=Fk0HuH8Wuyqid/0A3fIBMu+OaRSQ4tNuTX643XWq+MdMHgC9mBI5gQ0J1miXiqNkrT M2FbsPXsar77twohrNfAHdwQ9j3QrKBIBoXQA3CJ0jqAAWptaeJNSg5Y3+PetWGS9cOB ZVCEf8RUHWbIz4fOHTYL54881MPTTQSUlc1rkRseSKkzu2ikJhVpxJjafNudz+jfKm2V g5PJqrTi17DrlHxXKf7dCXlJSFaj0Dk7JbqmlB9+sxRKWbmHGzQ11C7SdOKLnFWOJXzN 88YbUMZZrCBWwexqFxR0UaQPkKzfM60CEHqIhp83fKOS56dYOPAlCPiUnKfZYLaOTv0i ACdg== X-Gm-Message-State: ABuFfoirzc2oQIDH9FD3HS+vJa6GKAjOfZtJsTgMPAxk2UJpdwyssHH0 9XFX/3Q+uvJEVsAzCTl7yWRbqZUR+ZHokGY4TgQrsYMu5nY= X-Received: by 2002:a2e:92c4:: with SMTP id k4-v6mr3247122ljh.18.1537939600949; Tue, 25 Sep 2018 22:26:40 -0700 (PDT) MIME-Version: 1.0 References: <20180921085450.19224-1-ricardo.ribalda@gmail.com> <20180921092833.c3bznrhc3yyarmq4@kekkonen.localdomain> <20180924203252.wxeclgjc7zvepyhb@kekkonen.localdomain> In-Reply-To: <20180924203252.wxeclgjc7zvepyhb@kekkonen.localdomain> From: Ricardo Ribalda Delgado Date: Wed, 26 Sep 2018 07:26:24 +0200 Message-ID: Subject: Re: [PATCH 1/2] [media] imx214: Add imx214 camera sensor driver To: Sakari Ailus Cc: Hans Verkuil , Laurent Pinchart , Mauro Carvalho Chehab , LKML , linux-media Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Sakari On Mon, Sep 24, 2018 at 10:32 PM Sakari Ailus wrote: > > Hi Ricardo, > > On Fri, Sep 21, 2018 at 12:15:55PM +0200, Ricardo Ribalda Delgado wrote: > ... > > > > +static struct reg_8 mode_1920x1080[]; > > > > +static struct reg_8 mode_4096x2304[]; > > > > > > Const. Could you rearrange the bits to avoid the forward declarations= ? > > Const done, but I prefer to keep the forward declaration. Otherwise > > the long tables will "hide" the mode declaration. > > Well, I guess the long tables do "hide" a bunch of other stuff, too. :-) > But... I agree there's no trivial way around those tables either. > > It appears I'm not the only one who's commented on the matter of the > forward declaration. Ok, I will change it, Eppur si muove ;) > > ... > > > > > +static int imx214_probe(struct i2c_client *client) > > > > +{ > > > > + struct device *dev =3D &client->dev; > > > > + struct imx214 *imx214; > > > > + struct fwnode_handle *endpoint; > > > > + int ret; > > > > + static const s64 link_freq[] =3D { > > > > + (IMX214_DEFAULT_PIXEL_RATE * 10LL) / 8, > > > > > > You should check the link frequency matches with that from the firmwa= re. > > > > I am not sure what you mean here sorry. > > The system firmware holds safe frequencies for the CSI-2 bus on that > particular system; you should check that the register lists are valid for > that frequency. > > ... > > > > > + imx214->pixel_rate =3D v4l2_ctrl_new_std(&imx214->ctrls, NULL= , > > > > + V4L2_CID_PIXEL_RATE, 0= , > > > > + IMX214_DEFAULT_PIXEL_R= ATE, 1, > > > > + IMX214_DEFAULT_PIXEL_R= ATE); > > > > + imx214->link_freq =3D v4l2_ctrl_new_int_menu(&imx214->ctrls, = NULL, > > > > + V4L2_CID_LINK_FREQ= , > > > > + ARRAY_SIZE(link_fr= eq) - 1, > > > > + 0, link_freq); > > > > > > Do I understand this correctly that the driver does not support setti= ng > > > e.g. exposure time or gain? Those are very basic features... > > > > > > Yep :), this is just a first step. I do not have the register set from > > the device :(. So I am reverse engineering a lot of things. > > I will add more controls as I am done with them. > > Looking at the registers you have in the register list, the sensor's > registers appear similar to those used by the smiapp driver (the old SMIA > standard). > > I'd guess the same register would work for setting the exposure time. I'm > less certain about the limits though. Thanks for the pointer! I will try this out and probably add it as a patch. > > > > > > > > > You'll also need to ensure the s_ctrl() callback works without s_powe= r() > > > being called. My suggestion is to switch to PM runtime; see e.g. the = ov1385 > > > driver in the current media tree master. > > > > > > There is one limitation with this chip on the dragonboard. I2c only > > works if the camss is ON. Therefore whatever s_ctrl needs to be > > cached and written at streamon. > > That's something that doesn't belong to this driver. It's the I=E6=B6=8E = adapter > driver / camss issue, and not necessarily related to drivers only. Is the > I=E6=B6=8E controller part of the camss btw.? I am with you here. The i2c controller is a different driver but is integrated with camss. Checkout https://patchwork.kernel.org/patch/10569961/ I am interacting with Todor and Vinod to enable the i2c port indepently with camss. At least now it does not kill the port after an i2c timeout :) Will fix the fwd declaration and the csi-2 register. Then I wll upload it to my github, try it on real hw next monday and send back to the mailing list Thanks! > > -- > Regards, > > Sakari Ailus > sakari.ailus@linux.intel.com --=20 Ricardo Ribalda