From patchwork Wed May 13 12:00:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 48431 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EEA5C214A1 for ; Wed, 13 May 2015 12:01:00 +0000 (UTC) Received: by wgin8 with SMTP id n8sf8878885wgi.0 for ; Wed, 13 May 2015 05:01:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=1jelhPbzlhCMMWs784wVYL+gNULD6GZDY5JppjV8CuE=; b=B4zybWvZbdXTr8Xj0TRGBpyfV/ghFQONWQGLiZDJkha09ONiAVRJdOfHAUx91LlN9d TEczg0jiaiCD4dfDHZYde4RB+Kv/DNcd48lcAtMVvexNbo0mR0WHmtDNCpoNvFaHyY4g 9Iow4exzMBGCEY7UfxY1Se3geXo8NPxWfIi0E+SeMRd3iyCvDL/KhrzqL7TygFKBLbfZ 9M65g4JjtgxB6UiOdSgC9uUCZSDltn+UY+4jTbpshBY0xWlf08CqWevZUTitOiFPEci8 ifbthYSn+V1ZWskp6lnVfo0ySJfDKHuFPjGrxdeqRUe0uqLZZL8oroxnqtCAvIsz6UT2 //4Q== X-Gm-Message-State: ALoCoQnIMUQQ3wcJ2tndAeR8cDjQPKJL8eHkdwN5sbMDNsw5/afb/ip+/uG3qv52oUURnbGA0Z6O X-Received: by 10.180.85.129 with SMTP id h1mr5201012wiz.6.1431518460292; Wed, 13 May 2015 05:01:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.114 with SMTP id q18ls216104laa.8.gmail; Wed, 13 May 2015 05:01:00 -0700 (PDT) X-Received: by 10.112.72.2 with SMTP id z2mr15599294lbu.39.1431518460130; Wed, 13 May 2015 05:01:00 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id m4si12258351lbc.59.2015.05.13.05.01.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 May 2015 05:01:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbbqq2 with SMTP id qq2so27617480lbb.3 for ; Wed, 13 May 2015 05:01:00 -0700 (PDT) X-Received: by 10.152.4.137 with SMTP id k9mr2863836lak.29.1431518460027; Wed, 13 May 2015 05:01:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp486094lbb; Wed, 13 May 2015 05:00:58 -0700 (PDT) X-Received: by 10.68.57.198 with SMTP id k6mr25182419pbq.161.1431518458034; Wed, 13 May 2015 05:00:58 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si469358pdl.217.2015.05.13.05.00.57; Wed, 13 May 2015 05:00:58 -0700 (PDT) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754745AbbEMMAo (ORCPT + 7 others); Wed, 13 May 2015 08:00:44 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:33381 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754741AbbEMMAk (ORCPT ); Wed, 13 May 2015 08:00:40 -0400 Received: by wicmx19 with SMTP id mx19so8989008wic.0 for ; Wed, 13 May 2015 05:00:39 -0700 (PDT) X-Received: by 10.180.105.233 with SMTP id gp9mr38957753wib.83.1431518439260; Wed, 13 May 2015 05:00:39 -0700 (PDT) Received: from srini-ThinkPad-X1-Carbon-2nd.dlink.com (host-78-144-121-184.as13285.net. [78.144.121.184]) by mx.google.com with ESMTPSA id vy5sm29625713wjc.33.2015.05.13.05.00.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 May 2015 05:00:38 -0700 (PDT) From: Srinivas Kandagatla To: Patrick Lai , Mark Brown Cc: Rob Herring , Pawel Moll , Ian Campbell , Kumar Gala , Banajit Goswami , Kenneth Westfield , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v1 03/13] ASoC: qcom: remove hardcoded i2s port number Date: Wed, 13 May 2015 13:00:35 +0100 Message-Id: <1431518435-7349-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431518302-7139-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1431518302-7139-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: srinivas.kandagatla@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch attempts to remove the hardcoded i2s port number in lpass driver. Now the the port number comes from the dai id field. This will allow other SOCs to use different port numbers on the lpass driver. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/lpass-cpu.c | 16 +++++++--------- sound/soc/qcom/lpass-ipq806x.c | 1 + 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c index 2c20927..5965667 100644 --- a/sound/soc/qcom/lpass-cpu.c +++ b/sound/soc/qcom/lpass-cpu.c @@ -138,8 +138,7 @@ static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream, } ret = regmap_write(drvdata->lpaif_map, - LPAIF_I2SCTL_REG(drvdata->variant, - LPAIF_I2S_PORT_MI2S), + LPAIF_I2SCTL_REG(drvdata->variant, dai->driver->id), regval); if (ret) { dev_err(dai->dev, "%s() error writing to i2sctl reg: %d\n", @@ -164,8 +163,8 @@ static int lpass_cpu_daiops_hw_free(struct snd_pcm_substream *substream, int ret; ret = regmap_write(drvdata->lpaif_map, - LPAIF_I2SCTL_REG(drvdata->variant, - LPAIF_I2S_PORT_MI2S), 0); + LPAIF_I2SCTL_REG(drvdata->variant, dai->driver->id), + 0); if (ret) dev_err(dai->dev, "%s() error writing to i2sctl reg: %d\n", __func__, ret); @@ -180,7 +179,7 @@ static int lpass_cpu_daiops_prepare(struct snd_pcm_substream *substream, int ret; ret = regmap_update_bits(drvdata->lpaif_map, - LPAIF_I2SCTL_REG(drvdata->variant, LPAIF_I2S_PORT_MI2S), + LPAIF_I2SCTL_REG(drvdata->variant, dai->driver->id), LPAIF_I2SCTL_SPKEN_MASK, LPAIF_I2SCTL_SPKEN_ENABLE); if (ret) dev_err(dai->dev, "%s() error writing to i2sctl reg: %d\n", @@ -201,7 +200,7 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream, case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ret = regmap_update_bits(drvdata->lpaif_map, LPAIF_I2SCTL_REG(drvdata->variant, - LPAIF_I2S_PORT_MI2S), + dai->driver->id), LPAIF_I2SCTL_SPKEN_MASK, LPAIF_I2SCTL_SPKEN_ENABLE); if (ret) @@ -213,7 +212,7 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream, case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ret = regmap_update_bits(drvdata->lpaif_map, LPAIF_I2SCTL_REG(drvdata->variant, - LPAIF_I2S_PORT_MI2S), + dai->driver->id), LPAIF_I2SCTL_SPKEN_MASK, LPAIF_I2SCTL_SPKEN_DISABLE); if (ret) @@ -243,8 +242,7 @@ int asoc_qcom_lpass_cpu_dai_probe(struct snd_soc_dai *dai) /* ensure audio hardware is disabled */ ret = regmap_write(drvdata->lpaif_map, - LPAIF_I2SCTL_REG(drvdata->variant, - LPAIF_I2S_PORT_MI2S), 0); + LPAIF_I2SCTL_REG(drvdata->variant, dai->driver->id), 0); if (ret) dev_err(dai->dev, "%s() error writing to i2sctl reg: %d\n", __func__, ret); diff --git a/sound/soc/qcom/lpass-ipq806x.c b/sound/soc/qcom/lpass-ipq806x.c index d1f698c..9483273 100644 --- a/sound/soc/qcom/lpass-ipq806x.c +++ b/sound/soc/qcom/lpass-ipq806x.c @@ -43,6 +43,7 @@ enum lpaif_dma_channels { }; static struct snd_soc_dai_driver ipq806x_lpass_cpu_dai_driver = { + .id = IPQ806X_LPAIF_I2S_PORT_MI2S, .playback = { .stream_name = "lpass-cpu-playback", .formats = SNDRV_PCM_FMTBIT_S16 |