From patchwork Tue Sep 1 10:04:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Henningsson X-Patchwork-Id: 512752 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id DBD53140216; Tue, 1 Sep 2015 20:04:35 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1ZWiQZ-0002Zo-Pb; Tue, 01 Sep 2015 10:04:31 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1ZWiQH-0002UL-Ri for kernel-team@lists.ubuntu.com; Tue, 01 Sep 2015 10:04:13 +0000 Received: from c83-254-133-232.bredband.comhem.se ([83.254.133.232] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ZWiQH-0003kR-Oa; Tue, 01 Sep 2015 10:04:13 +0000 From: David Henningsson To: kernel-team@lists.ubuntu.com, tjaalton@ubuntu.com Subject: [PATCH 3/4] ALSA: hda - allow codecs to access the i915 pin/ELD callback Date: Tue, 1 Sep 2015 12:04:08 +0200 Message-Id: <1441101849-5043-4-git-send-email-david.henningsson@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441101849-5043-1-git-send-email-david.henningsson@canonical.com> References: <1441101849-5043-1-git-send-email-david.henningsson@canonical.com> Cc: 1490895@bugs.launchpad.net X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com This lets the interested codec be notified when an i915 pin/ELD event happens. Signed-off-by: David Henningsson --- sound/pci/hda/hda_i915.c | 10 ++++++++++ sound/pci/hda/hda_intel.h | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/sound/pci/hda/hda_i915.c b/sound/pci/hda/hda_i915.c index aec8a0e..b6eadf1 100644 --- a/sound/pci/hda/hda_i915.c +++ b/sound/pci/hda/hda_i915.c @@ -108,6 +108,16 @@ void haswell_set_bclk(struct hda_intel *hda) azx_writew(&hda->chip, EM5, bclk_n); } +int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *aops) +{ + if (WARN_ON(!hdac_acomp)) + return -ENODEV; + + hdac_acomp->audio_ops = aops; + return 0; +} +EXPORT_SYMBOL_GPL(snd_hdac_i915_register_notifier); + static int hda_component_master_bind(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); diff --git a/sound/pci/hda/hda_intel.h b/sound/pci/hda/hda_intel.h index 51cd664..51b940c 100644 --- a/sound/pci/hda/hda_intel.h +++ b/sound/pci/hda/hda_intel.h @@ -54,6 +54,7 @@ void haswell_set_bclk(struct hda_intel *hda); int hda_i915_init(struct hda_intel *hda); int hda_i915_init_bpo(struct hda_intel *hda); int hda_i915_exit(struct hda_intel *hda); +int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *); #else static inline int hda_set_codec_wakeup(struct hda_intel *hda, bool enable) { @@ -80,6 +81,10 @@ static inline int hda_i915_exit_bpo(void) { return 0; } +static inline int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *) +{ + return -ENODEV; +} #endif #endif