Lines Matching +full:white +full:- +full:led
1 // SPDX-License-Identifier: GPL-2.0+
40 struct a500_led *led = container_of(led_cdev, struct a500_led, cdev); in a500_ec_led_brightness_set() local
45 control_seq[0] = led->enable_seq[0]; in a500_ec_led_brightness_set()
52 * RESET_LEDS turns off both LEDs, thus restore other LED if in a500_ec_led_brightness_set()
55 if (led->other->cdev.brightness) in a500_ec_led_brightness_set()
59 control_seq[1] = led->other->enable_seq[0]; in a500_ec_led_brightness_set()
62 return regmap_multi_reg_write(led->rmap, control_seq, num_regs); in a500_ec_led_brightness_set()
71 rmap = dev_get_regmap(pdev->dev.parent, "KB930"); in a500_ec_leds_probe()
73 return -EINVAL; in a500_ec_leds_probe()
78 white_led = devm_kzalloc(&pdev->dev, sizeof(*white_led), GFP_KERNEL); in a500_ec_leds_probe()
80 return -ENOMEM; in a500_ec_leds_probe()
82 white_led->cdev.name = "power:white"; in a500_ec_leds_probe()
83 white_led->cdev.brightness_set_blocking = a500_ec_led_brightness_set; in a500_ec_leds_probe()
84 white_led->cdev.flags = LED_CORE_SUSPENDRESUME; in a500_ec_leds_probe()
85 white_led->cdev.max_brightness = 1; in a500_ec_leds_probe()
86 white_led->enable_seq = a500_ec_white_led_enable_seq; in a500_ec_leds_probe()
87 white_led->rmap = rmap; in a500_ec_leds_probe()
89 orange_led = devm_kzalloc(&pdev->dev, sizeof(*orange_led), GFP_KERNEL); in a500_ec_leds_probe()
91 return -ENOMEM; in a500_ec_leds_probe()
93 orange_led->cdev.name = "power:orange"; in a500_ec_leds_probe()
94 orange_led->cdev.brightness_set_blocking = a500_ec_led_brightness_set; in a500_ec_leds_probe()
95 orange_led->cdev.flags = LED_CORE_SUSPENDRESUME; in a500_ec_leds_probe()
96 orange_led->cdev.max_brightness = 1; in a500_ec_leds_probe()
97 orange_led->enable_seq = a500_ec_orange_led_enable_seq; in a500_ec_leds_probe()
98 orange_led->rmap = rmap; in a500_ec_leds_probe()
100 white_led->other = orange_led; in a500_ec_leds_probe()
101 orange_led->other = white_led; in a500_ec_leds_probe()
103 err = devm_led_classdev_register(&pdev->dev, &white_led->cdev); in a500_ec_leds_probe()
105 dev_err(&pdev->dev, "failed to register white LED\n"); in a500_ec_leds_probe()
109 err = devm_led_classdev_register(&pdev->dev, &orange_led->cdev); in a500_ec_leds_probe()
111 dev_err(&pdev->dev, "failed to register orange LED\n"); in a500_ec_leds_probe()
120 .name = "acer-a500-iconia-leds",
126 MODULE_DESCRIPTION("LED driver for Acer Iconia Tab A500 Power Button");
128 MODULE_ALIAS("platform:acer-a500-iconia-leds");