From patchwork Mon Oct 24 15:55:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dwivedi, Avaneesh Kumar (avani)" X-Patchwork-Id: 9392431 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 523D86086B for ; Mon, 24 Oct 2016 15:56:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44C3C2907F for ; Mon, 24 Oct 2016 15:56:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3960F290E9; Mon, 24 Oct 2016 15:56:28 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 D3D96290DE for ; Mon, 24 Oct 2016 15:56:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941117AbcJXP41 (ORCPT ); Mon, 24 Oct 2016 11:56:27 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:55455 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941039AbcJXP40 (ORCPT ); Mon, 24 Oct 2016 11:56:26 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BC99E61BD1; Mon, 24 Oct 2016 15:56:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1477324585; bh=mgNBtI4t3GlNbSrdIx/2R7m5gdNaTVyFGSrXeOiPEbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xn4z6NiXXaukv0EBJmS9ACJvlUp0Fyk5tV7yHLVew4rhzGz5+mqxgEBE3CKHBBGAh j4kVLhL97PZWQUbnhr2Cum75scYiZzlowDWk45A0Tj0clEiLRMjUz5KD53EGBjaT6B q48XZscZ2pxcUyCuvKFOfLzFQ73kBp/OqwAm7pws= Received: from akdwived-linux.qualcomm.com (unknown [202.46.23.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: akdwived@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3CF6661BF7; Mon, 24 Oct 2016 15:56:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1477324584; bh=mgNBtI4t3GlNbSrdIx/2R7m5gdNaTVyFGSrXeOiPEbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZmzHGamWXstaFBLXz/gPkPc0aDv8v1vTbwvb+JRRsrHsf5CTR3ZoIxpnDHtbcRXeZ yKxt9O7d1RtvWEY+kiWNxjT/pIDxSwf23XOVkfDXj59QW6FuHkmvs/4Z1rlxjQ9/zu 7diyKfqjq4sUO47pnT5kp105Gpf7I2JCoRtd6c7w= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 3CF6661BF7 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=akdwived@codeaurora.org From: Avaneesh Kumar Dwivedi To: bjorn.andersson@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-arm-msm@vger.kernel.org, spjoshi@codeaurora.org, akdwived@codeaurora.org, kaushalk@codeaurora.org Subject: [PATCH 5/5] remoteproc: Modifying probe for initializing q6v55 specific resources Date: Mon, 24 Oct 2016 21:25:59 +0530 Message-Id: <1477324559-24752-6-git-send-email-akdwived@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1477324559-24752-1-git-send-email-akdwived@codeaurora.org> References: <1477324559-24752-1-git-send-email-akdwived@codeaurora.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Probe is being modified to save q6 version and invoke appropriate init functions to accommodate q6v55 remoteproc driver. Signed-off-by: Avaneesh Kumar Dwivedi --- drivers/remoteproc/qcom_q6v5_pil.c | 43 ++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c index dd19d41..c65c904 100644 --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c @@ -1370,6 +1370,9 @@ static int q6v5_probe(struct platform_device *pdev) init_completion(&qproc->start_done); init_completion(&qproc->stop_done); + if (of_device_is_compatible(pdev->dev.of_node, "qcom,q6v55-pil")) + qproc->is_q6v55 = true; + ret = q6v5_init_mem(qproc, pdev); if (ret) goto free_rproc; @@ -1378,17 +1381,39 @@ static int q6v5_probe(struct platform_device *pdev) if (ret) goto free_rproc; - ret = q6v5_init_clocks(qproc); - if (ret) - goto free_rproc; + if (qproc->is_q6v55) { + ret = q6v55_init_clocks(qproc); + if (ret) + goto free_rproc; + } else { + ret = q6v5_init_clocks(qproc); + if (ret) + goto free_rproc; + } - ret = q6v5_regulator_init(qproc); - if (ret) - goto free_rproc; + if (qproc->is_q6v55) { + ret = q6v55_init_reset(qproc, pdev); + if (ret) + goto free_rproc; + } else { + ret = q6v5_init_reset(qproc); + if (ret) + goto free_rproc; + } - ret = q6v5_init_reset(qproc); - if (ret) - goto free_rproc; + if (qproc->is_q6v55) { + ret = q6v55_regulator_init(qproc); + if (ret) + goto free_rproc; + } else { + ret = q6v5_regulator_init(qproc); + if (ret) + goto free_rproc; + } + + qproc->ahb_clk_vote = of_property_read_bool(pdev->dev.of_node, + "qcom,ahb-clk-vote"); + mutex_init(&qproc->q6_lock); ret = q6v5_request_irq(qproc, pdev, "wdog", q6v5_wdog_interrupt); if (ret < 0)