Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp286540ybb; Fri, 3 Apr 2020 02:42:43 -0700 (PDT) X-Google-Smtp-Source: APiQypLX5vpzpcUczu2YZX5PHK0O+IQruai+iUu3pzIH7t6/HSREjY7Z1YsNj+MqFDgxHAwGbguI X-Received: by 2002:a9d:548:: with SMTP id 66mr5145434otw.227.1585906963399; Fri, 03 Apr 2020 02:42:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585906963; cv=none; d=google.com; s=arc-20160816; b=COztoA/f3d8nMJREReZ0Mi0LAtHhm6ngy4L/PUkwUKTH9d5tODixH23DkYRAr2J49u JjsY7esXheZpbOynNckLPXgOr+6DGn5ZoSprQDcQRGLqn7TstfumjvqVKrYdDuZIA+CN jQl+mb4fNyUvusu1MciyzYLoiOPJHkgxHF6VW4Vz4INNdZJ6PE/+NLgnY+Auz9lYkl/G lBtLUgMzs9ol55VjW8wNJ6fsmmmQxXrO0dF7epMiE7wsGaQF6DJI9ZEBxOb4sGIkTj4w Pa3N0WxTIg1CsZ/BKRsVkXYAp3hXAuue2y8A0rcsmNHY9hwywqdoKYCjQas7dqTlqJH0 qwbw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pm/C6wkpcwoRE/CCieW0EFzNKBkWkCFOYLbu5+5Ga74=; b=fLoGLoWdeNQyLIwSjYtG+eebOWIdNzxpbI+j8hiC8Egypmi/P/din7Nua6ykopktRF ct2Fhfy0C1hXoW3K3Aa/HflNtVeTnhEgf56uIra/gQn8VXxtidF5ubimZS2xsV6ZSJVq EC560/g1FwosRKD36beTPVcbFxu4byDw4fhkoc6JmyQc/aav2S9xlvcnshiE9TbrWiaV M0NlJUF/+TWipmmoKX4zvLrksv26OuPzGAEoVHHtKITqaRjHiqyp4GEDBsusQO5gi/G1 aSxFXoPp0agMxf3ZnlpjvUFCoy4xWuQnJ9mzl6ajxngCwyC5KVkQqWBpdzB/EeTVi8ue aecg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=mAkq41iZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w65si3779391ooa.42.2020.04.03.02.42.30; Fri, 03 Apr 2020 02:42:43 -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=@mediatek.com header.s=dk header.b=mAkq41iZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403779AbgDCJku (ORCPT + 99 others); Fri, 3 Apr 2020 05:40:50 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:36555 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2390702AbgDCJkp (ORCPT ); Fri, 3 Apr 2020 05:40:45 -0400 X-UUID: 940d031f705f423cbf2016f97a7028a7-20200403 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=pm/C6wkpcwoRE/CCieW0EFzNKBkWkCFOYLbu5+5Ga74=; b=mAkq41iZCfO1aP0e5kXXhKJUNEhVDFlDH42XUxx+qmD8eyH2bDlrpcMx8fm04xbglvjSiYaYreptPwXv8oFubSz3ekVbqe92azTA97PwTOERvP2VnBmxWHob8h218p9/OuC/KwTYRY9LJpZRc6jYPPiB98jk8OG3TmZnzYCbUic=; X-UUID: 940d031f705f423cbf2016f97a7028a7-20200403 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1495600782; Fri, 03 Apr 2020 17:40:41 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 3 Apr 2020 17:40:37 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 3 Apr 2020 17:40:36 +0800 From: Xia Jiang To: Hans Verkuil , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Rick Chang CC: , , , , , Marek Szyprowski , Tomasz Figa , , , , , , , Xia Jiang Subject: [PATCH v8 05/14] media: platform: Improve power on and power off flow Date: Fri, 3 Apr 2020 17:40:24 +0800 Message-ID: <20200403094033.8288-6-xia.jiang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200403094033.8288-1-xia.jiang@mediatek.com> References: <20200403094033.8288-1-xia.jiang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Q2FsbCBwbV9ydW50aW1lX2dldF9zeW5jKCkgYmVmb3JlIHN0YXJ0aW5nIGEgZnJhbWUgYW5kIHRo ZW4NCnBtX3J1bnRpbWVfcHV0KCkgYWZ0ZXIgY29tcGxldGluZyBpdC4gVGhpcyBjYW4gc2F2ZSBw b3dlciBmb3IgdGhlI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