From patchwork Fri Dec 20 22:23:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylwester Nawrocki X-Patchwork-Id: 3392131 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1BFFFC0D4A for ; Fri, 20 Dec 2013 22:24:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 468A620647 for ; Fri, 20 Dec 2013 22:24:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7594A206B1 for ; Fri, 20 Dec 2013 22:24:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753263Ab3LTWYU (ORCPT ); Fri, 20 Dec 2013 17:24:20 -0500 Received: from mail-wi0-f182.google.com ([209.85.212.182]:41767 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752636Ab3LTWYT (ORCPT ); Fri, 20 Dec 2013 17:24:19 -0500 Received: by mail-wi0-f182.google.com with SMTP id en1so4323674wid.9 for ; Fri, 20 Dec 2013 14:24:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=e/J4VpTQEbo89WKPv17ISWM0U/jBM/iv6yz9SaQr7s8=; b=XI8oREe5qUaBoIY45r/xidaWaiFpKPDaKdB8BqD42D6mMSD60KxhaTHNp5ndF2YB2d oIHJ0EhbW+WASMOaFlCTFVCv+YERuhnyXPwCoIUHo4jcfBcaKAYoTPdNUci1dYuScMxJ 7X2U/jA3+0AlNGWTSq3AFuH01q1ZBIK7oJ0upCb7o6FZfLEJYW0MawaSXzyAdZmzGUuu 8xvoa5htYKj1HRHlWdho6bHHqWWKg9bcRmJ29XLtPMcpSlyaYhjFK6A4AbBjhM5v4c9y SlEobQwU6yFvDYnjNzZ+Ec8eEYUr6aTFi04Au7U6LPTqcMBUZF3FN+PPIYtKSFNyAD+A 2O9w== X-Received: by 10.180.215.3 with SMTP id oe3mr9261931wic.35.1387578257869; Fri, 20 Dec 2013 14:24:17 -0800 (PST) Received: from localhost.localdomain (093105185086.warszawa.vectranet.pl. [93.105.185.86]) by mx.google.com with ESMTPSA id xl18sm19612162wib.9.2013.12.20.14.24.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 20 Dec 2013 14:24:17 -0800 (PST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki Subject: [PATCH 2/6] exynos4-is: Activate mipi-csis in probe() if runtime PM is disabled Date: Fri, 20 Dec 2013 23:23:23 +0100 Message-Id: <1387578207-17625-3-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1387578207-17625-1-git-send-email-s.nawrocki@samsung.com> References: <1387578207-17625-1-git-send-email-s.nawrocki@samsung.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Devices should also operate normally when runtime PM is not enabled. In case runtime PM is disabled activate the device already in probe(). Any related power domain needs to be then left permanently in active state by the platform. Signed-off-by: Sylwester Nawrocki --- drivers/media/platform/exynos4-is/mipi-csis.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/drivers/media/platform/exynos4-is/mipi-csis.c b/drivers/media/platform/exynos4-is/mipi-csis.c index 31dfc50..f3c3591 100644 --- a/drivers/media/platform/exynos4-is/mipi-csis.c +++ b/drivers/media/platform/exynos4-is/mipi-csis.c @@ -790,6 +790,7 @@ static int s5pcsis_parse_dt(struct platform_device *pdev, #define s5pcsis_parse_dt(pdev, state) (-ENOSYS) #endif +static int s5pcsis_pm_resume(struct device *dev, bool runtime); static const struct of_device_id s5pcsis_of_match[]; static int s5pcsis_probe(struct platform_device *pdev) @@ -902,13 +903,21 @@ static int s5pcsis_probe(struct platform_device *pdev) /* .. and a pointer to the subdev. */ platform_set_drvdata(pdev, &state->sd); memcpy(state->events, s5pcsis_events, sizeof(state->events)); + pm_runtime_enable(dev); + if (!pm_runtime_enabled(dev)) { + ret = s5pcsis_pm_resume(dev, true); + if (ret < 0) + goto e_m_ent; + } dev_info(&pdev->dev, "lanes: %d, hs_settle: %d, wclk: %d, freq: %u\n", state->num_lanes, state->hs_settle, state->wclk_ext, state->clk_frequency); return 0; +e_m_ent: + media_entity_cleanup(&state->sd.entity); e_clkdis: clk_disable(state->clock[CSIS_CLK_MUX]); e_clkput: @@ -1014,7 +1023,7 @@ static int s5pcsis_remove(struct platform_device *pdev) struct csis_state *state = sd_to_csis_state(sd); pm_runtime_disable(&pdev->dev); - s5pcsis_pm_suspend(&pdev->dev, false); + s5pcsis_pm_suspend(&pdev->dev, true); clk_disable(state->clock[CSIS_CLK_MUX]); pm_runtime_set_suspended(&pdev->dev); s5pcsis_clk_put(state);