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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3595FC433F5 for ; Mon, 14 Mar 2022 21:11:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245217AbiCNVMg (ORCPT ); Mon, 14 Mar 2022 17:12:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235370AbiCNVMf (ORCPT ); Mon, 14 Mar 2022 17:12:35 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51897FD28 for ; Mon, 14 Mar 2022 14:11:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647292285; x=1678828285; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=H3a0aLd+4dD9Z06hu5MXcDCGl14Dp3xjuGfVwTx367o=; b=fxnV+O+l8Ap+UKr2GRY0xiBVLRg6+//9vWGZ7zBNmbkg39OoaS9B23Fk NW58tpmLhYPpzFKTHP1uRhaFcT2+NFTqR4ARc6mc2sKdQNyxCUW8gWlPX z+swJEy3FwP/oMwNJueCwxR2hjD40Y3IagDyf7MvbBzdlA+EqgWbf0sRw 0dV5Yq2Y+xzRHvwdRwD3BRtWlzsE0zQww+ZUZR13jJervQJbrRIWWwlBd LL0mY3aYBBI6BwVOJUychTX5/gTQg4ps+GI4eerMzgM/Y8uF6s7GADBVC GlsJOuBiOApfSuT0ce1cfcWmHj54IEAs1S8VYOLma01Ei0ja9mMVM16VL A==; X-IronPort-AV: E=McAfee;i="6200,9189,10286"; a="243595787" X-IronPort-AV: E=Sophos;i="5.90,181,1643702400"; d="scan'208";a="243595787" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2022 14:11:24 -0700 X-IronPort-AV: E=Sophos;i="5.90,181,1643702400"; d="scan'208";a="556620131" Received: from punajuuri.fi.intel.com (HELO paasikivi.fi.intel.com) ([10.237.72.43]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2022 14:11:20 -0700 Received: from paasikivi.fi.intel.com (localhost [127.0.0.1]) by paasikivi.fi.intel.com (Postfix) with ESMTP id CB54520676; Mon, 14 Mar 2022 23:11:18 +0200 (EET) Date: Mon, 14 Mar 2022 23:11:18 +0200 From: Sakari Ailus To: Laurent Pinchart Cc: Paul Elder , Steve Longerbeam , Hans Verkuil , "Paul J. Murphy" , Martina Krasteva , Shawn Tu , Arec Kao , Kieran Bingham , Jimmy Su , Martin Kepplinger , Daniel Scally , Jacopo Mondi , Paul Kocialkowski , linux-media@vger.kernel.org Subject: Re: [PATCH v2] media: ov5640: Use runtime PM Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hi Laurent, On Mon, Mar 14, 2022 at 10:05:37PM +0200, Laurent Pinchart wrote: ... > > > Yes, after reading the version register (or doing any other harware > > > access). Actually the full code would be > > > > > > > > > pm_runtime_enable(dev); > > > pm_runtime_resume_and_get(dev); > > > > > > /* Hardware access */ > > > > > > pm_runtime_set_autosuspend_delay(dev, 1000); > > > pm_runtime_use_autosuspend(dev); > > > pm_runtime_put_autosuspend(dev); > > > > > > (plus error handling). > > > > > > If the probe function doesn't need to access the hardware, then > > > the above becomes > > > > > > pm_runtime_enable(dev); > > > pm_runtime_set_autosuspend_delay(dev, 1000); > > > pm_runtime_use_autosuspend(dev); > > > > > > instead of having to power up the device just in case !PM. > > > > > > > Also the latter only works on DT-based systems so it's not an option for > > > > most of the drivers. > > > > > > How so, what's wrong with the above for ACPI-based system ? > > > > I²C devices are already powered on for probe on ACPI based systems. > > Not through RPM I suppose ? Runtime PM isn't involved, this takes place in the ACPI framework (via dev_pm_domain_attach() called in i2c_device_probe()). -- Regards, Sakari Ailus