Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp304083pxa; Wed, 12 Aug 2020 02:23:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2TsrF4bytFht41PSFJ7HwI/6tLna+/yCeCqcLwsW53lEctHE8dJOBv7HeiuVXN8tJkPun X-Received: by 2002:a17:907:aaa:: with SMTP id bz10mr29761923ejc.304.1597224232514; Wed, 12 Aug 2020 02:23:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597224232; cv=none; d=google.com; s=arc-20160816; b=ZeDu+26sEgy/bSkGa9bveZSWq68Fn2Xbye38jh+dtP7P0dqcRsJlA0XuLPc1yeU8kC dyW7r7mB+q1nuyI2Kt4MH/X1FI4ooWWkZw1lHCUUnLECyTgHsspJH6lkZrGiz2CNqWIl QZY14pcDEh4bK6Th0D/ymKc4Co4eyAY5pOJfsiGGOxvGEoXsVqp8YfWk0KYLpAttzF+X INyNWm0p3j33AlemSTs8d8jhMcqtvpnBKU93Uylfzze/2OUOfBFlFqvy6osMAboIk7Ma Bm5Mv+pwXuWT/64LeTiUQk/yTFAgbA20XNXn4nMD5xNad81YV4lcKpp7Pc2gyKtKX88B Mr4Q== 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=CiGc3kYDXHNJyDWVhqMyXtG6qtMzCA+d2lWF4lhKwLY=; b=ZKMVmuU4u2zXfroW6JxRTtYQQsK2PDaSZYhv2lXIbfg9Oovfsj+nNebPwWNBMK0LtX qqVa5muxOtHk1Ngd+8SS9qJA9erVBiStaCWrDFDJIauTqpQmRUYgGkbOGPMU1Dh1ZSsX gV7C8xEXlC3djk4FHpbo3GOoTNGMSggN9bGpeZbTTM6sCX3hCgK4uhf/bzw2h0s0zvTd 3gAmU7S/YvwL8pqmcnoOv5EtwHvrv5M28Iu0CKxdCCvXnHYet4LQjxvwdteltbSm9fCu 26FROjN+DHSQCm8VvelFy15qA1gaPD0FAIy/R7lL4cB7OHlJkYY67Xd33dH5gKeD6UOf gdng== 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 v6si945843edi.91.2020.08.12.02.23.30; Wed, 12 Aug 2020 02:23:52 -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 S1727791AbgHLJWW (ORCPT + 99 others); Wed, 12 Aug 2020 05:22:22 -0400 Received: from mga12.intel.com ([192.55.52.136]:51828 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbgHLJWW (ORCPT ); Wed, 12 Aug 2020 05:22:22 -0400 IronPort-SDR: jFnhjxRwcQ3aHPOchsz20rCN2MqpV+O0CJjE6JrZl/QHG5JoTal6W/P75edOeH5ltEQIh1p1AQ lffcaD8aEs3A== X-IronPort-AV: E=McAfee;i="6000,8403,9710"; a="133448725" X-IronPort-AV: E=Sophos;i="5.76,303,1592895600"; d="scan'208";a="133448725" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2020 02:22:21 -0700 IronPort-SDR: QzZvGoaNu725tcJ3kPSkdq+/bdS/VEYAMGvlLi7ua24oPzZQufo2dbS/0GPWcjIq40Pb9RDKf/ IrY3MqhaP5bg== X-IronPort-AV: E=Sophos;i="5.76,303,1592895600"; d="scan'208";a="369227319" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2020 02:22:17 -0700 Received: by paasikivi.fi.intel.com (Postfix, from userid 1000) id CEBC920859; Wed, 12 Aug 2020 12:22:15 +0300 (EEST) Date: Wed, 12 Aug 2020 12:22:15 +0300 From: Sakari Ailus To: Bingbu Cao Cc: linux-i2c@vger.kernel.org, Wolfram Sang , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, Bingbu Cao , linux-media@vger.kernel.org, Chiranjeevi Rapolu , Hyungwoo Yang , Bartosz Golaszewski , Arnd Bergmann , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , rajmohan.mani@intel.com, Tomasz Figa , "Qiu, Tian Shu" Subject: Re: [PATCH v5 3/6] ov5670: Support probe whilst the device is in a low power state Message-ID: <20200812092215.GL16270@paasikivi.fi.intel.com> References: <20200810142747.12400-1-sakari.ailus@linux.intel.com> <20200810142747.12400-4-sakari.ailus@linux.intel.com> <7a1fa217-7fd1-1d36-0b1c-ad5d09ea11a0@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7a1fa217-7fd1-1d36-0b1c-ad5d09ea11a0@linux.intel.com> 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 Bingbu, Thanks for the review. On Wed, Aug 12, 2020 at 05:12:28PM +0800, Bingbu Cao wrote: > > > On 8/10/20 10:27 PM, Sakari Ailus wrote: > > Tell ACPI device PM code that the driver supports the device being in a > > low power state when the driver's probe function is entered. > > > > Signed-off-by: Sakari Ailus > > --- > > drivers/media/i2c/ov5670.c | 23 ++++++++++++++--------- > > 1 file changed, 14 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c > > index f26252e35e08d..1f75b888d2a18 100644 > > --- a/drivers/media/i2c/ov5670.c > > +++ b/drivers/media/i2c/ov5670.c > > @@ -2456,6 +2456,7 @@ static int ov5670_probe(struct i2c_client *client) > > struct ov5670 *ov5670; > > const char *err_msg; > > u32 input_clk = 0; > > + bool low_power; > > int ret; > > > > device_property_read_u32(&client->dev, "clock-frequency", &input_clk); > > @@ -2472,11 +2473,14 @@ static int ov5670_probe(struct i2c_client *client) > > /* Initialize subdev */ > > v4l2_i2c_subdev_init(&ov5670->sd, client, &ov5670_subdev_ops); > > > > - /* Check module identity */ > > - ret = ov5670_identify_module(ov5670); > > - if (ret) { > > - err_msg = "ov5670_identify_module() error"; > > - goto error_print; > > + low_power = acpi_dev_state_low_power(&client->dev); > > + if (!low_power) { > > + /* Check module identity */ > > + ret = ov5670_identify_module(ov5670); > > + if (ret) { > > + err_msg = "ov5670_identify_module() error"; > > + goto error_print; > > + > > Sakari, thanks for your patch. > one question - With this change, there will be no chance for driver to guarantee > that the camera sensor plugged in is the camera that the matched driver actually > can drive until try to streaming the camera, so is it necessary to return > appropriate error in .s_stream ops to notify user it is not the hardware that > current driver can drive? if no other better way. Indeed sensor identification is now skipped in probe. I'll add that for v6 --- and check other drivers, too. -- Kind regards, Sakari Ailus