Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp106020pxk; Wed, 2 Sep 2020 16:03:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWOMrqEwlvVVvKOA2hpDD11qFi1CHKP5k0MqS6h1KQbsclGj9ZRTbfpOEnERhE6ifw2+RN X-Received: by 2002:a17:906:af53:: with SMTP id ly19mr368404ejb.503.1599087828542; Wed, 02 Sep 2020 16:03:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599087828; cv=none; d=google.com; s=arc-20160816; b=VfUqkg6TZUJHwRcVcG/0RvStRGDtizRSMuCiSOdPbyTieNUqausEPnhOdrOwDshPLD +kxIVT/usDRFR+Tv2SplZaNS86kTLk06BW41jNN3QYnzU9wAO9rCfldFLXisqJFEecXS imjQugPgdVpamCEYayS/A4G27tTPqofHmPUFT02ofrr8QAR+EzmpJATOsaXlSnQ3jjDi 7AzcBkuefNtM6zLmp88QeY6CZXIIk/gJWguKxrJRMIUyAnyV2dtFhYJnM0L1Dg+Cgfxs aconBv0kj97R1EFbQ2bFvxDXliuNhLbOs5JevAVKqTvLpv1gw5vfI0qroIYl9SzzJUuK pqQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=K6cGerCxO46Qm24iFA5aZEL6UdjUDW3jjNLe5Ls8bmw=; b=S5MXBk9MDLxXyQ9BrZ46GU7cENC0aW9tHF7IiOCtz1ixyIgFqM4Awl6L4leTtnUT8z nHhjT3tDRWUbiftartqOL68sYp7pwNeHn4yACpSveXnc390lECLrP3WlgFcGqH4zHEjA 2B9rkrwZFqQtFWQZre2lbjKWTEd/rbt1F8z04adKUHC9sjBvEKHnQzD556mZR79R0PA8 OTU6B6l4MKzUA2voADE9mpu+Jma0AJ0IJX52ECWDUM3L+KsfhYLwTDr70b7CsF3CnDoH 0j2uz0ekU5Vq0gOLatIGfHlaywWIv0U5aGyvM2ysrMZvV+nyD4Y0OIFF0vBIWTfg+mei j9Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jGdZtAdc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f23si442959edm.413.2020.09.02.16.03.25; Wed, 02 Sep 2020 16:03:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jGdZtAdc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727784AbgIBW75 (ORCPT + 99 others); Wed, 2 Sep 2020 18:59:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727089AbgIBW7o (ORCPT ); Wed, 2 Sep 2020 18:59:44 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E99BC061245 for ; Wed, 2 Sep 2020 15:59:44 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id j11so1073214ejk.0 for ; Wed, 02 Sep 2020 15:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=K6cGerCxO46Qm24iFA5aZEL6UdjUDW3jjNLe5Ls8bmw=; b=jGdZtAdc7CvPt+P2PuAbn91E6yyatAb+8jgjU+0k3SbWdjhBWYOEa+KKGF/DNvtW66 en6JA8kGE7oWpnaCF9TivIQ7+3Wq0KMsx0qHCQo9Z0s+0Hp789sEBg4fQNaaLg2TRPun LHR6LIHcTsZo10OmpUpN2XpJpF5YaKSPfVhv0= 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; bh=K6cGerCxO46Qm24iFA5aZEL6UdjUDW3jjNLe5Ls8bmw=; b=ijVnDaKyQTVXD7YFHkuEYy2dAeB6dq0uUWGgczUJzMTQRONcZ2uAGk+n9z4J5kY1he mZ0Nd8wwEBi3qRcjE2Rkp2JV6O24hLdA3RO7WiTceWZznq6QTDZomvlbAYfBSZPXSRoA d8+eAmZqVem19nfN5K+ZmNFjVZhrzvhAGRaWWCMgvAGIxoliL6xYLpKJTY18tNMTszHT NbxToqiazDAsLGrTaFk8ErtOSAmKMvN3u9EqMTQM5UbYCf9nz0iZRVy3/JOQ7lKkoUhI QruI9OLGIlKzknzF4OuW83x16Ye6ow77cY1SKdmNuzQFYZuKKVcKEUBHNwMCV1naxLno 1BOQ== X-Gm-Message-State: AOAM532y70rcJs5+q//2kKvFmICDHEIeNxNgULt/Cw480u4IVZQpNj/e YPBYqj32Zdb3nvqMtZgL0s5qHsuTB0wVAQ== X-Received: by 2002:a17:906:2618:: with SMTP id h24mr408773ejc.198.1599087582493; Wed, 02 Sep 2020 15:59:42 -0700 (PDT) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com. [209.85.221.50]) by smtp.gmail.com with ESMTPSA id n20sm1008033ejg.65.2020.09.02.15.59.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Sep 2020 15:59:41 -0700 (PDT) Received: by mail-wr1-f50.google.com with SMTP id t10so1092953wrv.1 for ; Wed, 02 Sep 2020 15:59:41 -0700 (PDT) X-Received: by 2002:a5d:4e0b:: with SMTP id p11mr416596wrt.32.1599087580861; Wed, 02 Sep 2020 15:59:40 -0700 (PDT) MIME-Version: 1.0 References: <1597380295-6297-1-git-send-email-wuxy@bitland.com.cn> <1597380295-6297-5-git-send-email-wuxy@bitland.com.cn> <20200831174057.GO31019@paasikivi.fi.intel.com> In-Reply-To: <20200831174057.GO31019@paasikivi.fi.intel.com> From: Tomasz Figa Date: Thu, 3 Sep 2020 00:59:20 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V3 3/3] media: i2c: gc5035: Add GC5035 image sensor driver To: Sakari Ailus Cc: Xingyu Wu , Mauro Carvalho Chehab , Rob Herring , "David S. Miller" , "shawnx.tu" , Hans Verkuil , "dave.stevenson" , Manivannan Sadhasivam , Cao Bing Bu , Nicolas Boichat , Linux Media Mailing List , Linux Kernel Mailing List , linux-devicetree , Dongchun Zhu , Sj Huang , darfur_liu , "hao.he7" , =?UTF-8?B?5L2V5rWpQjAzMjA1?= Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sakari, On Mon, Aug 31, 2020 at 7:41 PM Sakari Ailus wrote: > > Hi Xingyu, > > Thanks for the update. I've got a few more comments below. > > Do you happen to have some insight on what the OTP data contains and what > does the driver do with it? > > At least in principle the OTP data may be programmed for the customer so > the same sensor could contain something else what the driver expects to > find there. > Thanks for the review. For anything without my reply, assume fixed. :) As far as I can see, the data is being read from an area that is supposed to be reserved for Galaxycore, so I'd assume it doesn't depend on the customer. [snip] > > diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig > > index da11036..aeaf594 100644 > > --- a/drivers/media/i2c/Kconfig > > +++ b/drivers/media/i2c/Kconfig > > @@ -712,6 +712,18 @@ config VIDEO_APTINA_PLL > > config VIDEO_SMIAPP_PLL > > tristate > > > > +config VIDEO_GC5035 > > + tristate "Galaxycore GC5035 sensor support" > > + depends on I2C && VIDEO_V4L2 > > + select MEDIA_CONTROLLER > > + select VIDEO_V4L2_SUBDEV_API > > Add: > > V4L2_FWNODE > OF This driver doesn't depend on OF. It uses the firmware-independent property access API. (v4 I sent actually uses device_property_*()). [snip] > > +static int __gc5035_power_on(struct gc5035 *gc5035) > > +{ > > + struct device *dev = &gc5035->client->dev; > > + int i, ret; > > + > > + ret = clk_prepare_enable(gc5035->xvclk); > > + if (ret < 0) { > > + dev_err(dev, "Failed to enable xvclk\n"); > > + return ret; > > + } > > + > > + gpiod_set_value_cansleep(gc5035->reset_gpio, 1); > > + > > + for (i = 0; i < GC5035_NUM_SUPPLIES; i++) { > > + ret = regulator_enable(gc5035->supplies[i].consumer); > > + if (ret) { > > + dev_err(dev, "Failed to enable %s: %d\n", > > + gc5035->supplies[i].supply, ret); > > + goto disable_reg_clk; > > Please use regulator_bulk_enable() here, and regulator_bulk_disable() > below. > This actually needs to have one of the regulators (iovdd) enabled before the other ones, but regulator_bulk_enable() is async. In v4 I used regulator_enable() for iovdd and regulator_bulk_enable() for the other two for optimal sequencing. Best regards, Tomasz