From patchwork Fri Apr 17 13:16:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 6231081 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8CCA79F2EC for ; Fri, 17 Apr 2015 13:28:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BFDDF20351 for ; Fri, 17 Apr 2015 13:28:21 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id CCB2C20353 for ; Fri, 17 Apr 2015 13:28:19 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id B3727265ADB; Fri, 17 Apr 2015 15:28:18 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 50F3B2659B6; Fri, 17 Apr 2015 15:24:29 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2CF43265CBE; Fri, 17 Apr 2015 15:24:27 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by alsa0.perex.cz (Postfix) with ESMTP id 7E8BB2659BC for ; Fri, 17 Apr 2015 15:21:36 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 17 Apr 2015 06:21:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,594,1422950400"; d="scan'208";a="557666106" Received: from vkoul-udesk3.iind.intel.com ([10.223.84.65]) by orsmga003.jf.intel.com with ESMTP; 17 Apr 2015 06:21:33 -0700 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Fri, 17 Apr 2015 18:46:07 +0530 Message-Id: <1429276567-29007-10-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1429276567-29007-1-git-send-email-vinod.koul@intel.com> References: <1429276567-29007-1-git-send-email-vinod.koul@intel.com> Cc: tiwai@suse.de, patches.audio@intel.com, liam.r.girdwood@linux.intel.com, Vinod Koul , broonie@kernel.org, "Subhransu S. Prusty" Subject: [alsa-devel] [RFC 9/9] ASoC: hda: Export API to change DSP power state X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Subhransu S. Prusty" Signed-off-by: Subhransu S. Prusty Signed-off-by: Vinod Koul --- sound/soc/hda/intel/soc-hda-sst-dsp.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sound/soc/hda/intel/soc-hda-sst-dsp.c b/sound/soc/hda/intel/soc-hda-sst-dsp.c index b133c63a0c20..4d4d01b496b3 100644 --- a/sound/soc/hda/intel/soc-hda-sst-dsp.c +++ b/sound/soc/hda/intel/soc-hda-sst-dsp.c @@ -480,6 +480,20 @@ int ssth_dsp_free0(struct ssth_lib *dsp) } EXPORT_SYMBOL_GPL(ssth_dsp_free0); +int ssth_dsp_set_power_state(struct ssth_lib *ctx, int state) +{ + int ret = 0; + + if (state == SST_DSP_POWER_D0) + ret = ctx->ops.set_state_D0(ctx); + else if (state == SST_DSP_POWER_D3) + ret = ctx->ops.set_state_D3(ctx); + else + dev_err(ctx->dev, "Power State=%x not supported", state); + return ret; +} +EXPORT_SYMBOL_GPL(ssth_dsp_set_power_state); + bool ssth_dsp_is_running(struct ssth_lib *ctx) { bool ret = 0;