From patchwork Tue Aug 30 11:39:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1112852 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7UBe1uG017375 for ; Tue, 30 Aug 2011 11:40:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753475Ab1H3LkA (ORCPT ); Tue, 30 Aug 2011 07:40:00 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:54128 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752877Ab1H3Lj7 (ORCPT ); Tue, 30 Aug 2011 07:39:59 -0400 Received: from dlep36.itg.ti.com ([157.170.170.91]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id p7UBdk8B025054 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 30 Aug 2011 06:39:46 -0500 Received: from dlep26.itg.ti.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id p7UBdkpa017207; Tue, 30 Aug 2011 06:39:46 -0500 (CDT) Received: from DLEE74.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id p7UBdkbM015399; Tue, 30 Aug 2011 06:39:46 -0500 (CDT) Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Tue, 30 Aug 2011 06:39:45 -0500 Received: from barack.norway.design.ti.com (h88-1.vpn.ti.com [172.24.88.1]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id p7UBdegp016622; Tue, 30 Aug 2011 06:39:44 -0500 From: Peter Ujfalusi To: Mark Brown , Liam Girdwood , Tony Lindgren CC: , , Jarkko Nikula Subject: [PATCH 1/3] ASoC: tpa6130a2: Model support cleanup Date: Tue, 30 Aug 2011 14:39:52 +0300 Message-ID: <1314704394-31298-2-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.7.6.1 In-Reply-To: <1314704394-31298-1-git-send-email-peter.ujfalusi@ti.com> References: <1314704394-31298-1-git-send-email-peter.ujfalusi@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 30 Aug 2011 11:40:01 +0000 (UTC) Use the device name and driver_data to identify the TPA model supported by the driver. Board files should use either "tpa6130a2" or "tpa6140a2" as device name to specify the model in used on the specific board. Signed-off-by: Peter Ujfalusi --- sound/soc/codecs/tpa6130a2.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c index 239e0c4..0c0fcb3 100644 --- a/sound/soc/codecs/tpa6130a2.c +++ b/sound/soc/codecs/tpa6130a2.c @@ -383,7 +383,7 @@ static int __devinit tpa6130a2_probe(struct i2c_client *client, pdata = client->dev.platform_data; data->power_gpio = pdata->power_gpio; - data->id = pdata->id; + data->id = id->driver_data; mutex_init(&data->mutex); @@ -405,7 +405,7 @@ static int __devinit tpa6130a2_probe(struct i2c_client *client, switch (data->id) { default: dev_warn(dev, "Unknown TPA model (%d). Assuming 6130A2\n", - pdata->id); + data->id); case TPA6130A2: regulator = "Vdd"; break; @@ -470,7 +470,8 @@ static int __devexit tpa6130a2_remove(struct i2c_client *client) } static const struct i2c_device_id tpa6130a2_id[] = { - { "tpa6130a2", 0 }, + { "tpa6130a2", TPA6130A2 }, + { "tpa6140a2", TPA6140A2 }, { } }; MODULE_DEVICE_TABLE(i2c, tpa6130a2_id);