mirror of
https://github.com/torvalds/linux.git
synced 2024-11-18 01:51:53 +00:00
drm/i915: cleanup opregion asle pipestat enable
Both intel_opregion_enable_asle() and intel_enable_asle() have shrunk considerably. Merge them together into a static function in i915_irq.c, and rename to better reflect the purpose and the related platforms. No functional changes. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
f898780ba0
commit
f49e38dd23
@ -1484,8 +1484,6 @@ i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask);
|
||||
void
|
||||
i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask);
|
||||
|
||||
void intel_enable_asle(struct drm_device *dev);
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
extern void i915_destroy_error_state(struct drm_device *dev);
|
||||
#else
|
||||
@ -1819,12 +1817,10 @@ extern int intel_opregion_setup(struct drm_device *dev);
|
||||
extern void intel_opregion_init(struct drm_device *dev);
|
||||
extern void intel_opregion_fini(struct drm_device *dev);
|
||||
extern void intel_opregion_asle_intr(struct drm_device *dev);
|
||||
extern void intel_opregion_enable_asle(struct drm_device *dev);
|
||||
#else
|
||||
static inline void intel_opregion_init(struct drm_device *dev) { return; }
|
||||
static inline void intel_opregion_fini(struct drm_device *dev) { return; }
|
||||
static inline void intel_opregion_asle_intr(struct drm_device *dev) { return; }
|
||||
static inline void intel_opregion_enable_asle(struct drm_device *dev) { return; }
|
||||
#endif
|
||||
|
||||
/* intel_acpi.c */
|
||||
|
@ -349,13 +349,16 @@ i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask)
|
||||
}
|
||||
|
||||
/**
|
||||
* intel_enable_asle - enable ASLE interrupt for OpRegion
|
||||
* i915_enable_asle_pipestat - enable ASLE pipestat for OpRegion
|
||||
*/
|
||||
void intel_enable_asle(struct drm_device *dev)
|
||||
static void i915_enable_asle_pipestat(struct drm_device *dev)
|
||||
{
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
unsigned long irqflags;
|
||||
|
||||
if (!dev_priv->opregion.asle || !IS_MOBILE(dev))
|
||||
return;
|
||||
|
||||
spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
|
||||
|
||||
i915_enable_pipestat(dev_priv, 1, PIPE_LEGACY_BLC_EVENT_ENABLE);
|
||||
@ -2964,7 +2967,7 @@ static int i915_irq_postinstall(struct drm_device *dev)
|
||||
I915_WRITE(IER, enable_mask);
|
||||
POSTING_READ(IER);
|
||||
|
||||
intel_opregion_enable_asle(dev);
|
||||
i915_enable_asle_pipestat(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -3198,7 +3201,7 @@ static int i965_irq_postinstall(struct drm_device *dev)
|
||||
I915_WRITE(PORT_HOTPLUG_EN, 0);
|
||||
POSTING_READ(PORT_HOTPLUG_EN);
|
||||
|
||||
intel_opregion_enable_asle(dev);
|
||||
i915_enable_asle_pipestat(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -232,17 +232,6 @@ void intel_opregion_asle_intr(struct drm_device *dev)
|
||||
iowrite32(asle_stat, &asle->aslc);
|
||||
}
|
||||
|
||||
void intel_opregion_enable_asle(struct drm_device *dev)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct opregion_asle __iomem *asle = dev_priv->opregion.asle;
|
||||
|
||||
if (asle) {
|
||||
if (IS_MOBILE(dev))
|
||||
intel_enable_asle(dev);
|
||||
}
|
||||
}
|
||||
|
||||
#define ACPI_EV_DISPLAY_SWITCH (1<<0)
|
||||
#define ACPI_EV_LID (1<<1)
|
||||
#define ACPI_EV_DOCK (1<<2)
|
||||
|
Loading…
Reference in New Issue
Block a user