From patchwork Mon Oct 12 08:07:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Henningsson X-Patchwork-Id: 7373171 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 92B799F1B9 for ; Mon, 12 Oct 2015 08:08:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9536620883 for ; Mon, 12 Oct 2015 08:08:30 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id D88BD206D2 for ; Mon, 12 Oct 2015 08:08:27 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 40AF526041F; Mon, 12 Oct 2015 10:08:26 +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=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id AD6762602F1; Mon, 12 Oct 2015 10:08:18 +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 2FFD926040E; Mon, 12 Oct 2015 10:08:17 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by alsa0.perex.cz (Postfix) with ESMTP id 1CB5F2602AD for ; Mon, 12 Oct 2015 10:08:10 +0200 (CEST) Received: from c83-251-170-11.bredband.comhem.se ([83.251.170.11] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ZlY9M-0005Gu-RG; Mon, 12 Oct 2015 08:08:04 +0000 From: David Henningsson To: tiwai@suse.de, intel-gfx@lists.freedesktop.org, alsa-devel@alsa-project.org, daniel@ffwll.ch, jani.nikula@linux.intel.com, libin.yang@intel.com Date: Mon, 12 Oct 2015 10:07:57 +0200 Message-Id: <1444637277-17784-1-git-send-email-david.henningsson@canonical.com> X-Mailer: git-send-email 1.9.1 Cc: David Henningsson Subject: [alsa-devel] [PATCH v2] drm/i915: Improve kernel-doc for i915_audio_component struct 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 To make kernel-doc happy, the i915_audio_component_audio_ops struct cannot be nested. Signed-off-by: David Henningsson --- Documentation/DocBook/drm.tmpl | 1 + include/drm/i915_component.h | 92 ++++++++++++++++++++++++++++++------------ 2 files changed, 67 insertions(+), 26 deletions(-) diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl index 9ddf8c6..f16e4e8 100644 --- a/Documentation/DocBook/drm.tmpl +++ b/Documentation/DocBook/drm.tmpl @@ -4051,6 +4051,7 @@ int num_ioctls; High Definition Audio !Pdrivers/gpu/drm/i915/intel_audio.c High Definition Audio over HDMI and Display Port !Idrivers/gpu/drm/i915/intel_audio.c +!Iinclude/drm/i915_component.h Panel Self Refresh PSR (PSR/SRD) diff --git a/include/drm/i915_component.h b/include/drm/i915_component.h index 89dc7d6..76c10c8 100644 --- a/include/drm/i915_component.h +++ b/include/drm/i915_component.h @@ -30,38 +30,78 @@ */ #define MAX_PORTS 5 +/** + * struct i915_audio_component_ops - Ops implemented by i915 driver, called by hda driver + */ +struct i915_audio_component_ops { + /** + * @owner: i915 module + */ + struct module *owner; + /** + * @get_power: Request that power well is to be turned on + */ + void (*get_power)(struct device *); + /** + * @put_power: Allow the power well to be turned off + */ + void (*put_power)(struct device *); + /** + * @codec_wake_override: Force the audio codec to stay awake + */ + void (*codec_wake_override)(struct device *, bool enable); + /** + * @get_cdclk_freq: Query the i915 driver about the current cdclk frequency + */ + int (*get_cdclk_freq)(struct device *); + /** + * @sync_audio_rate: set n/cts based on the sample rate + * + * Called from audio driver. After audio driver sets the + * sample rate, it will call this function to set n/cts + */ + int (*sync_audio_rate)(struct device *, int port, int rate); +}; + +/** + * struct i915_audio_component_audio_ops - Ops implemented by hda driver, called by i915 driver + */ +struct i915_audio_component_audio_ops { + /** + * @audio_ptr: Pointer to be used in call to pin_eld_notify + */ + void *audio_ptr; + /** + * @pin_eld_notify: Notify the HDA driver that pin sense and/or ELD information has changed + * + * Called when the i915 driver has set up audio pipeline or has just + * begun to tear it down. This allows the HDA driver to update its + * status accordingly (even when the HDA controller is in power save + * mode). + */ + void (*pin_eld_notify)(void *audio_ptr, int port); +}; + +/** + * struct i915_audio_component - Used for direct communication between i915 and hda drivers + */ struct i915_audio_component { + /** + * @dev: i915 device, used as parameter for ops + */ struct device *dev; /** * @aud_sample_rate: the array of audio sample rate per port */ int aud_sample_rate[MAX_PORTS]; - - const struct i915_audio_component_ops { - struct module *owner; - void (*get_power)(struct device *); - void (*put_power)(struct device *); - void (*codec_wake_override)(struct device *, bool enable); - int (*get_cdclk_freq)(struct device *); - /** - * @sync_audio_rate: set n/cts based on the sample rate - * - * Called from audio driver. After audio driver sets the - * sample rate, it will call this function to set n/cts - */ - int (*sync_audio_rate)(struct device *, int port, int rate); - } *ops; - - const struct i915_audio_component_audio_ops { - void *audio_ptr; - /** - * Call from i915 driver, notifying the HDA driver that - * pin sense and/or ELD information has changed. - * @audio_ptr: HDA driver object - * @port: Which port has changed (PORTA / PORTB / PORTC etc) - */ - void (*pin_eld_notify)(void *audio_ptr, int port); - } *audio_ops; + /** + * @ops: Ops implemented by i915 driver, called by hda driver + */ + const struct i915_audio_component_ops *ops; + /** + * @audio_ops: Ops implemented by hda driver, called by i915 driver + */ + const struct i915_audio_component_audio_ops *audio_ops; }; #endif /* _I915_COMPONENT_H_ */