static void enable_board_wakeup_source(void)
{
	int gpio_val;
	/* Android does not have touchscreen as wakeup source */
#if !defined(CONFIG_ANDROID)
	gpio_val = omap_mux_get_gpio(OMAP4_TOUCH_IRQ_1);
	if ((gpio_val & OMAP44XX_PADCONF_WAKEUPENABLE0) == 0) {
		gpio_val |= OMAP44XX_PADCONF_WAKEUPENABLE0;
		omap_mux_set_gpio(gpio_val, OMAP4_TOUCH_IRQ_1);
	}

#endif
	gpio_val = omap_mux_get_gpio(32);

	if ((gpio_val & OMAP44XX_PADCONF_WAKEUPENABLE0) == 0) {
		gpio_val |= OMAP44XX_PADCONF_WAKEUPENABLE0;
		omap_mux_set_gpio(gpio_val, 32);
	}

	gpio_val = omap_mux_get_gpio(29);

	if ((gpio_val & OMAP44XX_PADCONF_WAKEUPENABLE0) == 0) {
		gpio_val |= OMAP44XX_PADCONF_WAKEUPENABLE0;
		omap_mux_set_gpio(gpio_val, 29);
	}

	/*
	 * Enable IO daisy for sys_nirq1/2, to be able to
	 * wakeup from interrupts from PMIC/Audio IC.
	 * Needed only in Device OFF mode.
	 */
	omap_mux_enable_wakeup("sys_nirq1");
}
/**
* omap_hsi_wakeup_enable - Enable HSI wakeup feature from RET/OFF mode
*
* @hsi_port - reference to the HSI port onto which enable wakeup feature.
*
*/
static int omap_hsi_wakeup_enable(struct hsi_dev *hsi_ctrl, int hsi_port)
{
	dev_dbg(hsi_ctrl->dev, "%s\n", __func__);

	if (omap_hsi_is_io_pad_hsi())
		omap_mux_enable_wakeup(OMAP_HSI_PADCONF_CAWAKE_PIN);
	else
		dev_warn(hsi_ctrl->dev, "Trying to enable HSI IO wakeup on non "
					"HSI board\n");

	/* TODO: handle hsi_port param and use it to find the correct Pad */
	return 0;
}
Esempio n. 3
0
/**
* omap_hsi_wakeup_enable - Enable HSI wakeup feature from RET/OFF mode
*
* @hsi_port - reference to the HSI port onto which enable wakeup feature.
*	      Range [0, 1]
*
* Return value :* 0 if CAWAKE has been configured to wakeup platform
*		* -ENODEV if CAWAKE is not muxed on padconf
*/
static int omap_hsi_wakeup_enable(int hsi_port)
{
	int ret = -ENODEV;

	if (omap_hsi_is_io_pad_hsi())
		ret = omap_mux_enable_wakeup(OMAP_HSI_PADCONF_CAWAKE_PIN);
	else
		pr_debug("Trying to enable HSI IO wakeup on non HSI board\n");


	/* TODO: handle hsi_port param and use it to find the correct Pad */
	return ret;
}
Esempio n. 4
0
/**
* omap_hsi_wakeup_enable - Enable HSI wakeup feature from RET/OFF mode
*
* @hsi_port - reference to the HSI port onto which enable wakeup feature.
*	      Range [1, 2]
*
* Return value :* 0 if CAWAKE has been configured to wakeup platform
*		* -ENODEV if CAWAKE is not muxed on padconf
*/
static int omap_hsi_wakeup_enable(int hsi_port)
{
	struct hsi_port_ctx *port_ctx;
	int ret = -ENODEV;

	if (omap_hsi_is_io_pad_hsi(hsi_port)) {
		port_ctx = hsi_get_hsi_port_ctx_data(hsi_port);
		ret = omap_mux_enable_wakeup(port_ctx->cawake_padconf_name);
		omap4_trigger_ioctrl();
	} else {
		pr_debug("HSI port %d not muxed, failed to enable IO wakeup\n",
			 hsi_port);
	}

	return ret;
}
Esempio n. 5
0
/**
* omap_hsi_prepare_suspend - Prepare HSI for suspend mode (OFF)
*
* Return value : -ENODEV if HSI controller has not been found, else 0.
*
*/
int omap_hsi_prepare_suspend(void)
{
	struct platform_device *pdev;
	struct hsi_dev *hsi_ctrl;

	pdev = hsi_get_hsi_platform_device();
	hsi_ctrl = hsi_get_hsi_controller_data(pdev);

	if (!hsi_ctrl)
		return -ENODEV;

	if (device_may_wakeup(&pdev->dev))
		omap_mux_enable_wakeup(OMAP_HSI_PADCONF_CAWAKE_PIN);
	else
		omap_mux_disable_wakeup(OMAP_HSI_PADCONF_CAWAKE_PIN);

	return 0;
}