Commit 331c201a authored by Jani Nikula's avatar Jani Nikula

drm/i915: extract intel_audio.h from intel_drv.h

It used to be handy that we only had a couple of headers, but over time
intel_drv.h has become unwieldy. Extract declarations to a separate
header file corresponding to the implementation module, clarifying the
modularity of the driver.

Ensure the new header is self-contained, and do so with minimal further
includes, using forward declarations as needed. Include the new header
only where needed, and sort the modified include directives while at it
and as needed.

No functional changes.
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Acked-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/e0284c4d62effa5bad72ce034206c26e3aa02884.1554461791.git.jani.nikula@intel.com
parent e1ef734e
...@@ -8,6 +8,7 @@ header_test := \ ...@@ -8,6 +8,7 @@ header_test := \
i915_priolist_types.h \ i915_priolist_types.h \
i915_scheduler_types.h \ i915_scheduler_types.h \
i915_timeline_types.h \ i915_timeline_types.h \
intel_audio.h \
intel_context_types.h \ intel_context_types.h \
intel_engine_types.h \ intel_engine_types.h \
intel_frontbuffer.h \ intel_frontbuffer.h \
......
...@@ -48,11 +48,12 @@ ...@@ -48,11 +48,12 @@
#include <drm/i915_drm.h> #include <drm/i915_drm.h>
#include "i915_drv.h" #include "i915_drv.h"
#include "i915_trace.h"
#include "i915_pmu.h" #include "i915_pmu.h"
#include "i915_reset.h"
#include "i915_query.h" #include "i915_query.h"
#include "i915_reset.h"
#include "i915_trace.h"
#include "i915_vgpu.h" #include "i915_vgpu.h"
#include "intel_audio.h"
#include "intel_drv.h" #include "intel_drv.h"
#include "intel_uc.h" #include "intel_uc.h"
#include "intel_workarounds.h" #include "intel_workarounds.h"
......
...@@ -21,14 +21,16 @@ ...@@ -21,14 +21,16 @@
* DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
*/ */
#include <linux/kernel.h>
#include <linux/component.h> #include <linux/component.h>
#include <linux/kernel.h>
#include <drm/drm_edid.h>
#include <drm/i915_component.h> #include <drm/i915_component.h>
#include <drm/intel_lpe_audio.h> #include <drm/intel_lpe_audio.h>
#include "intel_drv.h"
#include <drm/drm_edid.h>
#include "i915_drv.h" #include "i915_drv.h"
#include "intel_audio.h"
#include "intel_drv.h"
/** /**
* DOC: High Definition Audio over HDMI and Display Port * DOC: High Definition Audio over HDMI and Display Port
...@@ -1045,7 +1047,7 @@ static const struct component_ops i915_audio_component_bind_ops = { ...@@ -1045,7 +1047,7 @@ static const struct component_ops i915_audio_component_bind_ops = {
* We ignore any error during registration and continue with reduced * We ignore any error during registration and continue with reduced
* functionality (i.e. without HDMI audio). * functionality (i.e. without HDMI audio).
*/ */
void i915_audio_component_init(struct drm_i915_private *dev_priv) static void i915_audio_component_init(struct drm_i915_private *dev_priv)
{ {
int ret; int ret;
...@@ -1068,7 +1070,7 @@ void i915_audio_component_init(struct drm_i915_private *dev_priv) ...@@ -1068,7 +1070,7 @@ void i915_audio_component_init(struct drm_i915_private *dev_priv)
* Deregisters the audio component, breaking any existing binding to the * Deregisters the audio component, breaking any existing binding to the
* corresponding snd_hda_intel driver's master component. * corresponding snd_hda_intel driver's master component.
*/ */
void i915_audio_component_cleanup(struct drm_i915_private *dev_priv) static void i915_audio_component_cleanup(struct drm_i915_private *dev_priv)
{ {
if (!dev_priv->audio_component_registered) if (!dev_priv->audio_component_registered)
return; return;
......
/* SPDX-License-Identifier: MIT */
/*
* Copyright © 2019 Intel Corporation
*/
#ifndef __INTEL_AUDIO_H__
#define __INTEL_AUDIO_H__
struct drm_connector_state;
struct drm_i915_private;
struct intel_crtc_state;
struct intel_encoder;
void intel_init_audio_hooks(struct drm_i915_private *dev_priv);
void intel_audio_codec_enable(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state);
void intel_audio_codec_disable(struct intel_encoder *encoder,
const struct intel_crtc_state *old_crtc_state,
const struct drm_connector_state *old_conn_state);
void intel_audio_init(struct drm_i915_private *dev_priv);
void intel_audio_deinit(struct drm_i915_private *dev_priv);
#endif /* __INTEL_AUDIO_H__ */
...@@ -26,7 +26,9 @@ ...@@ -26,7 +26,9 @@
*/ */
#include <drm/drm_scdc_helper.h> #include <drm/drm_scdc_helper.h>
#include "i915_drv.h" #include "i915_drv.h"
#include "intel_audio.h"
#include "intel_drv.h" #include "intel_drv.h"
#include "intel_dsi.h" #include "intel_dsi.h"
......
...@@ -25,22 +25,25 @@ ...@@ -25,22 +25,25 @@
* *
*/ */
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/types.h> #include <linux/i2c.h>
#include <linux/notifier.h> #include <linux/notifier.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <drm/drm_atomic_helper.h> #include <drm/drm_atomic_helper.h>
#include <drm/drm_crtc.h> #include <drm/drm_crtc.h>
#include <drm/drm_dp_helper.h> #include <drm/drm_dp_helper.h>
#include <drm/drm_edid.h> #include <drm/drm_edid.h>
#include <drm/drm_hdcp.h> #include <drm/drm_hdcp.h>
#include <drm/drm_probe_helper.h> #include <drm/drm_probe_helper.h>
#include "intel_drv.h"
#include <drm/i915_drm.h> #include <drm/i915_drm.h>
#include "i915_drv.h" #include "i915_drv.h"
#include "intel_audio.h"
#include "intel_drv.h"
#define DP_DPRX_ESI_LEN 14 #define DP_DPRX_ESI_LEN 14
......
...@@ -23,12 +23,14 @@ ...@@ -23,12 +23,14 @@
* *
*/ */
#include "i915_drv.h"
#include "intel_drv.h"
#include <drm/drm_atomic_helper.h> #include <drm/drm_atomic_helper.h>
#include <drm/drm_edid.h> #include <drm/drm_edid.h>
#include <drm/drm_probe_helper.h> #include <drm/drm_probe_helper.h>
#include "i915_drv.h"
#include "intel_audio.h"
#include "intel_drv.h"
static int intel_dp_mst_compute_link_config(struct intel_encoder *encoder, static int intel_dp_mst_compute_link_config(struct intel_encoder *encoder,
struct intel_crtc_state *crtc_state, struct intel_crtc_state *crtc_state,
struct drm_connector_state *conn_state, struct drm_connector_state *conn_state,
......
...@@ -1669,19 +1669,6 @@ int cnl_calc_wrpll_link(struct drm_i915_private *dev_priv, ...@@ -1669,19 +1669,6 @@ int cnl_calc_wrpll_link(struct drm_i915_private *dev_priv,
unsigned int intel_fb_align_height(const struct drm_framebuffer *fb, unsigned int intel_fb_align_height(const struct drm_framebuffer *fb,
int color_plane, unsigned int height); int color_plane, unsigned int height);
/* intel_audio.c */
void intel_init_audio_hooks(struct drm_i915_private *dev_priv);
void intel_audio_codec_enable(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state);
void intel_audio_codec_disable(struct intel_encoder *encoder,
const struct intel_crtc_state *old_crtc_state,
const struct drm_connector_state *old_conn_state);
void i915_audio_component_init(struct drm_i915_private *dev_priv);
void i915_audio_component_cleanup(struct drm_i915_private *dev_priv);
void intel_audio_init(struct drm_i915_private *dev_priv);
void intel_audio_deinit(struct drm_i915_private *dev_priv);
/* intel_cdclk.c */ /* intel_cdclk.c */
int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state); int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state);
void skl_init_cdclk(struct drm_i915_private *dev_priv); void skl_init_cdclk(struct drm_i915_private *dev_priv);
......
...@@ -26,19 +26,22 @@ ...@@ -26,19 +26,22 @@
* Jesse Barnes <jesse.barnes@intel.com> * Jesse Barnes <jesse.barnes@intel.com>
*/ */
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/hdmi.h> #include <linux/hdmi.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <drm/drm_atomic_helper.h> #include <drm/drm_atomic_helper.h>
#include <drm/drm_crtc.h> #include <drm/drm_crtc.h>
#include <drm/drm_edid.h> #include <drm/drm_edid.h>
#include <drm/drm_hdcp.h> #include <drm/drm_hdcp.h>
#include <drm/drm_scdc_helper.h> #include <drm/drm_scdc_helper.h>
#include "intel_drv.h"
#include <drm/i915_drm.h> #include <drm/i915_drm.h>
#include <drm/intel_lpe_audio.h> #include <drm/intel_lpe_audio.h>
#include "i915_drv.h" #include "i915_drv.h"
#include "intel_audio.h"
#include "intel_drv.h"
static struct drm_device *intel_hdmi_to_dev(struct intel_hdmi *intel_hdmi) static struct drm_device *intel_hdmi_to_dev(struct intel_hdmi *intel_hdmi)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment