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

TOMOYO Linux Cross Reference
Linux/sound/aoa/aoa.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-only */
  2 /*
  3  * Apple Onboard Audio definitions
  4  *
  5  * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
  6  */
  7 
  8 #ifndef __AOA_H
  9 #define __AOA_H
 10 #include <linux/module.h>
 11 #include <sound/core.h>
 12 #include <sound/asound.h>
 13 #include <sound/control.h>
 14 #include "aoa-gpio.h"
 15 #include "soundbus/soundbus.h"
 16 
 17 #define MAX_CODEC_NAME_LEN      32
 18 
 19 struct aoa_codec {
 20         char    name[MAX_CODEC_NAME_LEN];
 21 
 22         struct module *owner;
 23 
 24         /* called when the fabric wants to init this codec.
 25          * Do alsa card manipulations from here. */
 26         int (*init)(struct aoa_codec *codec);
 27 
 28         /* called when the fabric is done with the codec.
 29          * The alsa card will be cleaned up so don't bother. */
 30         void (*exit)(struct aoa_codec *codec);
 31 
 32         /* May be NULL, but can be used by the fabric.
 33          * Refcounting is the codec driver's responsibility */
 34         struct device_node *node;
 35 
 36         /* assigned by fabric before init() is called, points
 37          * to the soundbus device. Cannot be NULL. */
 38         struct soundbus_dev *soundbus_dev;
 39 
 40         /* assigned by the fabric before init() is called, points
 41          * to the fabric's gpio runtime record for the relevant
 42          * device. */
 43         struct gpio_runtime *gpio;
 44 
 45         /* assigned by the fabric before init() is called, contains
 46          * a codec specific bitmask of what outputs and inputs are
 47          * actually connected */
 48         u32 connected;
 49 
 50         /* data the fabric can associate with this structure */
 51         void *fabric_data;
 52 
 53         /* private! */
 54         struct list_head list;
 55         struct aoa_fabric *fabric;
 56 };
 57 
 58 /* return 0 on success */
 59 extern int
 60 aoa_codec_register(struct aoa_codec *codec);
 61 extern void
 62 aoa_codec_unregister(struct aoa_codec *codec);
 63 
 64 #define MAX_LAYOUT_NAME_LEN     32
 65 
 66 struct aoa_fabric {
 67         char    name[MAX_LAYOUT_NAME_LEN];
 68 
 69         struct module *owner;
 70 
 71         /* once codecs register, they are passed here after.
 72          * They are of course not initialised, since the
 73          * fabric is responsible for initialising some fields
 74          * in the codec structure! */
 75         int (*found_codec)(struct aoa_codec *codec);
 76         /* called for each codec when it is removed,
 77          * also in the case that aoa_fabric_unregister
 78          * is called and all codecs are removed
 79          * from this fabric.
 80          * Also called if found_codec returned 0 but
 81          * the codec couldn't initialise. */
 82         void (*remove_codec)(struct aoa_codec *codec);
 83         /* If found_codec returned 0, and the codec
 84          * could be initialised, this is called. */
 85         void (*attached_codec)(struct aoa_codec *codec);
 86 };
 87 
 88 /* return 0 on success, -EEXIST if another fabric is
 89  * registered, -EALREADY if the same fabric is registered.
 90  * Passing NULL can be used to test for the presence
 91  * of another fabric, if -EALREADY is returned there is
 92  * no other fabric present.
 93  * In the case that the function returns -EALREADY
 94  * and the fabric passed is not NULL, all codecs
 95  * that are not assigned yet are passed to the fabric
 96  * again for reconsideration. */
 97 extern int
 98 aoa_fabric_register(struct aoa_fabric *fabric, struct device *dev);
 99 
100 /* it is vital to call this when the fabric exits!
101  * When calling, the remove_codec will be called
102  * for all codecs, unless it is NULL. */
103 extern void
104 aoa_fabric_unregister(struct aoa_fabric *fabric);
105 
106 /* if for some reason you want to get rid of a codec
107  * before the fabric is removed, use this.
108  * Note that remove_codec is called for it! */
109 extern void
110 aoa_fabric_unlink_codec(struct aoa_codec *codec);
111 
112 /* alsa help methods */
113 struct aoa_card {
114         struct snd_card *alsa_card;
115 };
116         
117 extern int aoa_snd_device_new(enum snd_device_type type,
118         void *device_data, const struct snd_device_ops *ops);
119 extern struct snd_card *aoa_get_card(void);
120 extern int aoa_snd_ctl_add(struct snd_kcontrol* control);
121 
122 /* GPIO stuff */
123 extern struct gpio_methods *pmf_gpio_methods;
124 extern struct gpio_methods *ftr_gpio_methods;
125 /* extern struct gpio_methods *map_gpio_methods; */
126 
127 #endif /* __AOA_H */
128 

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