From patchwork Wed Apr 16 13:16:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 4001171 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 BA9BE9F2BA for ; Wed, 16 Apr 2014 13:17:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4CD26202A7 for ; Wed, 16 Apr 2014 13:17:17 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id DB54B20279 for ; Wed, 16 Apr 2014 13:17:15 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id A392326546C; Wed, 16 Apr 2014 15:17:14 +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, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 36178265325; Wed, 16 Apr 2014 15:17:03 +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 799F826533D; Wed, 16 Apr 2014 15:17:02 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by alsa0.perex.cz (Postfix) with ESMTP id 9E2052652FF for ; Wed, 16 Apr 2014 15:16:48 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 16 Apr 2014 06:11:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,872,1389772800"; d="scan'208";a="494135540" Received: from mylly.fi.intel.com (HELO mylly.fi.intel.com.) ([10.237.72.74]) by orsmga001.jf.intel.com with ESMTP; 16 Apr 2014 06:16:21 -0700 From: Jarkko Nikula To: alsa-devel@alsa-project.org Date: Wed, 16 Apr 2014 16:16:16 +0300 Message-Id: <1397654176-5736-1-git-send-email-jarkko.nikula@linux.intel.com> X-Mailer: git-send-email 1.9.1 Cc: Oder Chiou , Bard Liao , Mark Brown , Jarkko Nikula , Liam Girdwood Subject: [alsa-devel] [PATCH] ASoC: rt5640: Add minimal support for RT5642 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 We have been using rt5640.c codec driver with RT5642 codec chip before commit 022d21f004c1 ("ASoC: rt5640: add rt5639 support"). That commits starts using device ID reading in reset register for adding device specific controls and routes runtime. Now since device ID appears to be different between RT5640 and RT5642 the driver doesn't add those controls and routes that are valid also on RT5642. Fix this by adding a device ID found by debugging and minimal code for supporting RT5642. Signed-off-by: Jarkko Nikula --- sound/soc/codecs/rt5640.c | 2 ++ sound/soc/codecs/rt5640.h | 1 + 2 files changed, 3 insertions(+) diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index b947c820697d..ffde5bf11789 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -2000,6 +2000,7 @@ static int rt5640_probe(struct snd_soc_codec *codec) switch (snd_soc_read(codec, RT5640_RESET)) { case RT5640_RESET_ID: + case RT5642_RESET_ID: snd_soc_add_codec_controls(codec, rt5640_specific_snd_controls, ARRAY_SIZE(rt5640_specific_snd_controls)); @@ -2150,6 +2151,7 @@ static const struct regmap_config rt5640_regmap = { static const struct i2c_device_id rt5640_i2c_id[] = { { "rt5640", 0 }, { "rt5639", 0 }, + { "rt5642", 0 }, { } }; MODULE_DEVICE_TABLE(i2c, rt5640_i2c_id); diff --git a/sound/soc/codecs/rt5640.h b/sound/soc/codecs/rt5640.h index 3b50459a83b4..d31faeaa637e 100644 --- a/sound/soc/codecs/rt5640.h +++ b/sound/soc/codecs/rt5640.h @@ -16,6 +16,7 @@ #define RT5639_RESET_ID 0x0008 #define RT5640_RESET_ID 0x000c +#define RT5642_RESET_ID 0x0006 /* Info */ #define RT5640_RESET 0x00