Ejemplo n.º 1
0
static int omap_hdmi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
                                 struct snd_soc_dai *dai)
{
    int err = 0;

    switch (cmd) {
    case SNDRV_PCM_TRIGGER_START:
    case SNDRV_PCM_TRIGGER_RESUME:
    case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
        omap_hwmod_set_slave_idlemode(hdmi.oh,
                                      HWMOD_IDLEMODE_NO);
        hdmi.dssdev->driver->audio_start(hdmi.dssdev, true);
        hdmi.active = 1;
        break;
    case SNDRV_PCM_TRIGGER_STOP:
    case SNDRV_PCM_TRIGGER_SUSPEND:
    case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
        hdmi.active = 0;
        hdmi.dssdev->driver->audio_start(hdmi.dssdev, false);
        omap_hwmod_set_slave_idlemode(hdmi.oh,
                                      HWMOD_IDLEMODE_SMART_WKUP);
        break;
    default:
        err = -EINVAL;
    }
    return err;
}
Ejemplo n.º 2
0
static int hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd,
				struct snd_soc_dai *dai)
{
	struct snd_soc_pcm_runtime *rtd = substream->private_data;
	struct snd_soc_codec *codec = rtd->codec;
	struct hdmi_codec_data *priv = snd_soc_codec_get_drvdata(codec);
	int err = 0;

	switch (cmd) {
	case SNDRV_PCM_TRIGGER_START:
	case SNDRV_PCM_TRIGGER_RESUME:
	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
		/*
		 * switch to no-idle to avoid DSS_L3_ICLK clock
		 * to be shutdown during audio activity (as per TRM)
		 */
		omap_hwmod_set_slave_idlemode(priv->oh,
			HWMOD_IDLEMODE_NO);
		hdmi_ti_4xxx_wp_audio_enable(&priv->ip_data, 1);
		queue_delayed_work(priv->workqueue, &priv->delayed_work,
				msecs_to_jiffies(1));

		priv->active = 1;
		break;
	case SNDRV_PCM_TRIGGER_STOP:
	case SNDRV_PCM_TRIGGER_SUSPEND:
	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
		if (delayed_work_pending(&hdmi_data.delayed_work))
			cancel_delayed_work(&hdmi_data.delayed_work);
		priv->active = 0;
		hdmi_ti_4xxx_audio_transfer_en(&priv->ip_data, 0);
		hdmi_ti_4xxx_wp_audio_enable(&priv->ip_data, 0);
		/*
		 * switch back to smart-idle & wakeup capable
		 * after audio activity stops
		 */
		omap_hwmod_set_slave_idlemode(priv->oh,
			HWMOD_IDLEMODE_SMART_WKUP);
		break;
	default:
		err = -EINVAL;
	}
	return err;
}
Ejemplo n.º 3
0
int hdmi_audio_notifier_callback(struct notifier_block *nb,
				unsigned long arg, void *ptr)
{
	enum omap_dss_display_state state = arg;

	if (state == OMAP_DSS_DISPLAY_ACTIVE) {
		/* this happens just after hdmi_power_on */
		if (hdmi_data.active)
			hdmi_ti_4xxx_audio_enable(&hdmi_data.ip_data, 0);
		hdmi_audio_set_configuration(&hdmi_data);
		if (hdmi_data.active) {
			omap_hwmod_set_slave_idlemode(hdmi_data.oh,
							HWMOD_IDLEMODE_NO);
			hdmi_ti_4xxx_audio_enable(&hdmi_data.ip_data, 1);

		}
	}
	return 0;
}
Ejemplo n.º 4
0
static int hdmi_audio_notifier_callback(struct notifier_block *nb,
                                        unsigned long arg, void *ptr)
{
    enum omap_dss_display_state state = arg;
    int err = 0;

    if (state == OMAP_DSS_DISPLAY_ACTIVE) {
        if (hdmi.active)
            hdmi.dssdev->driver->audio_enable(hdmi.dssdev, false);
        err = hdmi.dssdev->driver->audio_config(hdmi.dssdev,
                                                &hdmi.iec, &hdmi.cea);
        if (hdmi.active) {
            omap_hwmod_set_slave_idlemode(hdmi.oh,
                                          HWMOD_IDLEMODE_NO);
            hdmi.dssdev->driver->audio_enable(hdmi.dssdev,
                                              true);
        }
    }
    return err;
}
static int omap_serial_runtime_resume(struct device *dev)
{
	struct uart_omap_port *up = dev_get_drvdata(dev);
	struct omap_device *od;

	if (up) {
		if (omap_pm_was_context_lost(dev))
			omap_uart_restore_context(up);

		if (up->use_dma) {
			/* NO TX_DMA WAKEUP SO KEEP IN NO IDLE MODE */
			od = to_omap_device(up->pdev);
			omap_hwmod_set_slave_idlemode(od->hwmods[0],
						HWMOD_IDLEMODE_NO);
		}
		if (up->rts_mux_driver_control && (!up->rts_pullup_in_suspend))
			omap_rts_mux_write(0, up->port.line);
	}

	return 0;
}
Ejemplo n.º 6
0
int hdmi_audio_notifier_callback(struct notifier_block *nb,
				unsigned long arg, void *ptr)
{
	enum omap_dss_display_state state = arg;

	if (state == OMAP_DSS_DISPLAY_ACTIVE) {
		/* this happens just after hdmi_power_on */
		hdmi_audio_set_configuration(&hdmi_data);
		if (hdmi_data.active) {
			omap_hwmod_set_slave_idlemode(hdmi_data.oh,
							HWMOD_IDLEMODE_NO);
			hdmi_ti_4xxx_wp_audio_enable(&hdmi_data.ip_data, 1);
			queue_delayed_work(hdmi_data.workqueue,
				&hdmi_data.delayed_work,
				msecs_to_jiffies(1));
		}
	} else {
		cancel_delayed_work_sync(&hdmi_data.delayed_work);
	}
	return 0;
}