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

TOMOYO Linux Cross Reference
Linux/sound/pci/hda/hda_component.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /sound/pci/hda/hda_component.h (Architecture sparc64) and /sound/pci/hda/hda_component.h (Architecture mips)


  1 /* SPDX-License-Identifier: GPL-2.0-or-later *      1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*                                                  2 /*
  3  * HD audio Component Binding Interface             3  * HD audio Component Binding Interface
  4  *                                                  4  *
  5  * Copyright (C) 2021 Cirrus Logic, Inc. and        5  * Copyright (C) 2021 Cirrus Logic, Inc. and
  6  *                    Cirrus Logic Internation      6  *                    Cirrus Logic International Semiconductor Ltd.
  7  */                                                 7  */
  8                                                     8 
  9 #ifndef __HDA_COMPONENT_H__                         9 #ifndef __HDA_COMPONENT_H__
 10 #define __HDA_COMPONENT_H__                        10 #define __HDA_COMPONENT_H__
 11                                                    11 
 12 #include <linux/acpi.h>                            12 #include <linux/acpi.h>
 13 #include <linux/component.h>                       13 #include <linux/component.h>
 14 #include <linux/mutex.h>                           14 #include <linux/mutex.h>
 15 #include <sound/hda_codec.h>                       15 #include <sound/hda_codec.h>
 16                                                    16 
 17 #define HDA_MAX_COMPONENTS      4                  17 #define HDA_MAX_COMPONENTS      4
 18 #define HDA_MAX_NAME_SIZE       50                 18 #define HDA_MAX_NAME_SIZE       50
 19                                                    19 
 20 struct hda_component {                             20 struct hda_component {
 21         struct device *dev;                        21         struct device *dev;
 22         char name[HDA_MAX_NAME_SIZE];              22         char name[HDA_MAX_NAME_SIZE];
 23         struct acpi_device *adev;                  23         struct acpi_device *adev;
 24         bool acpi_notifications_supported;         24         bool acpi_notifications_supported;
 25         void (*acpi_notify)(acpi_handle handle     25         void (*acpi_notify)(acpi_handle handle, u32 event, struct device *dev);
 26         void (*pre_playback_hook)(struct devic     26         void (*pre_playback_hook)(struct device *dev, int action);
 27         void (*playback_hook)(struct device *d     27         void (*playback_hook)(struct device *dev, int action);
 28         void (*post_playback_hook)(struct devi     28         void (*post_playback_hook)(struct device *dev, int action);
 29 };                                                 29 };
 30                                                    30 
 31 struct hda_component_parent {                      31 struct hda_component_parent {
 32         struct mutex mutex;                        32         struct mutex mutex;
 33         struct hda_codec *codec;                   33         struct hda_codec *codec;
 34         struct hda_component comps[HDA_MAX_COM     34         struct hda_component comps[HDA_MAX_COMPONENTS];
 35 };                                                 35 };
 36                                                    36 
 37 #ifdef CONFIG_ACPI                                 37 #ifdef CONFIG_ACPI
 38 void hda_component_acpi_device_notify(struct h     38 void hda_component_acpi_device_notify(struct hda_component_parent *parent,
 39                                       acpi_han     39                                       acpi_handle handle, u32 event, void *data);
 40 int hda_component_manager_bind_acpi_notificati     40 int hda_component_manager_bind_acpi_notifications(struct hda_codec *cdc,
 41                                                    41                                                   struct hda_component_parent *parent,
 42                                                    42                                                   acpi_notify_handler handler, void *data);
 43 void hda_component_manager_unbind_acpi_notific     43 void hda_component_manager_unbind_acpi_notifications(struct hda_codec *cdc,
 44                                                    44                                                      struct hda_component_parent *parent,
 45                                                    45                                                      acpi_notify_handler handler);
 46 #else                                              46 #else
 47 static inline void hda_component_acpi_device_n     47 static inline void hda_component_acpi_device_notify(struct hda_component_parent *parent,
 48                                                    48                                                     acpi_handle handle,
 49                                                    49                                                     u32 event,
 50                                                    50                                                     void *data)
 51 {                                                  51 {
 52 }                                                  52 }
 53                                                    53 
 54 static inline int hda_component_manager_bind_a     54 static inline int hda_component_manager_bind_acpi_notifications(struct hda_codec *cdc,
 55                                                    55                                                                 struct hda_component_parent *parent,
 56                                                    56                                                                 acpi_notify_handler handler,
 57                                                    57                                                                 void *data)
 58                                                    58 
 59 {                                                  59 {
 60         return 0;                                  60         return 0;
 61 }                                                  61 }
 62                                                    62 
 63 static inline void hda_component_manager_unbin     63 static inline void hda_component_manager_unbind_acpi_notifications(struct hda_codec *cdc,
 64                                                    64                                                                    struct hda_component_parent *parent,
 65                                                    65                                                                    acpi_notify_handler handler)
 66 {                                                  66 {
 67 }                                                  67 }
 68 #endif /* ifdef CONFIG_ACPI */                     68 #endif /* ifdef CONFIG_ACPI */
 69                                                    69 
 70 void hda_component_manager_playback_hook(struc     70 void hda_component_manager_playback_hook(struct hda_component_parent *parent, int action);
 71                                                    71 
 72 int hda_component_manager_init(struct hda_code     72 int hda_component_manager_init(struct hda_codec *cdc,
 73                                struct hda_comp     73                                struct hda_component_parent *parent, int count,
 74                                const char *bus     74                                const char *bus, const char *hid,
 75                                const char *mat     75                                const char *match_str,
 76                                const struct co     76                                const struct component_master_ops *ops);
 77                                                    77 
 78 void hda_component_manager_free(struct hda_com     78 void hda_component_manager_free(struct hda_component_parent *parent,
 79                                 const struct c     79                                 const struct component_master_ops *ops);
 80                                                    80 
 81 int hda_component_manager_bind(struct hda_code     81 int hda_component_manager_bind(struct hda_codec *cdc, struct hda_component_parent *parent);
 82                                                    82 
 83 static inline struct hda_component *hda_compon     83 static inline struct hda_component *hda_component_from_index(struct hda_component_parent *parent,
 84                                                    84                                                              int index)
 85 {                                                  85 {
 86         if (!parent)                               86         if (!parent)
 87                 return NULL;                       87                 return NULL;
 88                                                    88 
 89         if (index < 0 || index >= ARRAY_SIZE(p     89         if (index < 0 || index >= ARRAY_SIZE(parent->comps))
 90                 return NULL;                       90                 return NULL;
 91                                                    91 
 92         return &parent->comps[index];              92         return &parent->comps[index];
 93 }                                                  93 }
 94                                                    94 
 95 static inline void hda_component_manager_unbin     95 static inline void hda_component_manager_unbind(struct hda_codec *cdc,
 96                                                    96                                                 struct hda_component_parent *parent)
 97 {                                                  97 {
 98         mutex_lock(&parent->mutex);                98         mutex_lock(&parent->mutex);
 99         component_unbind_all(hda_codec_dev(cdc     99         component_unbind_all(hda_codec_dev(cdc), parent);
100         mutex_unlock(&parent->mutex);             100         mutex_unlock(&parent->mutex);
101 }                                                 101 }
102                                                   102 
103 #endif /* ifndef __HDA_COMPONENT_H__ */           103 #endif /* ifndef __HDA_COMPONENT_H__ */
104                                                   104 

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