コード例 #1
0
static void r_tpu_work(struct work_struct *work)
{
	struct r_tpu_priv *p = container_of(work, struct r_tpu_priv, work);
	enum led_brightness brightness = p->new_brightness;

	r_tpu_disable(p);

	/* off and maximum are handled as GPIO pins, in between PWM */
	if ((brightness == 0) || (brightness == p->ldev.max_brightness))
		r_tpu_set_pin(p, R_TPU_PIN_GPIO, brightness);
	else {
		r_tpu_set_pin(p, R_TPU_PIN_GPIO_FN, 0);
		r_tpu_enable(p, brightness);
	}
}
コード例 #2
0
static void r_tpu_work(struct work_struct *work)
{
	struct r_tpu_priv *p = container_of(work, struct r_tpu_priv, work);
	enum led_brightness brightness = p->new_brightness;

	r_tpu_disable(p);

	
	if ((brightness == 0) || (brightness == p->ldev.max_brightness))
		r_tpu_set_pin(p, R_TPU_PIN_GPIO, brightness);
	else {
		r_tpu_set_pin(p, R_TPU_PIN_GPIO_FN, 0);
		r_tpu_enable(p, brightness);
	}
}