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: 7373161 Return-Path: X-Original-To: patchwork-intel-gfx@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 0FDB79F1B9 for ; Mon, 12 Oct 2015 08:08:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1BBAC206D6 for ; Mon, 12 Oct 2015 08:08:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B741A206D2 for ; Mon, 12 Oct 2015 08:08:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 07A7C6E121; Mon, 12 Oct 2015 01:08:13 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by gabe.freedesktop.org (Postfix) with ESMTPS id 75BB56E121 for ; Mon, 12 Oct 2015 01:08:11 -0700 (PDT) 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: [Intel-gfx] [PATCH v2] drm/i915: Improve kernel-doc for i915_audio_component struct X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 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_ */