diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2003-02-05 19:24:14 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2003-02-05 19:24:14 +0000 |
commit | 195d537c5a1caf29ce5cddf8007236d7fdb0e37c (patch) | |
tree | d2af22b83cf4acdba61f4fa0155e6bb63a81c1f7 /sys/arch/hppa | |
parent | b2ac2849f43eac8f76b7449f66eaba29bc8bb345 (diff) |
Add knob for getting at the "output level bit", supposedly changes the
full scale outputs between 2.8Vpp and 2.0Vpp for line.
Diffstat (limited to 'sys/arch/hppa')
-rw-r--r-- | sys/arch/hppa/gsc/harmony.c | 29 | ||||
-rw-r--r-- | sys/arch/hppa/gsc/harmonyvar.h | 18 |
2 files changed, 38 insertions, 9 deletions
diff --git a/sys/arch/hppa/gsc/harmony.c b/sys/arch/hppa/gsc/harmony.c index e7f245ffff0..7c00eb75c2c 100644 --- a/sys/arch/hppa/gsc/harmony.c +++ b/sys/arch/hppa/gsc/harmony.c @@ -1,4 +1,4 @@ -/* $OpenBSD: harmony.c,v 1.15 2003/02/05 08:47:05 jason Exp $ */ +/* $OpenBSD: harmony.c,v 1.16 2003/02/05 19:24:13 jason Exp $ */ /* * Copyright (c) 2003 Jason L. Wright (jason@thought.net) @@ -220,6 +220,7 @@ harmony_attach(parent, self, aux) sc->sc_input_lvl.left = sc->sc_input_lvl.right = 240; sc->sc_output_lvl.left = sc->sc_output_lvl.right = 244; sc->sc_monitor_lvl.left = sc->sc_monitor_lvl.right = 208; + sc->sc_outputgain = 0; /* reset chip, and push default gain controls */ harmony_reset_codec(sc); @@ -500,6 +501,9 @@ harmony_set_params(void *vsc, int setmode, int usemode, return (EINVAL); } + if (sc->sc_outputgain) + bits |= CNTL_OLB; + if (p->channels == 1) bits |= CNTL_CHANS_MONO; else if (p->channels == 2) @@ -660,6 +664,12 @@ harmony_set_port(void *vsc, mixer_ctrl_t *cp) sc->sc_need_commit = 1; err = 0; break; + case HARMONY_PORT_OUTPUT_GAIN: + if (cp->type != AUDIO_MIXER_ENUM) + break; + sc->sc_outputgain = cp->un.ord ? 1 : 0; + err = 0; + break; case HARMONY_PORT_MONITOR_LVL: if (cp->type != AUDIO_MIXER_VALUE) break; @@ -733,6 +743,12 @@ harmony_get_port(void *vsc, mixer_ctrl_t *cp) break; err = 0; break; + case HARMONY_PORT_OUTPUT_GAIN: + if (cp->type != AUDIO_MIXER_ENUM) + break; + cp->un.ord = sc->sc_outputgain ? 1 : 0; + err = 0; + break; case HARMONY_PORT_MONITOR_LVL: if (cp->type != AUDIO_MIXER_VALUE) break; @@ -780,6 +796,17 @@ harmony_query_devinfo(void *vsc, mixer_devinfo_t *dip) dip->un.v.num_channels = 2; strcpy(dip->un.v.units.name, AudioNvolume); break; + case HARMONY_PORT_OUTPUT_GAIN: + dip->type = AUDIO_MIXER_ENUM; + dip->mixer_class = HARMONY_PORT_OUTPUT_CLASS; + dip->prev = dip->next = AUDIO_MIXER_LAST; + strcpy(dip->label.name, "gain"); + dip->un.e.num_mem = 2; + strcpy(dip->un.e.member[0].label.name, AudioNoff); + dip->un.e.member[0].ord = 0; + strcpy(dip->un.e.member[1].label.name, AudioNon); + dip->un.e.member[1].ord = 1; + break; case HARMONY_PORT_MONITOR_LVL: dip->type = AUDIO_MIXER_VALUE; dip->mixer_class = HARMONY_PORT_MONITOR_CLASS; diff --git a/sys/arch/hppa/gsc/harmonyvar.h b/sys/arch/hppa/gsc/harmonyvar.h index 9ad811dd6ba..b747fcdb4d1 100644 --- a/sys/arch/hppa/gsc/harmonyvar.h +++ b/sys/arch/hppa/gsc/harmonyvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: harmonyvar.h,v 1.4 2003/02/05 08:47:05 jason Exp $ */ +/* $OpenBSD: harmonyvar.h,v 1.5 2003/02/05 19:24:13 jason Exp $ */ /* * Copyright (c) 2003 Jason L. Wright (jason@thought.net) @@ -33,13 +33,14 @@ #define HARMONY_PORT_INPUT_LVL 0 #define HARMONY_PORT_OUTPUT_LVL 1 -#define HARMONY_PORT_MONITOR_LVL 2 -#define HARMONY_PORT_RECORD_SOURCE 3 -#define HARMONY_PORT_OUTPUT_SOURCE 4 -#define HARMONY_PORT_INPUT_CLASS 5 -#define HARMONY_PORT_OUTPUT_CLASS 6 -#define HARMONY_PORT_MONITOR_CLASS 7 -#define HARMONY_PORT_RECORD_CLASS 8 +#define HARMONY_PORT_OUTPUT_GAIN 2 +#define HARMONY_PORT_MONITOR_LVL 3 +#define HARMONY_PORT_RECORD_SOURCE 4 +#define HARMONY_PORT_OUTPUT_SOURCE 5 +#define HARMONY_PORT_INPUT_CLASS 6 +#define HARMONY_PORT_OUTPUT_CLASS 7 +#define HARMONY_PORT_MONITOR_CLASS 8 +#define HARMONY_PORT_RECORD_CLASS 9 #define HARMONY_IN_MIC 0 #define HARMONY_IN_LINE 1 @@ -102,6 +103,7 @@ struct harmony_softc { struct harmony_channel sc_playback, sc_capture; struct harmony_volume sc_monitor_lvl, sc_input_lvl, sc_output_lvl; int sc_in_port, sc_out_port, sc_hasulinear8; + int sc_micpreamp, sc_outputgain; }; #define READ_REG(sc, reg) \ |