From patchwork Fri Oct 15 06:08:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bingbu Cao X-Patchwork-Id: 12560051 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A31DDC433F5 for ; Fri, 15 Oct 2021 06:12:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8366A60E09 for ; Fri, 15 Oct 2021 06:12:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231992AbhJOGOn (ORCPT ); Fri, 15 Oct 2021 02:14:43 -0400 Received: from mga12.intel.com ([192.55.52.136]:64319 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231445AbhJOGOl (ORCPT ); Fri, 15 Oct 2021 02:14:41 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10137"; a="207971933" X-IronPort-AV: E=Sophos;i="5.85,375,1624345200"; d="scan'208";a="207971933" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2021 23:12:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,375,1624345200"; d="scan'208";a="443101839" Received: from ipu5-build.bj.intel.com ([10.238.232.188]) by orsmga003.jf.intel.com with ESMTP; 14 Oct 2021 23:12:33 -0700 From: Bingbu Cao To: linux-media@vger.kernel.org, sakari.ailus@linux.intel.com, dongchun.zhu@mediatek.com, tfiga@chromium.org Cc: tian.shu.qiu@intel.com, bingbu.cao@intel.com, bingbu.cao@linux.intel.com Subject: [PATCH] media: dw9768: activate runtime PM and turn off device Date: Fri, 15 Oct 2021 14:08:39 +0800 Message-Id: <1634278119-32158-1-git-send-email-bingbu.cao@intel.com> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org When dw9768 working with ACPI systems, the dw9768 was turned by i2c-core during probe, driver need activate the PM runtime and ask runtime PM to turn off the device. Signed-off-by: Bingbu Cao --- drivers/media/i2c/dw9768.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/i2c/dw9768.c b/drivers/media/i2c/dw9768.c index c086580efac7..65c6acf3ced9 100644 --- a/drivers/media/i2c/dw9768.c +++ b/drivers/media/i2c/dw9768.c @@ -469,6 +469,11 @@ static int dw9768_probe(struct i2c_client *client) dw9768->sd.entity.function = MEDIA_ENT_F_LENS; + /* + * Device is already turned on by i2c-core with ACPI domain PM. + * Attempt to turn off the device to satisfy the privacy LED concerns. + */ + pm_runtime_set_active(dev); pm_runtime_enable(dev); if (!pm_runtime_enabled(dev)) { ret = dw9768_runtime_resume(dev); @@ -483,6 +488,7 @@ static int dw9768_probe(struct i2c_client *client) dev_err(dev, "failed to register V4L2 subdev: %d", ret); goto err_power_off; } + pm_runtime_idle(dev); return 0;