From patchwork Fri Sep 1 22:08:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chiranjeevi Rapolu X-Patchwork-Id: 9935357 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5E34D6021C for ; Fri, 1 Sep 2017 22:10:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 518BC28497 for ; Fri, 1 Sep 2017 22:10:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 436312850E; Fri, 1 Sep 2017 22:10:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0DA9284B2 for ; Fri, 1 Sep 2017 22:10:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752563AbdIAWKD (ORCPT ); Fri, 1 Sep 2017 18:10:03 -0400 Received: from mga06.intel.com ([134.134.136.31]:41371 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752400AbdIAWKC (ORCPT ); Fri, 1 Sep 2017 18:10:02 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP; 01 Sep 2017 15:10:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,459,1498546800"; d="scan'208";a="1213636938" Received: from crapolu-desk.sc.intel.com ([10.3.62.62]) by fmsmga002.fm.intel.com with ESMTP; 01 Sep 2017 15:10:01 -0700 From: Chiranjeevi Rapolu To: linux-media@vger.kernel.org, sakari.ailus@linux.intel.com Cc: tfiga@chromium.org, jian.xu.zheng@intel.com, tian.shu.qiu@intel.com, rajmohan.mani@intel.com, hyungwoo.yang@intel.com, Chiranjeevi Rapolu Subject: [PATCH v1] media: ov5670: Fix not streaming issue after resume. Date: Fri, 1 Sep 2017 15:08:31 -0700 Message-Id: <1504303711-16227-1-git-send-email-chiranjeevi.rapolu@intel.com> X-Mailer: git-send-email 1.9.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Previously, the sensor was not streaming after resume from suspend, i.e. on S0->S3->S0 transition. Due to this, camera app preview appeared as stuck. Now, handle streaming state correctly in case of suspend-resume. Signed-off-by: Chiranjeevi Rapolu --- drivers/media/i2c/ov5670.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c index 6f7a1d6..bdfb5b9 100644 --- a/drivers/media/i2c/ov5670.c +++ b/drivers/media/i2c/ov5670.c @@ -2323,8 +2323,6 @@ static int ov5670_start_streaming(struct ov5670 *ov5670) return ret; } - ov5670->streaming = true; - return 0; } @@ -2338,8 +2336,6 @@ static int ov5670_stop_streaming(struct ov5670 *ov5670) if (ret) dev_err(&client->dev, "%s failed to set stream\n", __func__); - ov5670->streaming = false; - /* Return success even if it was an error, as there is nothing the * caller can do about it. */ @@ -2370,6 +2366,7 @@ static int ov5670_set_stream(struct v4l2_subdev *sd, int enable) ret = ov5670_stop_streaming(ov5670); pm_runtime_put(&client->dev); } + ov5670->streaming = enable; goto unlock_and_return; error: