SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_CREATIVE, 0xf000,
PCI_SUBDEVICE_ID_CREATIVE_HENDRIX, "HENDRIX",
CTHENDRIX),
+ SND_PCI_QUIRK(0x160b, 0x0101, "OK0010", CTOK0010),
{ } /* terminator */
};
[CTHENDRIX] = "Hendrix",
[CTSB0880] = "SB0880",
[CTSB1270] = "SB1270",
+ [CTOK0010] = "OK0010",
[CT20K2_UNKNOWN] = "Unknown",
};
dao->ops->set_right_input(dao, rscs[1]);
}
- if (cap.dedicated_rca)
+ if (cap.dedicated_rca) {
+ /* SE-300PCIE has a dedicated DAC for the RCA. */
atc_dedicated_rca_select(atc);
+ }
dai = container_of(atc->daios[LINEIM], struct dai, daio);
atc_connect_dai(atc->rsc_mgrs[SRC], dai,
if (cap.dedicated_mic) {
/* Titanium HD has a dedicated ADC for the Mic. */
+ /* SE-300PCIE has a 4-channel ADC. */
dai = container_of(atc->daios[MIC], struct dai, daio);
atc_connect_dai(atc->rsc_mgrs[SRC], dai,
(struct src **)&atc->srcs[4],
struct dao_ctrl_blk *ctl = blk;
if (ctl->dirty.bf.atxcsl) {
- if (idx < 4) {
+ if ((idx < 4) && ((hw->model != CTOK0010) || (idx < 3))) {
/* S/PDIF SPOSx */
hw_write_20kx(hw, AUDIO_IO_TX_CSTAT_L+0x40*idx,
ctl->atxcsl);
return 0;
}
-static int daio_mgr_dao_init(struct hw *hw __maybe_unused, void *blk, unsigned int idx, unsigned int conf)
+static int daio_mgr_dao_init(struct hw *hw, void *blk, unsigned int idx, unsigned int conf)
{
struct daio_mgr_ctrl_blk *ctl = blk;
- if (idx < 4) {
+ /* Port 3 is dedicated to RCA on SE-300PCIE */
+ if ((idx < 4) && ((hw->model != CTOK0010) || (idx < 3))) {
/* S/PDIF output */
switch ((conf & 0xf)) {
case 1:
hw_write_20kx(hw, AUDIO_IO_MCLK, 0x21011111);
hw_write_20kx(hw, AUDIO_IO_TX_BLRCLK, 0x21212121);
hw_write_20kx(hw, AUDIO_IO_RX_BLRCLK, 0);
+ } else if ((4 == info->msr) && (hw->model == CTOK0010)) {
+ hw_write_20kx(hw, AUDIO_IO_MCLK, 0x21212121);
+ hw_write_20kx(hw, AUDIO_IO_TX_BLRCLK, 0x21212121);
+ hw_write_20kx(hw, AUDIO_IO_RX_BLRCLK, 0);
} else {
dev_alert(hw->card->dev,
"ERROR!!! Invalid sampling rate!!!\n");
}
for (i = 0; i < 8; i++) {
- if (i <= 3) {
+ /* Port 3 is configured as I2S on SE-300PCIE */
+ if ((i < 4) && ((hw->model != CTOK0010) || (i < 3))) {
/* This comment looks wrong since loop is over 4 */
/* channels and emu20k2 supports 4 spdif IOs. */
/* 1st 3 channels are SPDIFs (SB0960) */
hw_write_20kx(hw, GPIO_DATA, data);
hw_dac_start(hw);
return 0;
+ } else if (hw->model == CTOK0010) {
+ hw_dac_stop(hw);
+ data = hw_read_20kx(hw, GPIO_DATA);
+ data |= 0x1000;
+ hw_write_20kx(hw, GPIO_DATA, data);
+ hw_dac_start(hw);
+ return 0;
}
/* Set DAC reset bit as output */
static int hw_is_adc_input_selected(struct hw *hw, enum ADCSRC type)
{
u32 data;
- if (hw->model == CTSB1270) {
+ if ((hw->model == CTSB1270) || (hw->model == CTOK0010)) {
/* Titanium HD has two ADC chips, one for line in and one */
- /* for MIC. We don't need to switch the ADC input. */
+ /* for MIC. Also, SE-300PCIE has a single ADC chip that */
+ /* simultaneously supports 4-channel input. We don't need */
+ /* to switch the ADC input. */
return 1;
}
data = hw_read_20kx(hw, GPIO_DATA);
msleep(50);
}
-static void __maybe_unused hw_adc_reset(struct hw *hw)
+static void hw_adc_reset(struct hw *hw)
{
hw_adc_stop(hw);
hw_adc_start(hw);
data |= (0x1 << 15);
hw_write_20kx(hw, GPIO_CTRL, data);
+ if (hw->model == CTOK0010) {
+ /* Manual ADC setup for SE-300PCIE is not needed. */
+ hw_adc_reset(hw);
+ return 0;
+ }
+
/* Initialize I2C */
err = hw20k2_i2c_init(hw, 0x1A, 1, 1);
if (err < 0) {
struct capabilities cap;
cap.digit_io_switch = 0;
- cap.dedicated_mic = hw->model == CTSB1270;
- cap.dedicated_rca = 0;
+ cap.dedicated_mic = (hw->model == CTSB1270) || (hw->model == CTOK0010);
+ cap.dedicated_rca = hw->model == CTOK0010;
cap.output_switch = hw->model == CTSB1270;
cap.mic_source_switch = hw->model == CTSB1270;
/* Reset all SRC pending interrupts */
hw_write_20kx(hw, SRC_IP, 0);
- if (hw->model != CTSB1270) {
+ if (hw->model == CTSB1270) {
+ hw_write_20kx(hw, GPIO_CTRL, 0x9E5F);
+ } else if (hw->model == CTOK0010) {
+ hw_write_20kx(hw, GPIO_CTRL, 0x9902);
+ } else {
/* TODO: detect the card ID and configure GPIO accordingly. */
/* Configures GPIO (0xD802 0x98028) */
/*hw_write_20kx(hw, GPIO_CTRL, 0x7F07);*/
/* Configures GPIO (SB0880) */
/*hw_write_20kx(hw, GPIO_CTRL, 0xFF07);*/
hw_write_20kx(hw, GPIO_CTRL, 0xD802);
- } else {
- hw_write_20kx(hw, GPIO_CTRL, 0x9E5F);
}
/* Enable audio ring */
hw_write_20kx(hw, MIXER_AR_ENABLE, 0x01);