From patchwork Mon Jan 27 06:55:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bo Shen X-Patchwork-Id: 3541451 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6BC479F2E9 for ; Mon, 27 Jan 2014 06:59:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9826820123 for ; Mon, 27 Jan 2014 06:59:15 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D1AF020131 for ; Mon, 27 Jan 2014 06:59:10 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W7g9L-0000uz-SC; Mon, 27 Jan 2014 06:58:28 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W7g9B-0004Ve-Rt; Mon, 27 Jan 2014 06:58:17 +0000 Received: from newsmtp5.atmel.com ([204.2.163.5] helo=sjogate2.atmel.com) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W7g8t-0004St-Sp for linux-arm-kernel@lists.infradead.org; Mon, 27 Jan 2014 06:58:01 +0000 Received: from Dev4Android.corp.atmel.com ([10.217.2.46]) by sjogate2.atmel.com (8.13.6/8.13.6) with ESMTP id s0R6mVgS015290; Sun, 26 Jan 2014 22:50:35 -0800 (PST) From: Bo Shen To: broonie@kernel.org Subject: [PATCH v2 2/3] ASoC: atmel_wm8904: make it available to choose clock Date: Mon, 27 Jan 2014 14:55:25 +0800 Message-Id: <1390805726-1841-3-git-send-email-voice.shen@atmel.com> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1390805726-1841-1-git-send-email-voice.shen@atmel.com> References: <1390805726-1841-1-git-send-email-voice.shen@atmel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140127_015800_306376_6D61E2D2 X-CRM114-Status: GOOD ( 10.10 ) X-Spam-Score: -2.4 (--) Cc: alsa-devel@alsa-project.org, Wolfram Sang , Takashi Iwai , linux-kernel@vger.kernel.org, Linus Walleij , nicolas.ferre@atmel.com, Liam Girdwood , linux-sound@vger.kernel.org, Jaroslav Kysela , Bo Shen , plagnioj@jcrosoft.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 Make it available to choose the clock from TK pin or RK pin. This is hardware design decided. Signed-off-by: Bo Shen --- Changes in v2: None sound/soc/atmel/atmel_wm8904.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/soc/atmel/atmel_wm8904.c b/sound/soc/atmel/atmel_wm8904.c index b4e3690..9346410 100644 --- a/sound/soc/atmel/atmel_wm8904.c +++ b/sound/soc/atmel/atmel_wm8904.c @@ -108,6 +108,7 @@ static int atmel_asoc_wm8904_dt_init(struct platform_device *pdev) struct device_node *codec_np, *cpu_np; struct snd_soc_card *card = &atmel_asoc_wm8904_card; struct snd_soc_dai_link *dailink = &atmel_asoc_wm8904_dailink; + struct atmel_ssc_info *ssc_info; int ret; if (!np) { @@ -115,6 +116,15 @@ static int atmel_asoc_wm8904_dt_init(struct platform_device *pdev) return -EINVAL; } + ssc_info = devm_kzalloc(&pdev->dev, sizeof(*ssc_info), GFP_KERNEL); + if (!ssc_info) + return -ENOMEM; + + ssc_info->clk_from_rk_pin = + of_property_read_bool(np, "atmel,clk-from-rk-pin"); + + card->drvdata = (void *)ssc_info; + ret = snd_soc_of_parse_card_name(card, "atmel,model"); if (ret) { dev_err(&pdev->dev, "failed to parse card name\n");