From patchwork Tue Apr 15 12:37:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 3992621 Return-Path: X-Original-To: patchwork-alsa-devel@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 811889F2CC for ; Tue, 15 Apr 2014 12:39:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B14A22022A for ; Tue, 15 Apr 2014 12:39:56 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 8E82820155 for ; Tue, 15 Apr 2014 12:39:55 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1BFEC264FDF; Tue, 15 Apr 2014 14:39:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 5F10A264FFF; Tue, 15 Apr 2014 14:39:39 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8548026501B; Tue, 15 Apr 2014 14:39:38 +0200 (CEST) Received: from vps0.lunn.ch (vps0.lunn.ch [178.209.37.122]) by alsa0.perex.cz (Postfix) with ESMTP id 8E4D0264FFF for ; Tue, 15 Apr 2014 14:39:24 +0200 (CEST) Received: from lunn by vps0.lunn.ch with local (Exim 4.80) (envelope-from ) id 1Wa2bv-0000Sf-J2; Tue, 15 Apr 2014 14:37:11 +0200 From: Andrew Lunn To: broonie@kernel.org Date: Tue, 15 Apr 2014 14:37:05 +0200 Message-Id: <1397565425-1746-1-git-send-email-andrew@lunn.ch> X-Mailer: git-send-email 1.7.10.4 Cc: Andrew Lunn , alsa-devel@alsa-project.org, Jason Cooper Subject: [alsa-devel] [PATCH] ASoC: alc5623: Fix regmap endianness X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 0cd257bf9b9b0cbb4fa1a5c988a232506997867c, "ASoC: alc5623: Convert to direct regmap API usage" broke probing of the codec, because of wrong endinness of the ID and codec version read from the device. Fix this by removing the existing flipping of the endiannes, and extracting the codec type byte from the word from the regmap. Signed-off-by: Andrew Lunn --- sound/soc/codecs/alc5623.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/alc5623.c b/sound/soc/codecs/alc5623.c index f500905e9373..2acf82f4a08a 100644 --- a/sound/soc/codecs/alc5623.c +++ b/sound/soc/codecs/alc5623.c @@ -1018,13 +1018,13 @@ static int alc5623_i2c_probe(struct i2c_client *client, dev_err(&client->dev, "failed to read vendor ID1: %d\n", ret); return ret; } - vid1 = ((vid1 & 0xff) << 8) | (vid1 >> 8); ret = regmap_read(alc5623->regmap, ALC5623_VENDOR_ID2, &vid2); if (ret < 0) { dev_err(&client->dev, "failed to read vendor ID2: %d\n", ret); return ret; } + vid2 >>= 8; if ((vid1 != 0x10ec) || (vid2 != id->driver_data)) { dev_err(&client->dev, "unknown or wrong codec\n");