[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (1/9)
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / sound / seq_device.h
blob204ca540c28ec0aa7998912c416a2665873e559c
1 #ifndef __SOUND_SEQ_DEVICE_H
2 #define __SOUND_SEQ_DEVICE_H
4 /*
5 * ALSA sequencer device management
6 * Copyright (c) 1999 by Takashi Iwai <tiwai@suse.de>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 typedef struct snd_seq_device snd_seq_device_t;
25 typedef struct snd_seq_dev_ops snd_seq_dev_ops_t;
28 * registered device information
31 #define ID_LEN 32
33 /* status flag */
34 #define SNDRV_SEQ_DEVICE_FREE 0
35 #define SNDRV_SEQ_DEVICE_REGISTERED 1
37 struct snd_seq_device {
38 /* device info */
39 snd_card_t *card; /* sound card */
40 int device; /* device number */
41 char id[ID_LEN]; /* driver id */
42 char name[80]; /* device name */
43 int argsize; /* size of the argument */
44 void *driver_data; /* private data for driver */
45 int status; /* flag - read only */
46 void *private_data; /* private data for the caller */
47 void (*private_free)(snd_seq_device_t *device);
48 struct list_head list; /* link to next device */
52 /* driver operators
53 * init_device:
54 * Initialize the device with given parameters.
55 * Typically,
56 * 1. call snd_hwdep_new
57 * 2. allocate private data and initialize it
58 * 3. call snd_hwdep_register
59 * 4. store the instance to dev->driver_data pointer.
61 * free_device:
62 * Release the private data.
63 * Typically, call snd_device_free(dev->card, dev->driver_data)
65 struct snd_seq_dev_ops {
66 int (*init_device)(snd_seq_device_t *dev);
67 int (*free_device)(snd_seq_device_t *dev);
71 * prototypes
73 void snd_seq_device_load_drivers(void);
74 int snd_seq_device_new(snd_card_t *card, int device, char *id, int argsize, snd_seq_device_t **result);
75 int snd_seq_device_register_driver(char *id, snd_seq_dev_ops_t *entry, int argsize);
76 int snd_seq_device_unregister_driver(char *id);
78 #define SNDRV_SEQ_DEVICE_ARGPTR(dev) (void *)((char *)(dev) + sizeof(snd_seq_device_t))
82 * id strings for generic devices
84 #define SNDRV_SEQ_DEV_ID_MIDISYNTH "seq-midi"
85 #define SNDRV_SEQ_DEV_ID_OPL3 "opl3-synth"
88 #endif /* __SOUND_SEQ_DEVICE_H */