Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp491105ybn; Thu, 3 Oct 2019 08:00:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPweRkQjDdkpP1K62pRB++B2NqqHORKoTptZAlRmz6/SfSIJfjsXXgTU3HQ+Xo6779+/uf X-Received: by 2002:a05:6402:2054:: with SMTP id bc20mr10395753edb.55.1570114809354; Thu, 03 Oct 2019 08:00:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570114809; cv=none; d=google.com; s=arc-20160816; b=RL2UeIpvqjuZxKGb83BnXnPlptAAo6/OYg43ROUL0bJcEQ5bYM59CgfXjrv0lP60AZ Qve+S9nX+5+sI32ZFYrjgan/9vLTKhyN1fPt9EDfU9XVS5FknA9ChY/IrG6N689H5c47 MfIUCVkIRSxZoGSjW7P0Kir8/VNV84R3N5DOvA2obejUrf2/UuZZOTkhzYx8QeplrHYa eiujkYk5jMJ2+HXUYwuhuZh+7eXobRltpwvKd6LzlGFxFS9nwQ+6mCqExWvkkH8fsewk CysWGaG9cRtnTDfP3SE23nP4xqifHJ7enBXatCTy4qqpRdaXsEvyH3ihQp3ZxpJ4bRqt /ifw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=kGap1M7x7siN59Y9bN/tco7EI3h7G/haqxZKUl5gYRg=; b=c/KmkY7c9OaIp+i/PPfJuUtCE98JMK7s+Bf3HsDC/mhAG/OV8zZmf832plB9L5iria sPGn1+mlJ/+299MyhEZf8CIjBzG23tEHyIZNHN01Ty076/rvrW+xvC7KWBvpKOAIY7v6 b3OK7If50LniaFFCfbrVcaz1RHAm8BcBvK1Uyb8TG5i1px5xes7Hmyn++Ic2ZtWSo7P6 Z1j7+qRzXooi4g57imeBK32hi7iz2+zxuZDPKo1LjHuSAvswvxNJzcSJ53uy+Cm98zZO lLHReLkItUvb/Q2mUvA8wwoxdxtOOnBqTtCrDQOU2iX++4dGeyvr0zn7lTliITu8obDh iAcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@qtec.com header.s=google header.b=FoesvKeM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pw28si1317929ejb.43.2019.10.03.07.59.43; Thu, 03 Oct 2019 08:00:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@qtec.com header.s=google header.b=FoesvKeM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730382AbfJCOqm (ORCPT + 99 others); Thu, 3 Oct 2019 10:46:42 -0400 Received: from mail-lj1-f176.google.com ([209.85.208.176]:45840 "EHLO mail-lj1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725932AbfJCOqm (ORCPT ); Thu, 3 Oct 2019 10:46:42 -0400 Received: by mail-lj1-f176.google.com with SMTP id q64so3042503ljb.12 for ; Thu, 03 Oct 2019 07:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qtec.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kGap1M7x7siN59Y9bN/tco7EI3h7G/haqxZKUl5gYRg=; b=FoesvKeMUXHzkF/GBKAQ5aP0RSh5oB5ciSDaUTgRofajHkduvQXqC0wxyYBlkhpV2p 1DNAvittZ3Z05OJT3OH3qn7IbkawPyCmLl/l8nbTT9KSypL7d+2D2H7vMmQFCv9+bXBz EFDCLRnSGEpfWXiqHscjq5zxjRrr1ST+rGmVU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kGap1M7x7siN59Y9bN/tco7EI3h7G/haqxZKUl5gYRg=; b=iNSqhxf/9mF2Wtfq3EjGvggQ80DQbhcZYdeto2oIjQ0rR2861h+LmGNy4A4DY2q9oq nbFxk5f5yAdXvaAplRib85h6CevY8GWjt1CaBRI+uv7X63v7ynyWUwgd+iRvBQ9li6hX veOjGT5SKdUL0g+Z1ajHDgNRue/FHvt83lfWqkViLznS/GX705MzNoJIw7Hyv8grWKT8 Ei3WRa3ocIy314Qr9tq3Q40cRexMtFjUx5pT4JjLov3ouwdm0u/d4N1LDzjT2+I6bv1H QXfuJGQ403vueu36By9y11Dk9gWKJfxGDFvtUBqX3RcJjUpbOHHnmub38P6ADlavZhNA kIuw== X-Gm-Message-State: APjAAAXEKlaCTHFGn5MfIaUQku+1LiV6gcQoaIjKuxBeexNtwhi21h/L LzfVCXhXWYF/cxy+7cpDHJfhNQ== X-Received: by 2002:a2e:91d0:: with SMTP id u16mr6303059ljg.164.1570113999499; Thu, 03 Oct 2019 07:46:39 -0700 (PDT) Received: from turia.qtec.com (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by smtp.gmail.com with ESMTPSA id p27sm503900lfo.95.2019.10.03.07.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2019 07:46:38 -0700 (PDT) From: Daniel Gomez To: Ricardo Ribalda Delgado , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Gomez Subject: [PATCH] media: imx214: Fix stop streaming Date: Thu, 3 Oct 2019 16:46:24 +0200 Message-Id: <20191003144624.17899-1-daniel@qtec.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Stop video streaming when requested. When s_stream is called to stop the video streaming, if/else condition calls start_streaming function instead of the one for stopping it. Fixes: 436190596241 ("media: imx214: Add imx214 camera sensor driver") Signed-off-by: Daniel Gomez --- You can find some logs before/after running in the hardware. Notice 0x100 register is for starting/stopping the video streaming from the imx214 sensor. * Before patch: # media-ctl -d /dev/media0 -l '"msm_csiphy0":1->"msm_csid0":0[1],"msm_csid0":1->"msm_ispif0":0[1],"msm_ispif0":1->"msm_vfe0_rdi0":0[1]' # media-ctl -d /dev/media0 -V '"imx214 3-001a":0[fmt:SRGGB10/1920x1080],"msm_csiphy0":0[fmt:SRGGB10/1920x1080],"msm_csid0":0[fmt:SRGGB10/1920x1080],"msm_ispif0":0[fmt:SRGGB10/1920x1080],"msm_vfe0_rdi0":0[fmt:SRGGB10/1920x1080]' # yavta -f SRGGB10P -s 1920x1080 -n 1 --capture=5 /dev/v4l/by-path/platform-a34000.camss-video-index0 Device /dev/v4l/by-path/platform-a34000.camss-video-index0 opened. Device `Qualcomm Camera Subsystem' on `platform:a34000.camss' (driver 'qcom-camss') supports video, capture, with mplanes. Video format set: SRGGB10P (41415270) 1920x1080 field none, 1 planes: * Stride 2400, buffer size 2592000 Video format: SRGGB10P (41415270) 1920x1080 field none, 1 planes: * Stride 2400, buffer size 2592000 1 buffers requested. length: 1 offset: 4093609832 timestamp type/source: mono/EoF Buffer 0/0 mapped at address 0xffff84b6b000. 0 (0) [-] none 0 2592000 B 30.682759 30.705111 4.697 fps ts mono/EoF 1 (0) [-] none 1 2592000 B 30.749391 30.771609 15.008 fps ts mono/EoF 2 (0) [-] none 2 2592000 B 30.816042 30.838225 15.004 fps ts mono/EoF 3 (0) [-] none 3 2592000 B 30.882690 30.904992 15.004 fps ts mono/EoF 4 (0) [-] none 4 2592000 B 30.949333 30.971543 15.005 fps ts mono/EoF Captured 5 frames in 0.501681 seconds (9.966480 fps, 0.000000 B/s). 1 buffers released. # v4l2-dbg -d /dev/v4l-subdev19 -g 0x100 ioctl: VIDIOC_DBG_G_REGISTER Register 0x00000100 = 1h (1d 00000001b) * After patch: # media-ctl -d /dev/media0 -l '"msm_csiphy0":1->"msm_csid0":0[1],"msm_csid0":1->"msm_ispif0":0[1],"msm_ispif0":1->"msm_vfe0_rdi0":0[1]' # media-ctl -d /dev/media0 -V '"imx214 3-001a":0[fmt:SRGGB10/1920x1080],"msm_csiphy0":0[fmt:SRGGB10/1920x1080],"msm_csid0":0[fmt:SRGGB10/1920x1080],"msm_ispif0":0[fmt:SRGGB10/1920x1080],"msm_vfe0_rdi0":0[fmt:SRGGB10/1920x1080]' # yavta -f SRGGB10P -s 1920x1080 -n 1 --capture=5 /dev/v4l/by-path/platform-a34000.camss-video-index0 Device /dev/v4l/by-path/platform-a34000.camss-video-index0 opened. Device `Qualcomm Camera Subsystem' on `platform:a34000.camss' (driver 'qcom-camss') supports video, capture, with mplanes. Video format set: SRGGB10P (41415270) 1920x1080 field none, 1 planes: * Stride 2400, buffer size 2592000 Video format: SRGGB10P (41415270) 1920x1080 field none, 1 planes: * Stride 2400, buffer size 2592000 1 buffers requested. length: 1 offset: 3764913896 timestamp type/source: mono/EoF Buffer 0/0 mapped at address 0xffffb62f7000. 0 (0) [-] none 0 2592000 B 31.283473 31.306390 4.697 fps ts mono/EoF 1 (0) [-] none 1 2592000 B 31.350115 31.372475 15.006 fps ts mono/EoF 2 (0) [-] none 2 2592000 B 31.416765 31.439728 15.004 fps ts mono/EoF 3 (0) [-] none 3 2592000 B 31.483410 31.505791 15.005 fps ts mono/EoF 4 (0) [-] none 4 2592000 B 31.550058 31.573025 15.004 fps ts mono/EoF Captured 5 frames in 0.502440 seconds (9.951430 fps, 0.000000 B/s). 1 buffers released. # v4l2-dbg -d /dev/v4l-subdev19 -g 0x100 ioctl: VIDIOC_DBG_G_REGISTER Register 0x00000100 = 0h (0d 00000000b) drivers/media/i2c/imx214.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c index 159a3a604f0e..24659cb0d083 100644 --- a/drivers/media/i2c/imx214.c +++ b/drivers/media/i2c/imx214.c @@ -785,7 +785,7 @@ static int imx214_s_stream(struct v4l2_subdev *subdev, int enable) if (ret < 0) goto err_rpm_put; } else { - ret = imx214_start_streaming(imx214); + ret = imx214_stop_streaming(imx214); if (ret < 0) goto err_rpm_put; pm_runtime_put(imx214->dev); -- 2.20.1