drm/i915: extract intel_lpe_audio.h from i915_drv.h
authorJani Nikula <jani.nikula@intel.com>
Thu, 2 May 2019 15:02:41 +0000 (18:02 +0300)
committerJani Nikula <jani.nikula@intel.com>
Fri, 3 May 2019 07:06:32 +0000 (10:06 +0300)
It used to be handy that we only had a couple of headers, but over time
i915_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: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/9101a58b9f10bcf11332175e17b6e6e45f4ebd17.1556809195.git.jani.nikula@intel.com
drivers/gpu/drm/i915/Makefile.header-test
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/intel_audio.c
drivers/gpu/drm/i915/intel_lpe_audio.c
drivers/gpu/drm/i915/intel_lpe_audio.h [new file with mode: 0644]

index 459b84f84c2abaa99a65ea4c2ceca9f41abac4f1..4375ff4abd8ece868432a27715399e80976661d9 100644 (file)
@@ -42,6 +42,7 @@ header_test := \
        intel_hdcp.h \
        intel_hdmi.h \
        intel_hotplug.h \
+       intel_lpe_audio.h \
        intel_lspcon.h \
        intel_lvds.h \
        intel_overlay.h \
index 85cc5e1260653c7faf3116a19845ff3d285e4f56..91efe2864bb135aca3d12b484a813a9c27b049d1 100644 (file)
@@ -3247,14 +3247,6 @@ extern int i915_restore_state(struct drm_i915_private *dev_priv);
 void i915_setup_sysfs(struct drm_i915_private *dev_priv);
 void i915_teardown_sysfs(struct drm_i915_private *dev_priv);
 
-/* intel_lpe_audio.c */
-int  intel_lpe_audio_init(struct drm_i915_private *dev_priv);
-void intel_lpe_audio_teardown(struct drm_i915_private *dev_priv);
-void intel_lpe_audio_irq_handler(struct drm_i915_private *dev_priv);
-void intel_lpe_audio_notify(struct drm_i915_private *dev_priv,
-                           enum pipe pipe, enum port port,
-                           const void *eld, int ls_clock, bool dp_output);
-
 /* intel_i2c.c */
 extern int intel_setup_gmbus(struct drm_i915_private *dev_priv);
 extern void intel_teardown_gmbus(struct drm_i915_private *dev_priv);
index e31137bd86f7208f5436821b6a8dd9d959aa5cbb..233211fde0eabb17e8c4e28d714f5b6c66ff38da 100644 (file)
@@ -43,6 +43,7 @@
 #include "intel_drv.h"
 #include "intel_fifo_underrun.h"
 #include "intel_hotplug.h"
+#include "intel_lpe_audio.h"
 #include "intel_psr.h"
 
 /**
index 5c0b73f638434b44dbfecefbb4e15e8a79c33e73..840daff122464e3def177a81c99e62e043156e96 100644 (file)
 
 #include <drm/drm_edid.h>
 #include <drm/i915_component.h>
-#include <drm/intel_lpe_audio.h>
 
 #include "i915_drv.h"
 #include "intel_audio.h"
 #include "intel_drv.h"
+#include "intel_lpe_audio.h"
 
 /**
  * DOC: High Definition Audio over HDMI and Display Port
index f8239bca38202d33a5ee42de7e0de9a8a853277d..b19800b58442590379fcb531647d8a1469ee0358 100644 (file)
  */
 
 #include <linux/acpi.h>
+#include <linux/delay.h>
 #include <linux/device.h>
 #include <linux/irq.h>
 #include <linux/pci.h>
-#include <linux/pm_runtime.h>
 #include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
 
-#include "i915_drv.h"
-#include <linux/delay.h>
 #include <drm/intel_lpe_audio.h>
 
+#include "i915_drv.h"
+#include "intel_lpe_audio.h"
+
 #define HAS_LPE_AUDIO(dev_priv) ((dev_priv)->lpe_audio.platdev != NULL)
 
 static struct platform_device *
diff --git a/drivers/gpu/drm/i915/intel_lpe_audio.h b/drivers/gpu/drm/i915/intel_lpe_audio.h
new file mode 100644 (file)
index 0000000..f848c50
--- /dev/null
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_LPE_AUDIO_H__
+#define __INTEL_LPE_AUDIO_H__
+
+#include <linux/types.h>
+
+enum pipe;
+enum port;
+struct drm_i915_private;
+
+int  intel_lpe_audio_init(struct drm_i915_private *dev_priv);
+void intel_lpe_audio_teardown(struct drm_i915_private *dev_priv);
+void intel_lpe_audio_irq_handler(struct drm_i915_private *dev_priv);
+void intel_lpe_audio_notify(struct drm_i915_private *dev_priv,
+                           enum pipe pipe, enum port port,
+                           const void *eld, int ls_clock, bool dp_output);
+
+#endif /* __INTEL_LPE_AUDIO_H__ */