PERFORCE change 144990 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Thu Jul 10 07:49:29 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=144990
Change 144990 by hselasky at hselasky_laptop001 on 2008/07/10 07:49:13
Diff reduction against head (integrate).
Affected files ...
.. //depot/projects/usb/src/sys/dev/sound/pcm/mixer.c#9 edit
.. //depot/projects/usb/src/sys/dev/sound/pcm/mixer.h#8 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/sound/pcm/mixer.c#9 (text+ko) ====
@@ -32,7 +32,7 @@
MALLOC_DEFINE(M_MIXER, "mixer", "mixer");
-#define MIXER_NAMELEN 16
+#define MIXER_NAMELEN 16
struct snd_mixer {
KOBJ_FIELDS;
void *devinfo;
@@ -42,14 +42,14 @@
int hwvol_step;
int type;
device_t dev;
- uint32_t hwvol_mute_level;
- uint32_t devs;
- uint32_t recdevs;
- uint32_t recsrc;
- uint16_t level[32];
- uint8_t parent[32];
- uint32_t child[32];
- uint8_t realdev[32];
+ u_int32_t hwvol_mute_level;
+ u_int32_t devs;
+ u_int32_t recdevs;
+ u_int32_t recsrc;
+ u_int16_t level[32];
+ u_int8_t parent[32];
+ u_int32_t child[32];
+ u_int8_t realdev[32];
char name[MIXER_NAMELEN];
struct mtx *lock;
oss_mixer_enuminfo enuminfo;
@@ -61,7 +61,7 @@
int modify_counter;
};
-static uint16_t snd_mixerdefaults[SOUND_MIXER_NRDEVICES] = {
+static u_int16_t snd_mixerdefaults[SOUND_MIXER_NRDEVICES] = {
[SOUND_MIXER_VOLUME] = 75,
[SOUND_MIXER_BASS] = 50,
[SOUND_MIXER_TREBLE] = 50,
@@ -126,15 +126,15 @@
}
#endif
-#define MIXER_SET_UNLOCK(x, y) do { \
+#define MIXER_SET_UNLOCK(x, y) do { \
if ((y) != 0) \
snd_mtxunlock((x)->lock); \
-} while (0)
+} while(0)
-#define MIXER_SET_LOCK(x, y) do { \
+#define MIXER_SET_LOCK(x, y) do { \
if ((y) != 0) \
snd_mtxlock((x)->lock); \
-} while (0)
+} while(0)
static int
mixer_set_softpcmvol(struct snd_mixer *m, struct snddev_info *d,
@@ -195,8 +195,8 @@
{
struct snddev_info *d;
unsigned l, r, tl, tr;
- uint32_t parent = SOUND_MIXER_NONE, child = 0;
- uint32_t realdev;
+ u_int32_t parent = SOUND_MIXER_NONE, child = 0;
+ u_int32_t realdev;
int i, dropmtx;
if (m == NULL || dev >= SOUND_MIXER_NRDEVICES ||
@@ -281,7 +281,7 @@
}
static int
-mixer_setrecsrc(struct snd_mixer *mixer, uint32_t src)
+mixer_setrecsrc(struct snd_mixer *mixer, u_int32_t src)
{
struct snddev_info *d;
int dropmtx;
@@ -387,7 +387,7 @@
}
void
-mix_setdevs(struct snd_mixer *m, uint32_t v)
+mix_setdevs(struct snd_mixer *m, u_int32_t v)
{
struct snddev_info *d;
int i;
@@ -425,7 +425,7 @@
* @param v mask of recording devices
*/
void
-mix_setrecdevs(struct snd_mixer *m, uint32_t v)
+mix_setrecdevs(struct snd_mixer *m, u_int32_t v)
{
oss_mixer_enuminfo *ei;
char *loc;
@@ -475,9 +475,9 @@
}
void
-mix_setparentchild(struct snd_mixer *m, uint32_t parent, uint32_t childs)
+mix_setparentchild(struct snd_mixer *m, u_int32_t parent, u_int32_t childs)
{
- uint32_t mask = 0;
+ u_int32_t mask = 0;
int i;
if (m == NULL || parent >= SOUND_MIXER_NRDEVICES)
@@ -498,7 +498,7 @@
}
void
-mix_setrealdev(struct snd_mixer *m, uint32_t dev, uint32_t realdev)
+mix_setrealdev(struct snd_mixer *m, u_int32_t dev, u_int32_t realdev)
{
if (m == NULL || dev >= SOUND_MIXER_NRDEVICES ||
!(realdev == SOUND_MIXER_NONE || realdev < SOUND_MIXER_NRDEVICES))
@@ -506,29 +506,29 @@
m->realdev[dev] = realdev;
}
-uint32_t
-mix_getparent(struct snd_mixer *m, uint32_t dev)
+u_int32_t
+mix_getparent(struct snd_mixer *m, u_int32_t dev)
{
if (m == NULL || dev >= SOUND_MIXER_NRDEVICES)
return SOUND_MIXER_NONE;
return m->parent[dev];
}
-uint32_t
-mix_getchild(struct snd_mixer *m, uint32_t dev)
+u_int32_t
+mix_getchild(struct snd_mixer *m, u_int32_t dev)
{
if (m == NULL || dev >= SOUND_MIXER_NRDEVICES)
return 0;
return m->child[dev];
}
-uint32_t
+u_int32_t
mix_getdevs(struct snd_mixer *m)
{
return m->devs;
}
-uint32_t
+u_int32_t
mix_getrecdevs(struct snd_mixer *m)
{
return m->recdevs;
@@ -589,7 +589,7 @@
KASSERT(m->type == MIXER_TYPE_SECONDARY,
("%s(): illegal mixer type=%d", __func__, m->type));
- /* MIXER_UNINIT() can sleep! --hps */
+ snd_mtxlock(m->lock);
MIXER_UNINIT(m);
@@ -619,7 +619,7 @@
{
struct snddev_info *snddev;
struct snd_mixer *m;
- uint16_t v;
+ u_int16_t v;
struct cdev *pdev;
int i, unit, devunit, val;
@@ -633,7 +633,7 @@
if (resource_int_value(device_get_name(dev),
device_get_unit(dev), snd_mixernames[i], &val) == 0) {
if (val >= 0 && val <= 100) {
- v = (uint16_t) val;
+ v = (u_int16_t) val;
}
}
@@ -712,10 +712,6 @@
mixer_setrecsrc(m, SOUND_MASK_MIC);
- /* MIXER_UNINIT() can sleep! --hps */
-
- snd_mtxunlock(m->lock);
-
MIXER_UNINIT(m);
snd_mtxfree(m->lock);
@@ -893,7 +889,7 @@
}
int
-mix_setrecsrc(struct snd_mixer *m, uint32_t src)
+mix_setrecsrc(struct snd_mixer *m, u_int32_t src)
{
int ret;
@@ -906,10 +902,10 @@
return ((ret != 0) ? ENXIO : 0);
}
-uint32_t
+u_int32_t
mix_getrecsrc(struct snd_mixer *m)
{
- uint32_t ret;
+ u_int32_t ret;
KASSERT(m != NULL, ("NULL snd_mixer"));
@@ -1284,15 +1280,3 @@
return (EINVAL);
}
-
-/*
- * allow the sound driver to use
- * the mixer lock to protect its
- * mixer data:
- */
-struct mtx *
-mixer_get_lock(struct snd_mixer *m)
-{
- return m->lock;
-}
-
==== //depot/projects/usb/src/sys/dev/sound/pcm/mixer.h#8 (text+ko) ====
@@ -43,34 +43,33 @@
int mix_set(struct snd_mixer *m, u_int dev, u_int left, u_int right);
int mix_get(struct snd_mixer *m, u_int dev);
-int mix_setrecsrc(struct snd_mixer *m, uint32_t src);
-uint32_t mix_getrecsrc(struct snd_mixer *m);
+int mix_setrecsrc(struct snd_mixer *m, u_int32_t src);
+u_int32_t mix_getrecsrc(struct snd_mixer *m);
int mix_get_type(struct snd_mixer *m);
-void mix_setdevs(struct snd_mixer *m, uint32_t v);
-void mix_setrecdevs(struct snd_mixer *m, uint32_t v);
-uint32_t mix_getdevs(struct snd_mixer *m);
-uint32_t mix_getrecdevs(struct snd_mixer *m);
-void mix_setparentchild(struct snd_mixer *m, uint32_t parent, uint32_t childs);
-void mix_setrealdev(struct snd_mixer *m, uint32_t dev, uint32_t realdev);
-uint32_t mix_getparent(struct snd_mixer *m, uint32_t dev);
-uint32_t mix_getchild(struct snd_mixer *m, uint32_t dev);
+void mix_setdevs(struct snd_mixer *m, u_int32_t v);
+void mix_setrecdevs(struct snd_mixer *m, u_int32_t v);
+u_int32_t mix_getdevs(struct snd_mixer *m);
+u_int32_t mix_getrecdevs(struct snd_mixer *m);
+void mix_setparentchild(struct snd_mixer *m, u_int32_t parent, u_int32_t childs);
+void mix_setrealdev(struct snd_mixer *m, u_int32_t dev, u_int32_t realdev);
+u_int32_t mix_getparent(struct snd_mixer *m, u_int32_t dev);
+u_int32_t mix_getchild(struct snd_mixer *m, u_int32_t dev);
void *mix_getdevinfo(struct snd_mixer *m);
-struct mtx * mixer_get_lock(struct snd_mixer *m);
extern int mixer_count;
-#define MIXER_CMD_DIRECT 0 /* send command within driver */
-#define MIXER_CMD_CDEV 1 /* send command from cdev/ioctl */
+#define MIXER_CMD_DIRECT 0 /* send command within driver */
+#define MIXER_CMD_CDEV 1 /* send command from cdev/ioctl */
-#define MIXER_TYPE_PRIMARY 0 /* mixer_init() */
-#define MIXER_TYPE_SECONDARY 1 /* mixer_create() */
+#define MIXER_TYPE_PRIMARY 0 /* mixer_init() */
+#define MIXER_TYPE_SECONDARY 1 /* mixer_create() */
/*
* this is a kludge to allow hiding of the struct snd_mixer definition
* 512 should be enough for all architectures
*/
-#define MIXER_SIZE (512 + sizeof(struct kobj) + \
+#define MIXER_SIZE (512 + sizeof(struct kobj) + \
sizeof(oss_mixer_enuminfo))
-#define MIXER_DECLARE(name) static DEFINE_CLASS(name, name ## _methods, MIXER_SIZE)
+#define MIXER_DECLARE(name) static DEFINE_CLASS(name, name ## _methods, MIXER_SIZE)
More information about the p4-projects
mailing list