Пример #1
0
/**
* hsi_clocks_enable_channel - virtual wrapper for enabling HSI clocks for
* a given channel
* @dev - reference to the hsi device.
* @channel_number - channel number which requests clock to be enabled
*		    0xFF means no particular channel
*
* Returns: -EEXIST if clocks were already active
*	   0 if clocks were previously inactive
*
* Note : there is no real HW clock management per HSI channel, this is only
* virtual to keep track of active channels and ease debug
*
* Function to be called with lock
*/
int hsi_clocks_enable_channel(struct device *dev, u8 channel_number,
				const char *s)
{
	struct platform_device *pd = to_platform_device(dev);
	struct hsi_dev *hsi_ctrl = platform_get_drvdata(pd);

	if (channel_number != HSI_CH_NUMBER_NONE)
		dev_dbg(dev, "CLK: hsi_clocks_enable for "
			"channel %d: %s\n", channel_number, s);
	else
		dev_dbg(dev, "CLK: hsi_clocks_enable: %s\n", s);

	if (hsi_ctrl->clock_enabled) {
		dev_dbg(dev, "Clocks already enabled, skipping...\n");
		return -EEXIST;
	}

#ifdef CONFIG_PM
	/* Prevent Fclk change */
	if (dpll_cascading_blocker_hold(dev) < 0)
		dev_warn(dev, "Error holding DPLL cascading constraint\n");
#endif /* CONFIG_PM */

#ifndef USE_PM_RUNTIME_FOR_HSI
	omap_device_enable(pd);
	hsi_runtime_resume(dev);
	return 0;
#else
	return pm_runtime_get_sync(dev);
#endif
}
Пример #2
0
/**
* hsi_clocks_enable_channel - virtual wrapper for enabling HSI clocks for
* a given channel
* @dev - reference to the hsi device.
* @channel_number - channel number which requests clock to be enabled
*		    0xFF means no particular channel
*
* Note : there is no real HW clock management per HSI channel, this is only
* virtual to keep track of active channels and ease debug
*
* Function to be called with lock
*/
int hsi_clocks_enable_channel(struct device *dev, u8 channel_number,
				const char *s)
{
	struct platform_device *pd = to_platform_device(dev);
	struct hsi_dev *hsi_ctrl = platform_get_drvdata(pd);

	if (channel_number != HSI_CH_NUMBER_NONE)
		dev_dbg(dev, "CLK: hsi_clocks_enable for "
			"channel %d: %s\n", channel_number, s);
	else
		dev_dbg(dev, "CLK: hsi_clocks_enable: %s\n", s);

	if (hsi_ctrl->clock_enabled) {
		dev_dbg(dev, "Clocks already enabled, skipping...\n");
		return -EEXIST;
	}
#ifndef USE_PM_RUNTIME_FOR_HSI
	omap_device_enable(pd);
	hsi_runtime_resume(dev);
	return 0;
#else
	return pm_runtime_get_sync(dev);
#endif
}