^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * @File ctmixer.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * @Brief
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * This file contains the definition of the mixer device functions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * @Author Liu Chun
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * @Date Mar 28 2008
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #ifndef CTMIXER_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define CTMIXER_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include "ctatc.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include "ctresource.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define INIT_VOL 0x1c00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) enum MIXER_PORT_T {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) MIX_WAVE_FRONT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) MIX_WAVE_REAR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) MIX_WAVE_CENTLFE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) MIX_WAVE_SURROUND,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) MIX_SPDIF_OUT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) MIX_PCMO_FRONT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) MIX_MIC_IN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) MIX_LINE_IN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) MIX_SPDIF_IN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) MIX_PCMI_FRONT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) MIX_PCMI_REAR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) MIX_PCMI_CENTLFE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) MIX_PCMI_SURROUND,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) NUM_MIX_PORTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) /* alsa mixer descriptor */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) struct ct_mixer {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) struct ct_atc *atc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) void **amixers; /* amixer resources for volume control */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) void **sums; /* sum resources for signal collection */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) unsigned int switch_state; /* A bit-map to indicate state of switches */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) int (*get_output_ports)(struct ct_mixer *mixer, enum MIXER_PORT_T type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) struct rsc **rleft, struct rsc **rright);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) int (*set_input_left)(struct ct_mixer *mixer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) enum MIXER_PORT_T type, struct rsc *rsc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) int (*set_input_right)(struct ct_mixer *mixer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) enum MIXER_PORT_T type, struct rsc *rsc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #ifdef CONFIG_PM_SLEEP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) int (*resume)(struct ct_mixer *mixer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) int ct_alsa_mix_create(struct ct_atc *atc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) enum CTALSADEVS device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) const char *device_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) int ct_mixer_create(struct ct_atc *atc, struct ct_mixer **rmixer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) int ct_mixer_destroy(struct ct_mixer *mixer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) #endif /* CTMIXER_H */