示例#1
0
static void disable_led_notification(void)
{
	if (bln_ongoing) {
		bln_blink_stop();
		bln_led_off();
		bln_imp->disable();

		bln_ongoing = false;

		pr_debug("%s: success\n", __FUNCTION__);
	} else {
		pr_notice("%s: fail (ongoing=%c\n", __FUNCTION__, bln_ongoing);
	}
}
示例#2
0
static ssize_t blink_control_write(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t size)
{
	unsigned int data;

	if (sscanf(buf, "%u\n", &data) == 1) {
		if (data == 1) {
			bln_blink_start();
		} else if (data == 0) {
			bln_blink_stop();
		} else {
			pr_err("%s: input error %u\n", __FUNCTION__, data);
		}
	} else {
		pr_err("%s: input error\n", __FUNCTION__);
	}

	return size;
}
示例#3
0
void cancel_bln_activity(void)
{
	mutex_lock(&bln_mutex);

	if (bln_ongoing) {
		bln_blink_stop();
		bln_ongoing = false;

		// Since this is only called on early_resume and therefore lights
		// are about to be turned on, don't bother disabling the regulators.
		// Also, cypress will need to know that it needs to write the desired
                // lights state.

		pr_debug("%s: success\n", __FUNCTION__);
	} else {
		pr_notice("%s: fail (ongoing=%d)\n", __FUNCTION__, bln_ongoing);
	}

	mutex_unlock(&bln_mutex);
}