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=-2.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 431D4C433E0 for ; Wed, 27 May 2020 21:12:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 01F9C207E8 for ; Wed, 27 May 2020 21:12:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KONYn0Ym" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01F9C207E8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=y8WsqxK3n/BjJ5JMWP0fbzVF9hZ34TJT/eMZWjugCHg=; b=KONYn0YmXwUKN8 oMK4PtBIIw90B8zazG5AM7cyDyzCtpizVhMvZSXUDOCPHy1RYOinDk7UpvSPMsnjk8rHcuRK342E9 zz2z9g9eXR/TOX9jORqnRmprEX3ezP54N9lLJbQ2XoqcFpdAXdp6ceK5bcDe7WX6P2H7BLxDq8jcb vy+RfZfHnCHo/B/PJah684XjgTuLmHyNlrGwknsvOgN3RteNzF1F+FopxE3JNepOdhgnvww3AzDJp 6WXIPef1oYaU446YMBi0wbsTZW9FyPphF/rQVVTwl5tO5BhBECslVgu7qyHb/6KJ9aLMgGHubsXyo DlGYbRbeFABwAal3yw6Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1je3LH-000629-Eu; Wed, 27 May 2020 21:12:03 +0000 Received: from mga17.intel.com ([192.55.52.151]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1je3LE-00061m-C7; Wed, 27 May 2020 21:12:01 +0000 IronPort-SDR: sNnjk/yC9LnIXycVS4JxR9mjlC4LdkcTOD/G8eS5O+R6pLIP7k4iQ0sMsPu3ARqYghBO8ruetQ U+8edm5gp7ug== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2020 14:11:59 -0700 IronPort-SDR: ZCZn22c4t0Kf4WafHmfwy6fPyENsMjl0y7aCtmUolIaeqy5VZ3cwjdvpDtqwYxgHkLtyy1f9+6 CeMReU8g/sPw== X-IronPort-AV: E=Sophos;i="5.73,442,1583222400"; d="scan'208";a="284940319" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2020 14:11:55 -0700 Received: by paasikivi.fi.intel.com (Postfix, from userid 1000) id 0E362206EA; Thu, 28 May 2020 00:11:53 +0300 (EEST) Date: Thu, 28 May 2020 00:11:53 +0300 From: Sakari Ailus To: Tomasz Figa Subject: Re: [V6, 2/2] media: i2c: dw9768: Add DW9768 VCM driver Message-ID: <20200527211152.GS7618@paasikivi.fi.intel.com> References: <20200518132731.20855-1-dongchun.zhu@mediatek.com> <20200518132731.20855-3-dongchun.zhu@mediatek.com> <20200521195113.GC14214@chromium.org> <1590139561.8804.390.camel@mhfsdcap03> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200527_141200_428957_9F190501 X-CRM114-Status: GOOD ( 18.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Nicolas Boichat , Andy Shevchenko , srv_heupstream , linux-devicetree , Linus Walleij , Shengnan Wang =?utf-8?B?KOeOi+Wco+eUtyk=?= , Bartosz Golaszewski , Sj Huang , Rob Herring , "moderated list:ARM/Mediatek SoC support" , Dongchun Zhu , Louis Kuo , Matthias Brugger , Cao Bing Bu , Mauro Carvalho Chehab , "list@263.net:IOMMU DRIVERS , Joerg Roedel , " , Linux Media Mailing List Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, May 25, 2020 at 01:45:07PM +0200, Tomasz Figa wrote: > On Fri, May 22, 2020 at 11:27 AM Dongchun Zhu wrote: > > > > Hi Tomasz, > > > > Thanks for the review. My replies are as below. > > > > On Thu, 2020-05-21 at 19:51 +0000, Tomasz Figa wrote: > > > Hi Dongchun, Sakari, > > > > > > On Mon, May 18, 2020 at 09:27:31PM +0800, Dongchun Zhu wrote: > [snip] > > > > + pm_runtime_enable(dev); > > > > + if (!pm_runtime_enabled(dev)) { > > > > + ret = dw9768_runtime_resume(dev); > > > > + if (ret < 0) { > > > > + dev_err(dev, "failed to power on: %d\n", ret); > > > > + goto entity_cleanup; > > > > + } > > > > + } > > > > + > > > > + ret = v4l2_async_register_subdev(&dw9768->sd); > > > > + if (ret < 0) > > > > + goto entity_cleanup; > > > > + > > > > + return 0; > > > > + > > > > +entity_cleanup: > > > > > > Need to power off if the code above powered on. > > > > > > > Thanks for the reminder. > > If there is something wrong with runtime PM, actuator is to be powered > > on via dw9768_runtime_resume() API. > > When actuator sub-device is powered on completely and async registered > > successfully, we shall power off it afterwards. > > > > The code above calls dw9768_runtime_resume() if > !pm_runtime_enabled(dev), but the clean-up code below the > entity_cleanup label doesn't have the corresponding > dw9768_runtime_suspend() call. Yes, an example on using runtime PM can be found in e.g. ov8856 driver. The open / release callbacks seem fine though. Sensors just don't need them as they have the streaming state (and s_stream). -- Sakari Ailus _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel