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

TOMOYO Linux Cross Reference
Linux/include/sound/hda_chmap.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ 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: GPL-2.0 */
  2 /*
  3  * For multichannel support
  4  */
  5 
  6 #ifndef __SOUND_HDA_CHMAP_H
  7 #define __SOUND_HDA_CHMAP_H
  8 
  9 #include <sound/pcm.h>
 10 #include <sound/hdaudio.h>
 11 
 12 
 13 #define SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE 80
 14 
 15 struct hdac_cea_channel_speaker_allocation {
 16         int ca_index;
 17         int speakers[8];
 18 
 19         /* derived values, just for convenience */
 20         int channels;
 21         int spk_mask;
 22 };
 23 struct hdac_chmap;
 24 
 25 struct hdac_chmap_ops {
 26         /*
 27          * Helpers for producing the channel map TLVs. These can be overridden
 28          * for devices that have non-standard mapping requirements.
 29          */
 30         int (*chmap_cea_alloc_validate_get_type)(struct hdac_chmap *chmap,
 31                 struct hdac_cea_channel_speaker_allocation *cap, int channels);
 32         void (*cea_alloc_to_tlv_chmap)(struct hdac_chmap *hchmap,
 33                 struct hdac_cea_channel_speaker_allocation *cap,
 34                 unsigned int *chmap, int channels);
 35 
 36         /* check that the user-given chmap is supported */
 37         int (*chmap_validate)(struct hdac_chmap *hchmap, int ca,
 38                         int channels, unsigned char *chmap);
 39 
 40         int (*get_spk_alloc)(struct hdac_device *hdac, int pcm_idx);
 41 
 42         void (*get_chmap)(struct hdac_device *hdac, int pcm_idx,
 43                                         unsigned char *chmap);
 44         void (*set_chmap)(struct hdac_device *hdac, int pcm_idx,
 45                         unsigned char *chmap, int prepared);
 46         bool (*is_pcm_attached)(struct hdac_device *hdac, int pcm_idx);
 47 
 48         /* get and set channel assigned to each HDMI ASP (audio sample packet) slot */
 49         int (*pin_get_slot_channel)(struct hdac_device *codec,
 50                         hda_nid_t pin_nid, int asp_slot);
 51         int (*pin_set_slot_channel)(struct hdac_device *codec,
 52                         hda_nid_t pin_nid, int asp_slot, int channel);
 53         void (*set_channel_count)(struct hdac_device *codec,
 54                                 hda_nid_t cvt_nid, int chs);
 55 };
 56 
 57 struct hdac_chmap {
 58         unsigned int channels_max; /* max over all cvts */
 59         struct hdac_chmap_ops ops;
 60         struct hdac_device *hdac;
 61 };
 62 
 63 void snd_hdac_register_chmap_ops(struct hdac_device *hdac,
 64                                 struct hdac_chmap *chmap);
 65 int snd_hdac_channel_allocation(struct hdac_device *hdac, int spk_alloc,
 66                         int channels, bool chmap_set,
 67                         bool non_pcm, unsigned char *map);
 68 int snd_hdac_get_active_channels(int ca);
 69 void snd_hdac_setup_channel_mapping(struct hdac_chmap *chmap,
 70                        hda_nid_t pin_nid, bool non_pcm, int ca,
 71                        int channels, unsigned char *map,
 72                        bool chmap_set);
 73 void snd_hdac_print_channel_allocation(int spk_alloc, char *buf, int buflen);
 74 struct hdac_cea_channel_speaker_allocation *snd_hdac_get_ch_alloc_from_ca(int ca);
 75 int snd_hdac_chmap_to_spk_mask(unsigned char c);
 76 int snd_hdac_spk_to_chmap(int spk);
 77 int snd_hdac_add_chmap_ctls(struct snd_pcm *pcm, int pcm_idx,
 78                                 struct hdac_chmap *chmap);
 79 #endif /* __SOUND_HDA_CHMAP_H */
 80 

~ [ 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