From patchwork Wed Nov 6 09:54:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 21354 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E376220DB9 for ; Wed, 6 Nov 2013 09:55:02 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id q10sf17575818pdj.8 for ; Wed, 06 Nov 2013 01:55:02 -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=TCHxJW3XS1RCKX+RlZ1QyUxcemG/Fb4837OWBQ4l7Mg=; b=OUmKgGbmJM3uRcqcFBVOkSAON2D4ZjBtotxNTL0QPR9e4JEad09aE6Pxd1xrBA94Ro 5MZCGULNB2hbwmkJsdtI+2gZXFf51WxKHqEG3d5vmazko21KpG4wB65Rjb5c9h+nWurx KgpfBD4x3WxwCMshqFi4fK8N9ws8G2tRsFTHc9gMxQbbck5RfbN00WDhYDnGrG/ViUk6 pWPBb9YFgv1+TaEuJzv43624VKA4MLpQrxINdUz+n1WxFW3w1zFLOc0LJlDdiX0+geU9 yXzT1k8zBtdpzChRg4nbezD8wWudGw3/XV32aKqnmnRSeOVK5kndUlWsRImQ6Sm/eowg YZ0w== X-Gm-Message-State: ALoCoQlhpOORAiH/tm5fwDk5m1AoIwN9botJwIO5FoOgsmz+EUO4htQwyGCsug9uvDHsmXzoBAzl X-Received: by 10.66.240.203 with SMTP id wc11mr1064851pac.29.1383731701928; Wed, 06 Nov 2013 01:55:01 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.81.9 with SMTP id v9ls574308qex.99.gmail; Wed, 06 Nov 2013 01:55:01 -0800 (PST) X-Received: by 10.221.40.10 with SMTP id to10mr1672043vcb.22.1383731701770; Wed, 06 Nov 2013 01:55:01 -0800 (PST) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by mx.google.com with ESMTPS id gq10si8112720vdc.147.2013.11.06.01.55.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Nov 2013 01:55:01 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.43 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.43; Received: by mail-vb0-f43.google.com with SMTP id g10so3290543vbg.30 for ; Wed, 06 Nov 2013 01:55:01 -0800 (PST) X-Received: by 10.58.232.228 with SMTP id tr4mr1656209vec.34.1383731701588; Wed, 06 Nov 2013 01:55:01 -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 u4csp271992vcz; Wed, 6 Nov 2013 01:55:01 -0800 (PST) X-Received: by 10.50.98.10 with SMTP id ee10mr1758976igb.30.1383731700791; Wed, 06 Nov 2013 01:55:00 -0800 (PST) Received: from mail-ie0-f178.google.com (mail-ie0-f178.google.com [209.85.223.178]) by mx.google.com with ESMTPS id qb5si6949532igc.7.2013.11.06.01.55.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Nov 2013 01:55:00 -0800 (PST) Received-SPF: neutral (google.com: 209.85.223.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.223.178; Received: by mail-ie0-f178.google.com with SMTP id x13so17011938ief.37 for ; Wed, 06 Nov 2013 01:55:00 -0800 (PST) X-Received: by 10.50.1.102 with SMTP id 6mr19840637igl.0.1383731700159; Wed, 06 Nov 2013 01:55:00 -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 p14sm13235058igr.7.2013.11.06.01.54.58 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Nov 2013 01:54:59 -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: Wed, 6 Nov 2013 09:54:45 +0000 Message-Id: <1383731685-18441-2-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1383731685-18441-1-git-send-email-lee.jones@linaro.org> References: <1383731685-18441-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.212.43 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,