From patchwork Wed Jul 17 06:12:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barry Song X-Patchwork-Id: 2828464 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9CA25C0AB2 for ; Wed, 17 Jul 2013 06:14:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CA6332012C for ; Wed, 17 Jul 2013 06:14:24 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 801AE200B4 for ; Wed, 17 Jul 2013 06:14:23 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UzKzS-0003u6-A9; Wed, 17 Jul 2013 06:13:30 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UzKzI-0000i1-IW; Wed, 17 Jul 2013 06:13:20 +0000 Received: from cluster-g.mailcontrol.com ([208.87.233.190]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UzKyz-0000gB-Gc for linux-arm-kernel@lists.infradead.org; Wed, 17 Jul 2013 06:13:02 +0000 Received: from shaasiexc01.ASIA.ROOT.PRI ([210.13.83.101]) by rly10g.srv.mailcontrol.com (MailControl) with ESMTP id r6H6CTh7016574 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 17 Jul 2013 07:12:31 +0100 Received: from barry-laptop.ROOT.PRI (10.125.5.73) by asimail.csr.com (10.125.12.88) with Microsoft SMTP Server (TLS) id 14.2.318.1; Wed, 17 Jul 2013 14:12:29 +0800 From: Barry Song To: Subject: [PATCH 2/3] ASoC: hdmi-codec: enable OF support Date: Wed, 17 Jul 2013 14:12:15 +0800 Message-ID: <1374041536-27643-2-git-send-email-Baohua.Song@csr.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1374041536-27643-1-git-send-email-Baohua.Song@csr.com> References: <1374041536-27643-1-git-send-email-Baohua.Song@csr.com> MIME-Version: 1.0 X-Originating-IP: [10.125.5.73] X-Scanned-By: MailControl 17434.0 (www.mailcontrol.com) on 10.71.0.120 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130717_021301_737225_29A3936F X-CRM114-Status: GOOD ( 12.44 ) X-Spam-Score: -2.6 (--) Cc: Rongjun Ying , alsa-devel@alsa-project.org, Workgroup.Linux@csr.com, linux-arm-kernel@lists.infradead.org, Barry Song X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rongjun Ying this makes users be able to add a hdmi-codec node in dts instead of hardcoding a platform device in mach. Signed-off-by: Rongjun Ying Signed-off-by: Barry Song --- sound/soc/codecs/hdmi.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/soc/codecs/hdmi.c b/sound/soc/codecs/hdmi.c index 2bcae2b..78c7b15 100644 --- a/sound/soc/codecs/hdmi.c +++ b/sound/soc/codecs/hdmi.c @@ -51,10 +51,21 @@ static int hdmi_codec_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id hdmi_audio_codec_ids[] = { + { .compatible = "hdmi-audio-codec", }, + {} +}; +MODULE_DEVICE_TABLE(of, hdmi_audio_codec_ids); +#endif + static struct platform_driver hdmi_codec_driver = { .driver = { .name = DRV_NAME, .owner = THIS_MODULE, +#ifdef CONFIG_OF + .of_match_table = hdmi_audio_codec_ids, +#endif }, .probe = hdmi_codec_probe,