From patchwork Mon Jul 17 13:54:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 107962 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp4594913obm; Mon, 17 Jul 2017 06:55:15 -0700 (PDT) X-Received: by 10.99.123.6 with SMTP id w6mr7399943pgc.71.1500299714911; Mon, 17 Jul 2017 06:55:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500299714; cv=none; d=google.com; s=arc-20160816; b=hYr90mx7PTl16is8Q8gZHFpdgSZqtHFiYuspgBPl8E5V0t++S2eWBNwjrBgmdphayS Fxn32bJQO6ON/2VqhY8HhmFDi9n+DnVzO04h8qLh28fxvf/GW5h8X9YV2lQo9uwCSy0k 5NP+hYWV6lO/cO9T/lTYhetjbGRDEEhHJqbAhktEBAjB52TwfBRyd5XKNvX1GBO5jAUN V1uZaTjoMxNROfSPd1UIWrysUo3rSeKYEyJOUySouctcmUmw8u/7xvvBFJRL0hQLhnp1 OBMdMk530ermS3YIwPTB/VejNLHH1IholPhyco65KZpkP1cfdqiKeUHlQfhCZZd04dKb xTtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=+hYBJ4dwwHsvwnbtbRGOcHcbGbJ2OCVJnBrZLatl9nc=; b=cR+7kLlXB8YjXeMvOyRYjG5WMBsAWJit3wNvyWhz4H0K4GaXvnG3Wg6I+8UyAMXyHz zY/+apft+fM1ehPyOkB2Q9HZiAC5Fvbkc/aSeoNzdgu9qEWN5BiWgu+dr4mC1TNJegtr Fe/2KCuCp6TWdxi83G1GGBgKhVsIGhrI/c3gnkMagPCEB9Q+2E0QwqM8TndqseZkxVof +aIcN8PuGPKjmXXZmrKRv3qCmknyk0ptJphblX+WmHs8oYe9Xw0YldiuVMLtMfsq60h0 rC2bgDhFJavl2iaeZhnfA2FzftSfeUyw/NpaqoMhyoUW+J7ZIiQR2aw7JEFeYiBzuuEH KhWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=XAQm3Els; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3si13240563plk.571.2017.07.17.06.55.14; Mon, 17 Jul 2017 06:55:14 -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=@linaro.org header.b=XAQm3Els; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751422AbdGQNzM (ORCPT + 25 others); Mon, 17 Jul 2017 09:55:12 -0400 Received: from mail-io0-f170.google.com ([209.85.223.170]:33662 "EHLO mail-io0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751280AbdGQNyc (ORCPT ); Mon, 17 Jul 2017 09:54:32 -0400 Received: by mail-io0-f170.google.com with SMTP id h64so43371605iod.0 for ; Mon, 17 Jul 2017 06:54:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+hYBJ4dwwHsvwnbtbRGOcHcbGbJ2OCVJnBrZLatl9nc=; b=XAQm3ElsiyRd9wVsiZ/DYQRhGNft7D/+v/AcEwjLFEMagHvMmVoNzPCkjiGzqlnzfV ozC7RS5jA/jwPh1ruT+w1AQF7EJRigDtKFEQKyPQM4V/0jTrgQThXwKIlcEug/uxzCnr +HHkmTiUfZnRIAgHi2qy5mFZjvp2NAQudFEjY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+hYBJ4dwwHsvwnbtbRGOcHcbGbJ2OCVJnBrZLatl9nc=; b=BOo5cN5hrScKAOZnwX3C7fyvwnH3b+4cnFJQ+o+1ie1dNnMCMZMDys4+pv+KQ4/Fe1 1AW/YjtmVix27mkuVZ728W8+u1otAbJmjR6mcLgPMFL1VgKbKtH3uZcMOsGm/3m1exA0 u9T6r2oVK+8UJr0Ys1ovaaaUBZHb7FySeZsJDhVBod9zDDKFHXe1MHopAPDP9uBwmEuc 55qHGwKfBZLSPsKXTrdLYAGQ8mkDqiSJTVUBUoRrLtdKFk030KwjyThzAHWm4zX+ah3u QAm/gaovfJPBlfUOt4uee1osxsM6hblhaM1JNxlcuM7T+1szdrNxLbm3UwEF5urfiM9c H70w== X-Gm-Message-State: AIVw110ENAshil1CYqxiBoT3jT3rUpoxNPqeQJhx/si9QaPNIU3ZZcj0 yZ5f9xhg3X2KoqfO X-Received: by 10.107.8.14 with SMTP id 14mr19306232ioi.197.1500299671727; Mon, 17 Jul 2017 06:54:31 -0700 (PDT) Received: from localhost.localdomain (static.8.26.4.46.clients.your-server.de. [46.4.26.8]) by smtp.gmail.com with ESMTPSA id 138sm5880561itw.10.2017.07.17.06.54.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 06:54:31 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Mark Brown , Banajit Goswami , alsa-devel@alsa-project.org Cc: Jaroslav Kysela , Takashi Iwai , Patrick Lai , linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 1/3] ASoC: codecs: msm8916-wcd-digital: add support to set_sysclk Date: Mon, 17 Jul 2017 15:54:08 +0200 Message-Id: <20170717135410.26812-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170717135410.26812-1-srinivas.kandagatla@linaro.org> References: <20170717135410.26812-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Kandagatla This patch adds support to set_sysclk() which can let the sound card driver to set default mclk rate. In this case MCLK for internal audio codec is expected to be at 9.6MHz by default. Signed-off-by: Srinivas Kandagatla --- sound/soc/codecs/msm8916-wcd-digital.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.11.0 diff --git a/sound/soc/codecs/msm8916-wcd-digital.c b/sound/soc/codecs/msm8916-wcd-digital.c index f690442af8c9..126a0ee8aded 100644 --- a/sound/soc/codecs/msm8916-wcd-digital.c +++ b/sound/soc/codecs/msm8916-wcd-digital.c @@ -568,6 +568,16 @@ static int msm8916_wcd_digital_codec_probe(struct snd_soc_codec *codec) return 0; } +static int msm8916_set_dai_sysclk(struct snd_soc_dai *dai, + int clk_id, unsigned int freq, int dir) +{ + struct msm8916_wcd_digital_priv *p = dev_get_drvdata(dai->codec->dev); + + clk_set_rate(p->mclk, freq); + + return 0; +} + static int msm8916_wcd_digital_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) @@ -792,6 +802,7 @@ static struct snd_soc_dai_ops msm8916_wcd_digital_dai_ops = { .startup = msm8916_wcd_digital_startup, .shutdown = msm8916_wcd_digital_shutdown, .hw_params = msm8916_wcd_digital_hw_params, + .set_sysclk = msm8916_set_dai_sysclk, }; static struct snd_soc_dai_driver msm8916_wcd_digital_dai[] = {