From patchwork Wed Aug 8 09:41:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1293821 Return-Path: X-Original-To: patchwork-linux-input@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 417653FC23 for ; Wed, 8 Aug 2012 09:43:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964790Ab2HHJmn (ORCPT ); Wed, 8 Aug 2012 05:42:43 -0400 Received: from na3sys009aog101.obsmtp.com ([74.125.149.67]:42857 "EHLO na3sys009aog101.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030304Ab2HHJmN (ORCPT ); Wed, 8 Aug 2012 05:42:13 -0400 Received: from mail-ob0-f170.google.com ([209.85.214.170]) (using TLSv1) by na3sys009aob101.postini.com ([74.125.148.12]) with SMTP ID DSNKUCI0dKK0m6/rK87WaxqifKsVwTcusbfl@postini.com; Wed, 08 Aug 2012 02:42:13 PDT Received: by obbwd18 with SMTP id wd18so1031970obb.29 for ; Wed, 08 Aug 2012 02:42:12 -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=l5yllrFmi/bNfrpqaecEpmV1zePWsB0k02uP0+nCjyc=; b=GfjvxovVvUvLsf1z4GxP1yCxSmtr2mNy6Q+2QwZV72H6a7LMrblqWxMl1ywjgmXuBJ 7TsO3jlhiTKOnTlAcTeSOMWWacxy1AeKgqTrM/So3+oDlamgfhtNbbxWU8MnIq3DHNHe +X1Hmkx6k6kby/fVJ/ygF+D1HP0zxajy5Jg+B3Jb0/Zmd4Bas3x3MH21ZGTplWTr9ykS R/BGK9MDu0AXxcd3Y+DCkmLNuWvipCVsvN/yLxcLcRz40Ixvn0yBPwhe7AASDCZV0cQa iYbh/UdfOoa8kIWifL2xVSwsL8RzEgU4RGVuHK9IyCNCYEyRcb0IJmqKRA18LtmGOzLc zHig== Received: by 10.182.116.2 with SMTP id js2mr29490559obb.38.1344418932233; Wed, 08 Aug 2012 02:42:12 -0700 (PDT) Received: from barack.emea.dhcp.ti.com (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id c6sm22141308obn.13.2012.08.08.02.42.09 (version=SSLv3 cipher=OTHER); Wed, 08 Aug 2012 02:42:11 -0700 (PDT) From: Peter Ujfalusi To: Samuel Ortiz , Mark Brown , Liam Girdwood , Tony Lindgren , Dmitry Torokhov Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, Benoit Cousson Subject: [PATCH 10/11] ASoC: twl4030: Add pointer to pdata within the private data Date: Wed, 8 Aug 2012 12:41:26 +0300 Message-Id: <1344418887-5262-11-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1344418887-5262-1-git-send-email-peter.ujfalusi@ti.com> References: <1344418887-5262-1-git-send-email-peter.ujfalusi@ti.com> X-Gm-Message-State: ALoCoQkRgrZmjgvEagS6xa0zcaLLBdnKVJ6SqL/jDsreU4RoT1OfX56SIaf5mMVFnPJv4qBB/g9b Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@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 6a00c01..bf0240d 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; }; /* @@ -350,7 +349,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; @@ -751,9 +750,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}; @@ -868,9 +867,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; } @@ -2252,8 +2252,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);