drivers/pwm/pwm_k64_ftm.c
/*
* Implements the driver control management functionality
* the *context may include IN data or/and OUT data
*/
Implements the driver control management functionality
the *context may include IN data or/and OUT data
Implements the driver control management functionality the * context may include IN data or / and OUT data
static int pwm_ftm_device_ctrl(struct device *dev, u32_t ctrl_command,
			       void *context)
{
	if (ctrl_command == DEVICE_PM_SET_POWER_STATE) {
		if (*((u32_t *)context) == DEVICE_PM_SUSPEND_STATE) {
			return pwm_ftm_suspend(dev);
		} else if (*((u32_t *)context) == DEVICE_PM_ACTIVE_STATE) {
			return pwm_ftm_resume_from_suspend(dev);
		}
	} else if (ctrl_command == DEVICE_PM_GET_POWER_STATE) {
		*((u32_t *)context) = pwm_ftm_get_power_state(dev);
		return 0;
	}
	return 0;
}
static int pwm_ftm_device_ctrl ( struct device * dev , u32_t ctrl_command , void * context ) { if ( ctrl_command == DEVICE_PM_SET_POWER_STATE ) { if ( * ( ( u32_t * ) context ) == DEVICE_PM_SUSPEND_STATE ) { return pwm_ftm_suspend ( dev ) ; } else if ( * ( ( u32_t * ) context ) == DEVICE_PM_ACTIVE_STATE ) { return pwm_ftm_resume_from_suspend ( dev ) ; } } else if ( ctrl_command == DEVICE_PM_GET_POWER_STATE ) { * ( ( u32_t * ) context ) = pwm_ftm_get_power_state ( dev ) ; return 0 ; } return 0 ; }
Implements the driver control management functionality
the *context may include IN data or/and OUT data
Implements the driver control management functionality the * context may include IN data or / and OUT data