From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0EB9C433E2 for ; Fri, 11 Sep 2020 16:15:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F9D6221EB for ; Fri, 11 Sep 2020 16:15:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726399AbgIKPcE (ORCPT ); Fri, 11 Sep 2020 11:32:04 -0400 Received: from mga02.intel.com ([134.134.136.20]:11193 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726482AbgIKP13 (ORCPT ); Fri, 11 Sep 2020 11:27:29 -0400 IronPort-SDR: nzThaXujr+ALgCRhaSW7VKSfyQ96qsG48/iJVKP0U/fwtHYabvnephDxfUdYBfWrCf6qeJmT5R QPbp7UEdrRzg== X-IronPort-AV: E=McAfee;i="6000,8403,9740"; a="146447683" X-IronPort-AV: E=Sophos;i="5.76,415,1592895600"; d="scan'208";a="146447683" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2020 06:49:08 -0700 IronPort-SDR: YGXxGEATdN65IN69VmiikoyK2YTR30+O68yZe+59DwGOF1ft0rbD8qiEt2xPK07XTQzomCDuQC bjRCn57WG/Vg== X-IronPort-AV: E=Sophos;i="5.76,415,1592895600"; d="scan'208";a="378568692" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2020 06:49:04 -0700 Received: by paasikivi.fi.intel.com (Postfix, from userid 1000) id A94202079D; Fri, 11 Sep 2020 16:49:02 +0300 (EEST) Date: Fri, 11 Sep 2020 16:49:02 +0300 From: Sakari Ailus To: "Togorean, Bogdan" Cc: Laurent Pinchart , "linux-media@vger.kernel.org" , Mauro Carvalho Chehab , Rob Herring , "David S. Miller" , Laurent Pinchart , Jacopo Mondi , Kieran Bingham , YueHaibing , Bingbu Cao , Manivannan Sadhasivam , Shawn Tu , Dongchun Zhu , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Cozma, Andrei" Subject: Re: [PATCH 1/2] media: i2c: Add driver for the Analog Devices ADDI9036 ToF front-end Message-ID: <20200911134902.GH26842@paasikivi.fi.intel.com> References: <20200910162426.55306-1-bogdan.togorean@analog.com> <20200910220138.GJ3940@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bogdan, On Fri, Sep 11, 2020 at 01:32:39PM +0000, Togorean, Bogdan wrote: > Hi Laurent, > > > Hi Bogdan, > > > > Thank you for the patch. > > Thank you for review! > > > > > On Thu, Sep 10, 2020 at 07:24:06PM +0300, Bogdan Togorean wrote: > > > The ADDI9036 is a complete, 45 MHz, front-end solution for charge > > > coupled device (CCD) time of flight (TOF) imaging applications. > > > > > > It has 2-lane MIPI CSI-2 RAW12 data output and i2c control interface. > > > > > > The programming of calibration and firmware is performed by userspace > > > SDK through CID_USER class IOCTLs. > > > > I'm afraid that's not acceptable. The firmware should be loaded using > > the Linux kernel firmware API. As for calibration, is it static data ? > > How is it generated ? > > Calibration data is static data, generated at production and stored on and EEPROM > memory on camera board. The camera board consists mainly of ADDI9036 processor > + CCD image sensor + EEPROM. > > The firmware is a set of (address, data) tuples that are written via I2C. > We want this driver to be a generic one and support all implementations > of ADDI9036 ToF processor. Now the problem is that some implementations > store firmware + calibration on external EEPROM and some store just calibration > data on EEPROM and firmware is loaded from a file stored in SDK. With the help > of the 2 custom controls we move the camera model detection, firmware > and calibration fetching from driver to user space SDK. Can you figure out by reading EEPROM which one of these is the case? Alternatively you could add a custom DT property IMO. The calibration data could be loaded using request_firmware(), too. I'd use a specific directory for just this purpose. > > Also an important point is that the ToF processor has 3 operating modes > (near, medium and far). At each mode change a new set of firmware + > calibration data is loaded into ADDI9036 chip. If we move the firmware loading > in driver we would still need a custom enumeration control to select the working mode. I don't see there being an issue having such a control. -- Kind regards, Sakari Ailus