~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/drm/drm_audio_component.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: MIT
  2 // Copyright © 2014 Intel Corporation
  3 
  4 #ifndef _DRM_AUDIO_COMPONENT_H_
  5 #define _DRM_AUDIO_COMPONENT_H_
  6 
  7 #include <linux/completion.h>
  8 #include <linux/types.h>
  9 
 10 struct drm_audio_component;
 11 struct device;
 12 
 13 /**
 14  * struct drm_audio_component_ops - Ops implemented by DRM driver, called by hda driver
 15  */
 16 struct drm_audio_component_ops {
 17         /**
 18          * @owner: drm module to pin down
 19          */
 20         struct module *owner;
 21         /**
 22          * @get_power: get the POWER_DOMAIN_AUDIO power well
 23          *
 24          * Request the power well to be turned on.
 25          *
 26          * Returns a wakeref cookie to be passed back to the corresponding
 27          * call to @put_power.
 28          */
 29         unsigned long (*get_power)(struct device *);
 30         /**
 31          * @put_power: put the POWER_DOMAIN_AUDIO power well
 32          *
 33          * Allow the power well to be turned off.
 34          */
 35         void (*put_power)(struct device *, unsigned long);
 36         /**
 37          * @codec_wake_override: Enable/disable codec wake signal
 38          */
 39         void (*codec_wake_override)(struct device *, bool enable);
 40         /**
 41          * @get_cdclk_freq: Get the Core Display Clock in kHz
 42          */
 43         int (*get_cdclk_freq)(struct device *);
 44         /**
 45          * @sync_audio_rate: set n/cts based on the sample rate
 46          *
 47          * Called from audio driver. After audio driver sets the
 48          * sample rate, it will call this function to set n/cts
 49          */
 50         int (*sync_audio_rate)(struct device *, int port, int pipe, int rate);
 51         /**
 52          * @get_eld: fill the audio state and ELD bytes for the given port
 53          *
 54          * Called from audio driver to get the HDMI/DP audio state of the given
 55          * digital port, and also fetch ELD bytes to the given pointer.
 56          *
 57          * It returns the byte size of the original ELD (not the actually
 58          * copied size), zero for an invalid ELD, or a negative error code.
 59          *
 60          * Note that the returned size may be over @max_bytes.  Then it
 61          * implies that only a part of ELD has been copied to the buffer.
 62          */
 63         int (*get_eld)(struct device *, int port, int pipe, bool *enabled,
 64                        unsigned char *buf, int max_bytes);
 65 };
 66 
 67 /**
 68  * struct drm_audio_component_audio_ops - Ops implemented by hda driver, called by DRM driver
 69  */
 70 struct drm_audio_component_audio_ops {
 71         /**
 72          * @audio_ptr: Pointer to be used in call to pin_eld_notify
 73          */
 74         void *audio_ptr;
 75         /**
 76          * @pin_eld_notify: Notify the HDA driver that pin sense and/or ELD information has changed
 77          *
 78          * Called when the DRM driver has set up audio pipeline or has just
 79          * begun to tear it down. This allows the HDA driver to update its
 80          * status accordingly (even when the HDA controller is in power save
 81          * mode).
 82          */
 83         void (*pin_eld_notify)(void *audio_ptr, int port, int pipe);
 84         /**
 85          * @pin2port: Check and convert from pin node to port number
 86          *
 87          * Called by HDA driver to check and convert from the pin widget node
 88          * number to a port number in the graphics side.
 89          */
 90         int (*pin2port)(void *audio_ptr, int pin);
 91         /**
 92          * @master_bind: (Optional) component master bind callback
 93          *
 94          * Called at binding master component, for HDA codec-specific
 95          * handling of dynamic binding.
 96          */
 97         int (*master_bind)(struct device *dev, struct drm_audio_component *);
 98         /**
 99          * @master_unbind: (Optional) component master unbind callback
100          *
101          * Called at unbinding master component, for HDA codec-specific
102          * handling of dynamic unbinding.
103          */
104         void (*master_unbind)(struct device *dev, struct drm_audio_component *);
105 };
106 
107 /**
108  * struct drm_audio_component - Used for direct communication between DRM and hda drivers
109  */
110 struct drm_audio_component {
111         /**
112          * @dev: DRM device, used as parameter for ops
113          */
114         struct device *dev;
115         /**
116          * @ops: Ops implemented by DRM driver, called by hda driver
117          */
118         const struct drm_audio_component_ops *ops;
119         /**
120          * @audio_ops: Ops implemented by hda driver, called by DRM driver
121          */
122         const struct drm_audio_component_audio_ops *audio_ops;
123         /**
124          * @master_bind_complete: completion held during component master binding
125          */
126         struct completion master_bind_complete;
127 };
128 
129 #endif /* _DRM_AUDIO_COMPONENT_H_ */
130 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php