Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp308335pxk; Wed, 2 Sep 2020 23:32:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJqhZHlX+cUQCeq/Tkur3R4BT7f3CsCGgGuU/sNN8jwpmCnW2gpcye4Mt6w6z92tFMHYCi X-Received: by 2002:a17:906:95cd:: with SMTP id n13mr559081ejy.297.1599114738022; Wed, 02 Sep 2020 23:32:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599114738; cv=none; d=google.com; s=arc-20160816; b=GXDm55/ZVji8fX1Ag6DhFStp6cCVLPfQYdhnk34EgrjcRJBIrEkrRhyvb9VZWjSt28 HDOkoXckvaQRUyyF8BdDBdbOe+BqPU7hg9GGD8ryRZ0ASHjQWBj1FV1aejAAzoiEZXIr Idy9iLXiP5nz79oaPgoLeoKjbBzOtaKyGobyBbe4ZIOQSQVBjPwC0sYN0AQtHec8GFYs QCtAtKvJumHM7cMTi12wUcRv0Ulkry7hBDQuR9WFRAnUgSvnxL45F9+8BMrMKr2QSssU /WV1HqqsO9CRQkVvpWTBtRRXHPPnF/K6gusjt4uQkI3Qat6wYFc2yrANHoZJME6ULz3O HFrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=HvfXYSODK8B2M1j/AXNfFdvkbBSQ8S61qqfgtDUr9Qk=; b=o+LkdiQ5nHIVmj32+LYHh4bF5c6kZSdcfigCzXq+C32NKQWtIXElS/CN7SbRVXx7Xw EkZTnPmFrCAOVy5qmVqLlCZj18MQAfYh6xmJlgmKq6BcEbne9yHAG8e2+W6ZjNxxkIjn qzNwNPK1XxuljacluksueXAaDzNYiOp+7AnNiJu3vbRT3Nde5EHnKjTI0ELgTwWwJHhM H4iUHwQJ3J4T23Mxr6h14vjqcGjnkn6CEk/rR/QLTn7n2heyq1J3uLb2c79PuAxYwzmD xRsqM+W2Khz5ybsdgEYGU6snyEAHmLXcuCBD91ttBcwIynLegyOylnWpJ9epYF179Fm2 cMug== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f12si1283846edx.142.2020.09.02.23.31.53; Wed, 02 Sep 2020 23:32:18 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726109AbgICGav (ORCPT + 99 others); Thu, 3 Sep 2020 02:30:51 -0400 Received: from mga17.intel.com ([192.55.52.151]:12741 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725919AbgICGau (ORCPT ); Thu, 3 Sep 2020 02:30:50 -0400 IronPort-SDR: i1oxDGt4k5KE9EG3KCUfj5UcEp+iHG78eExBNHZx4QZppcawUfD/r0AcZZm4CXt7VmcODRdUtA k7mfJLBw9chg== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="137578471" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="137578471" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 23:30:49 -0700 IronPort-SDR: pjZ7tQiDH/pCeyrz+Pdq6Kot+MmMA25BcyAf0ohtVbNOLyFSScDOLezfgHo03oP1a9txzijsuT nIOW6kZKD3QQ== X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="477934111" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 23:30:45 -0700 Received: by paasikivi.fi.intel.com (Postfix, from userid 1000) id 08AB72034D; Thu, 3 Sep 2020 09:30:43 +0300 (EEST) Date: Thu, 3 Sep 2020 09:30:42 +0300 From: Sakari Ailus To: Tomasz Figa 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?= Subject: Re: [PATCH V3 3/3] media: i2c: gc5035: Add GC5035 image sensor driver Message-ID: <20200903063042.GH32646@paasikivi.fi.intel.com> 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> 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 Tomasz, On Thu, Sep 03, 2020 at 12:59:20AM +0200, Tomasz Figa wrote: > 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. Sounds good. > > [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_*()). Yes, this is even better. > > [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. Ack. -- Sakari Ailus