Beispiel #1
0
static void xonar_hdmi_init_commands(struct oxygen *chip,
				     struct xonar_hdmi *hdmi)
{
	u8 param;

	oxygen_reset_uart(chip);
	param = 0;
	hdmi_write_command(chip, 0x61, 1, &param);
	param = 1;
	hdmi_write_command(chip, 0x74, 1, &param);
	hdmi_write_command(chip, 0x54, 5, hdmi->params);
}
Beispiel #2
0
static void xonar_hdav_resume(struct oxygen *chip)
{
    struct xonar_data *data = chip->model_data;
    u8 param;

    oxygen_reset_uart(chip);
    param = 0;
    hdmi_write_command(chip, 0x61, 1, &param);
    param = 1;
    hdmi_write_command(chip, 0x74, 1, &param);
    hdmi_write_command(chip, 0x54, 5, data->hdmi_params);
    pcm1796_init(chip);
    xonar_enable_output(chip);
}
Beispiel #3
0
static void set_hdmi_params(struct oxygen *chip,
                            struct snd_pcm_hw_params *params)
{
    struct xonar_data *data = chip->model_data;

    data->hdmi_params[0] = 0; /* 1 = non-audio */
    switch (params_rate(params)) {
    case 44100:
        data->hdmi_params[1] = IEC958_AES3_CON_FS_44100;
        break;
    case 48000:
        data->hdmi_params[1] = IEC958_AES3_CON_FS_48000;
        break;
    default: /* 96000 */
        data->hdmi_params[1] = IEC958_AES3_CON_FS_96000;
        break;
    case 192000:
        data->hdmi_params[1] = IEC958_AES3_CON_FS_192000;
        break;
    }
    data->hdmi_params[2] = params_channels(params) / 2 - 1;
    if (params_format(params) == SNDRV_PCM_FORMAT_S16_LE)
        data->hdmi_params[3] = 0;
    else
        data->hdmi_params[3] = 0xc0;
    data->hdmi_params[4] = 1; /* ? */
    hdmi_write_command(chip, 0x54, 5, data->hdmi_params);
}
Beispiel #4
0
static void xonar_hdav_cleanup(struct oxygen *chip)
{
    u8 param = 0;

    hdmi_write_command(chip, 0x74, 1, &param);
    xonar_disable_output(chip);
}
Beispiel #5
0
void xonar_set_hdmi_params(struct oxygen *chip, struct xonar_hdmi *hdmi,
			   struct snd_pcm_hw_params *params)
{
	hdmi->params[0] = 0; /* 1 = non-audio */
	switch (params_rate(params)) {
	case 44100:
		hdmi->params[1] = IEC958_AES3_CON_FS_44100;
		break;
	case 48000:
		hdmi->params[1] = IEC958_AES3_CON_FS_48000;
		break;
	default: /* 96000 */
		hdmi->params[1] = IEC958_AES3_CON_FS_96000;
		break;
	case 192000:
		hdmi->params[1] = IEC958_AES3_CON_FS_192000;
		break;
	}
	hdmi->params[2] = params_channels(params) / 2 - 1;
	if (params_format(params) == SNDRV_PCM_FORMAT_S16_LE)
		hdmi->params[3] = 0;
	else
		hdmi->params[3] = 0xc0;
	hdmi->params[4] = 1; /* ? */
	hdmi_write_command(chip, 0x54, 5, hdmi->params);
}
Beispiel #6
0
static void xonar_hdav_init(struct oxygen *chip)
{
	struct xonar_data *data = chip->model_data;
	u8 param;

	oxygen_write16(chip, OXYGEN_2WIRE_BUS_STATUS,
		       OXYGEN_2WIRE_LENGTH_8 |
		       OXYGEN_2WIRE_INTERRUPT_MASK |
		       OXYGEN_2WIRE_SPEED_FAST);

	data->anti_pop_delay = 100;
	data->dacs = chip->model.private_data == MODEL_HDAV_H6 ? 4 : 1;
	data->output_enable_bit = GPIO_DX_OUTPUT_ENABLE;
	data->ext_power_reg = OXYGEN_GPI_DATA;
	data->ext_power_int_reg = OXYGEN_GPI_INTERRUPT_MASK;
	data->ext_power_bit = GPI_DX_EXT_POWER;
	data->pcm1796_oversampling = PCM1796_OS_64;

	pcm1796_init(chip);

	oxygen_set_bits16(chip, OXYGEN_GPIO_CONTROL, GPIO_DX_INPUT_ROUTE);
	oxygen_clear_bits16(chip, OXYGEN_GPIO_DATA, GPIO_DX_INPUT_ROUTE);

	oxygen_reset_uart(chip);
	param = 0;
	hdmi_write_command(chip, 0x61, 1, &param);
	param = 1;
	hdmi_write_command(chip, 0x74, 1, &param);
	data->hdmi_params[1] = IEC958_AES3_CON_FS_48000;
	data->hdmi_params[4] = 1;
	hdmi_write_command(chip, 0x54, 5, data->hdmi_params);

	xonar_common_init(chip);

	snd_component_add(chip->card, "PCM1796");
	snd_component_add(chip->card, "CS5381");
}
Beispiel #7
0
void xonar_hdmi_cleanup(struct oxygen *chip)
{
	u8 param = 0;

	hdmi_write_command(chip, 0x74, 1, &param);
}