^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef XONAR_H_INCLUDED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define XONAR_H_INCLUDED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include "oxygen.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) struct xonar_generic {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) unsigned int anti_pop_delay;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) u16 output_enable_bit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) u8 ext_power_reg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) u8 ext_power_int_reg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) u8 ext_power_bit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) u8 has_power;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) struct xonar_hdmi {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) u8 params[5];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) /* generic helper functions */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) void xonar_enable_output(struct oxygen *chip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) void xonar_disable_output(struct oxygen *chip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) void xonar_init_ext_power(struct oxygen *chip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) void xonar_init_cs53x1(struct oxygen *chip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) void xonar_set_cs53x1_params(struct oxygen *chip,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) struct snd_pcm_hw_params *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #define XONAR_GPIO_BIT_INVERT (1 << 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) int xonar_gpio_bit_switch_get(struct snd_kcontrol *ctl,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) struct snd_ctl_elem_value *value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) int xonar_gpio_bit_switch_put(struct snd_kcontrol *ctl,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) struct snd_ctl_elem_value *value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) /* model-specific card drivers */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) int get_xonar_pcm179x_model(struct oxygen *chip,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) const struct pci_device_id *id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) int get_xonar_cs43xx_model(struct oxygen *chip,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) const struct pci_device_id *id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) int get_xonar_wm87x6_model(struct oxygen *chip,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) const struct pci_device_id *id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) /* HDMI helper functions */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) void xonar_hdmi_init(struct oxygen *chip, struct xonar_hdmi *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) void xonar_hdmi_cleanup(struct oxygen *chip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) void xonar_hdmi_resume(struct oxygen *chip, struct xonar_hdmi *hdmi);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) void xonar_hdmi_pcm_hardware_filter(unsigned int channel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) struct snd_pcm_hardware *hardware);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) void xonar_set_hdmi_params(struct oxygen *chip, struct xonar_hdmi *hdmi,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) struct snd_pcm_hw_params *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) void xonar_hdmi_uart_input(struct oxygen *chip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #endif