From patchwork Tue Nov 19 10:58:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 21612 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8364B23FB4 for ; Tue, 19 Nov 2013 10:58:28 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id oy12sf5146427veb.1 for ; Tue, 19 Nov 2013 02:58:28 -0800 (PST) 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=bqit16vclnfNvf14E15uFMokjjrigtLgCCvSJPlYMe4=; b=GpUhRxtD9zaXPq7Lm+3TEDQjBlOKwntSAIvlRo4f52VVYct3T191piXY3x4PXE5wDK v6EBljbMfj1nKdjuesJxRQ2t6Eqao6bh6fT6G3c5V4QCcMkzvaSU+P+GWAGwXU/nJG+L H0k87HCt6v2WxFR+C5ik8HsUJuNeAj037iNlOLA1DWXzFHsmAlxhFhTxgpc7D101MKjS CBU94wt7ooPKCDIP/LX3T4o2nFhSw1wwpLaw6zd43HLHcFKKPGuf00R14MDZePge2kU8 NsNYtYqWJ7mDESmL4kGrYkx0f7kLfhuSsb3mJv2u70zy2P7YvF2mXWITO9HuK6SgJG3C O5Pw== X-Gm-Message-State: ALoCoQkIepHlhRfbfFISftJJJDnru38Uyrfg7TswRRnv0G0HQw5qgwKd/FLB69u1/IPN8R3xPbH4 X-Received: by 10.236.163.67 with SMTP id z43mr12933818yhk.27.1384858707830; Tue, 19 Nov 2013 02:58:27 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.131.7 with SMTP id oi7ls3029141qeb.92.gmail; Tue, 19 Nov 2013 02:58:27 -0800 (PST) X-Received: by 10.52.98.99 with SMTP id eh3mr355582vdb.29.1384858707735; Tue, 19 Nov 2013 02:58:27 -0800 (PST) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id nh5si8013620vec.30.2013.11.19.02.58.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Nov 2013 02:58:27 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so6014032veb.14 for ; Tue, 19 Nov 2013 02:58:27 -0800 (PST) X-Received: by 10.52.32.66 with SMTP id g2mr17779881vdi.14.1384858707587; Tue, 19 Nov 2013 02:58:27 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp268903vcz; Tue, 19 Nov 2013 02:58:27 -0800 (PST) X-Received: by 10.182.88.202 with SMTP id bi10mr1106077obb.52.1384858706836; Tue, 19 Nov 2013 02:58:26 -0800 (PST) Received: from mail-ob0-f169.google.com (mail-ob0-f169.google.com [209.85.214.169]) by mx.google.com with ESMTPS id mx9si15104920obc.106.2013.11.19.02.58.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Nov 2013 02:58:26 -0800 (PST) Received-SPF: neutral (google.com: 209.85.214.169 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.214.169; Received: by mail-ob0-f169.google.com with SMTP id wm4so2914386obc.0 for ; Tue, 19 Nov 2013 02:58:26 -0800 (PST) X-Received: by 10.60.44.239 with SMTP id h15mr24620341oem.22.1384858706552; Tue, 19 Nov 2013 02:58:26 -0800 (PST) Received: from localhost.localdomain (cpc15-aztw25-2-0-cust493.aztw.cable.virginm.net. [92.233.57.238]) by mx.google.com with ESMTPSA id f2sm36742085oes.3.2013.11.19.02.58.24 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Nov 2013 02:58:26 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: linus.walleij@linaro.org, Lee Jones , alsa-devel@alsa-project.org, Mark Brown Subject: [PATCH 2/2] ASoC: ab8500: Revert "ASoC: ab8500: Convert register I/O to regmap" Date: Tue, 19 Nov 2013 10:58:18 +0000 Message-Id: <1384858698-19027-2-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1384858698-19027-1-git-send-email-lee.jones@linaro.org> References: <1384858698-19027-1-git-send-email-lee.jones@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This reverts commit ff795d614bfa62a3c6fc0bcb75cb8842e5a87892, as this is one of two patches which stop audio from working on Snowball. Cc: alsa-devel@alsa-project.org Cc: Mark Brown Signed-off-by: Lee Jones --- sound/soc/codecs/ab8500-codec.c | 64 ++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/sound/soc/codecs/ab8500-codec.c b/sound/soc/codecs/ab8500-codec.c index ca500fd..7990217 100644 --- a/sound/soc/codecs/ab8500-codec.c +++ b/sound/soc/codecs/ab8500-codec.c @@ -126,8 +126,6 @@ struct ab8500_codec_drvdata_dbg { /* Private data for AB8500 device-driver */ struct ab8500_codec_drvdata { - struct regmap *regmap; - /* Sidetone */ long *sid_fir_values; enum sid_state sid_status; @@ -168,34 +166,48 @@ static inline const char *amic_type_str(enum amic_type type) */ /* Read a register from the audio-bank of AB8500 */ -static int ab8500_codec_read_reg(void *context, unsigned int reg, - unsigned int *value) +static unsigned int ab8500_codec_read_reg(struct snd_soc_codec *codec, + unsigned int reg) { - struct device *dev = context; int status; + unsigned int value = 0; u8 value8; - status = abx500_get_register_interruptible(dev, AB8500_AUDIO, - reg, &value8); - *value = (unsigned int)value8; + status = abx500_get_register_interruptible(codec->dev, AB8500_AUDIO, + reg, &value8); + if (status < 0) { + dev_err(codec->dev, + "%s: ERROR: Register (0x%02x:0x%02x) read failed (%d).\n", + __func__, (u8)AB8500_AUDIO, (u8)reg, status); + } else { + dev_dbg(codec->dev, + "%s: Read 0x%02x from register 0x%02x:0x%02x\n", + __func__, value8, (u8)AB8500_AUDIO, (u8)reg); + value = (unsigned int)value8; + } - return status; + return value; } /* Write to a register in the audio-bank of AB8500 */ -static int ab8500_codec_write_reg(void *context, unsigned int reg, - unsigned int value) +static int ab8500_codec_write_reg(struct snd_soc_codec *codec, + unsigned int reg, unsigned int value) { - struct device *dev = context; + int status; - return abx500_set_register_interruptible(dev, AB8500_AUDIO, - reg, value); -} + status = abx500_set_register_interruptible(codec->dev, AB8500_AUDIO, + reg, value); + if (status < 0) + dev_err(codec->dev, + "%s: ERROR: Register (%02x:%02x) write failed (%d).\n", + __func__, (u8)AB8500_AUDIO, (u8)reg, status); + else + dev_dbg(codec->dev, + "%s: Wrote 0x%02x into register %02x:%02x\n", + __func__, (u8)value, (u8)AB8500_AUDIO, (u8)reg); -static const struct regmap_config ab8500_codec_regmap = { - .reg_read = ab8500_codec_read_reg, - .reg_write = ab8500_codec_write_reg, -}; + return status; +} /* * Controls - DAPM @@ -2476,8 +2488,6 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec) /* Setup AB8500 according to board-settings */ pdata = dev_get_platdata(dev->parent); - codec->control_data = drvdata->regmap; - if (np) { if (!pdata) pdata = devm_kzalloc(dev, @@ -2555,6 +2565,9 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec) static struct snd_soc_codec_driver ab8500_codec_driver = { .probe = ab8500_codec_probe, + .read = ab8500_codec_read_reg, + .write = ab8500_codec_write_reg, + .reg_word_size = sizeof(u8), .controls = ab8500_ctrls, .num_controls = ARRAY_SIZE(ab8500_ctrls), .dapm_widgets = ab8500_dapm_widgets, @@ -2577,15 +2590,6 @@ static int ab8500_codec_driver_probe(struct platform_device *pdev) drvdata->anc_status = ANC_UNCONFIGURED; dev_set_drvdata(&pdev->dev, drvdata); - drvdata->regmap = devm_regmap_init(&pdev->dev, NULL, &pdev->dev, - &ab8500_codec_regmap); - if (IS_ERR(drvdata->regmap)) { - status = PTR_ERR(drvdata->regmap); - dev_err(&pdev->dev, "%s: Failed to allocate regmap: %d\n", - __func__, status); - return status; - } - dev_dbg(&pdev->dev, "%s: Register codec.\n", __func__); status = snd_soc_register_codec(&pdev->dev, &ab8500_codec_driver, ab8500_codec_dai,