From patchwork Tue Aug 14 14:22:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1320191 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A1F0A402E1 for ; Tue, 14 Aug 2012 14:25:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756427Ab2HNOYz (ORCPT ); Tue, 14 Aug 2012 10:24:55 -0400 Received: from na3sys009aog130.obsmtp.com ([74.125.149.143]:55858 "EHLO na3sys009aog130.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756298Ab2HNOXU (ORCPT ); Tue, 14 Aug 2012 10:23:20 -0400 Received: from mail-qa0-f48.google.com ([209.85.216.48]) (using TLSv1) by na3sys009aob130.postini.com ([74.125.148.12]) with SMTP ID DSNKUCpfWPi1l+ym5qItujtJIjeAY7ki4eV+@postini.com; Tue, 14 Aug 2012 07:23:20 PDT Received: by qady1 with SMTP id y1so390914qad.14 for ; Tue, 14 Aug 2012 07:23:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=5xbeEqkNvkrjreetHSFa9qTN3zmaiN2l/PRHkEZZheE=; b=j4y+84P9Q41K4+ySjIXfYwGQsp8Y3DKGz9VnMKBzDNwYW4vOWqAY0o072AM2QNCshl E516ugBovYJt9s2YN0Iskc8h6xusdp3taAfjlzm1CK0rPcvexP8S7JzBjq8FROtdlPN8 MyXyMnXncrQaMjbv0kjqq+FJHPhZFaC3K5atCQJ9hDjgK4ay66+03SndZoT7bAQjrpuu eG6duzT2CCIy/zKFsqaza7p9U27FRaxYF8hAXrDBY6dIG9SLvGcKmhiwnrD7ROHZ8ToN 10tSHRW+wpYcxGC2Q3jKWuoABouBlQ6Iqo8DKE+AAIPh3trYRFMIMvnitDXKE9hlVOSQ Ha7A== Received: by 10.60.28.162 with SMTP id c2mr25627615oeh.3.1344954198017; Tue, 14 Aug 2012 07:23:18 -0700 (PDT) Received: from barack.emea.dhcp.ti.com (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id kc5sm2799741obb.21.2012.08.14.07.23.14 (version=SSLv3 cipher=OTHER); Tue, 14 Aug 2012 07:23:17 -0700 (PDT) From: Peter Ujfalusi To: Mark Brown , Liam Girdwood , Tony Lindgren , Grant Likely , Rob Herring Cc: Tero Kristo , alsa-devel@alsa-project.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree-discuss@lists.ozlabs.org, Benoit Cousson , linux-kernel@vger.kernel.org Subject: [PATCH v2 13/14] ASoC: twl4030: Add pointer to pdata within the private data Date: Tue, 14 Aug 2012 17:22:41 +0300 Message-Id: <1344954162-7985-14-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1344954162-7985-1-git-send-email-peter.ujfalusi@ti.com> References: <1344954162-7985-1-git-send-email-peter.ujfalusi@ti.com> X-Gm-Message-State: ALoCoQkrESBQEB2hOeujwbPt7R23Dj3EovW2/zH2c52aox9ULre+OsKX4vY9lIYTo/BplrX3PxtH Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Access the pdata via a pointer within the twl4030_priv structure. In preparation for DeviceTree support. Signed-off-by: Peter Ujfalusi --- sound/soc/codecs/twl4030.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index 413e698..8b13d50 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c @@ -153,8 +153,7 @@ struct twl4030_priv { u8 predrivel_enabled, predriver_enabled; u8 carkitl_enabled, carkitr_enabled; - /* Delay needed after enabling the digimic interface */ - unsigned int digimic_delay; + struct twl4030_codec_data *pdata; }; /* @@ -348,7 +347,7 @@ static void twl4030_init_chip(struct snd_soc_codec *codec) if (!pdata) return; - twl4030->digimic_delay = pdata->digimic_delay; + twl4030->pdata = pdata; reg = twl4030_read_reg_cache(codec, TWL4030_REG_HS_POPN_SET); reg &= ~TWL4030_RAMP_DELAY; @@ -749,9 +748,9 @@ static int aif_event(struct snd_soc_dapm_widget *w, static void headset_ramp(struct snd_soc_codec *codec, int ramp) { - struct twl4030_codec_data *pdata = codec->dev->platform_data; unsigned char hs_gain, hs_pop; struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); + struct twl4030_codec_data *pdata = twl4030->pdata; /* Base values for ramp delay calculation: 2^19 - 2^26 */ unsigned int ramp_base[] = {524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864}; @@ -864,9 +863,10 @@ static int digimic_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec); + struct twl4030_codec_data *pdata = twl4030->pdata; - if (twl4030->digimic_delay) - twl4030_wait_ms(twl4030->digimic_delay); + if (pdata && pdata->digimic_delay) + twl4030_wait_ms(pdata->digimic_delay); return 0; } @@ -2248,8 +2248,8 @@ static int twl4030_soc_probe(struct snd_soc_codec *codec) static int twl4030_soc_remove(struct snd_soc_codec *codec) { - struct twl4030_codec_data *pdata = dev_get_platdata(codec->dev); struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); + struct twl4030_codec_data *pdata = twl4030->pdata; /* Reset registers to their chip default before leaving */ twl4030_reset_registers(codec);