Lines Matching +full:hw +full:- +full:blink
2 * drivers/leds/leds-mlxcpld.c
39 #include <linux/hwmon-sysfs.h>
50 #define MLXCPLD_LED_OFFSET_HALF 0x01 /* Offset from solid: 3Hz blink */
51 #define MLXCPLD_LED_OFFSET_FULL 0x02 /* Offset from solid: 6Hz blink */
67 * struct mlxcpld_param - LED access parameters:
79 * struct mlxcpld_led_priv - LED private data:
91 * struct mlxcpld_led_profile - system LED profile (defined per system class):
107 * struct mlxcpld_led_pdata - system LED private data
266 * 0x6 for 3Hz blink red, 0xd for solid green, 0xe for 3Hz blink in mlxcpld_led_store_hw()
269 * 0xf0 - lower nibble is to be used (bits from 0 to 3), mask 0x0f - in mlxcpld_led_store_hw()
272 spin_lock(&mlxcpld_led->lock); in mlxcpld_led_store_hw()
279 spin_unlock(&mlxcpld_led->lock); in mlxcpld_led_store_hw()
288 mlxcpld_led_store_hw(pled->param.mask, pled->param.offset, in mlxcpld_led_brightness_set()
289 pled->param.base_color); in mlxcpld_led_brightness_set()
293 mlxcpld_led_store_hw(pled->param.mask, pled->param.offset, in mlxcpld_led_brightness_set()
304 * HW supports two types of blinking: full (6Hz) and half (3Hz). in mlxcpld_led_blink_set()
312 return -EINVAL; in mlxcpld_led_blink_set()
315 mlxcpld_led_store_hw(pled->param.mask, pled->param.offset, in mlxcpld_led_blink_set()
316 pled->param.base_color + in mlxcpld_led_blink_set()
319 mlxcpld_led_store_hw(pled->param.mask, pled->param.offset, in mlxcpld_led_blink_set()
320 pled->param.base_color + in mlxcpld_led_blink_set()
332 cpld->pled = devm_kcalloc(dev, in mlxcpld_led_config()
333 cpld->num_led_instances, in mlxcpld_led_config()
336 if (!cpld->pled) in mlxcpld_led_config()
337 return -ENOMEM; in mlxcpld_led_config()
339 for (i = 0; i < cpld->num_led_instances; i++) { in mlxcpld_led_config()
340 cpld->pled[i].cdev.name = cpld->profile[i].name; in mlxcpld_led_config()
341 cpld->pled[i].cdev.brightness = cpld->profile[i].brightness; in mlxcpld_led_config()
342 cpld->pled[i].cdev.max_brightness = 1; in mlxcpld_led_config()
343 cpld->pled[i].cdev.brightness_set = mlxcpld_led_brightness_set; in mlxcpld_led_config()
344 cpld->pled[i].cdev.blink_set = mlxcpld_led_blink_set; in mlxcpld_led_config()
345 cpld->pled[i].cdev.flags = LED_CORE_SUSPENDRESUME; in mlxcpld_led_config()
346 err = devm_led_classdev_register(dev, &cpld->pled[i].cdev); in mlxcpld_led_config()
350 cpld->pled[i].param.offset = mlxcpld_led->profile[i].offset; in mlxcpld_led_config()
351 cpld->pled[i].param.mask = mlxcpld_led->profile[i].mask; in mlxcpld_led_config()
352 cpld->pled[i].param.base_color = in mlxcpld_led_config()
353 mlxcpld_led->profile[i].base_color; in mlxcpld_led_config()
355 if (mlxcpld_led->profile[i].brightness) in mlxcpld_led_config()
356 mlxcpld_led_brightness_set(&cpld->pled[i].cdev, in mlxcpld_led_config()
357 mlxcpld_led->profile[i].brightness); in mlxcpld_led_config()
368 mlxcpld_led = devm_kzalloc(&pdev->dev, sizeof(*mlxcpld_led), in mlxcpld_led_probe()
371 return -ENOMEM; in mlxcpld_led_probe()
373 mlxcpld_led->pdev = pdev; in mlxcpld_led_probe()
377 mlxcpld_led->profile = mlxcpld_led_msn2100_profile; in mlxcpld_led_probe()
378 mlxcpld_led->num_led_instances = in mlxcpld_led_probe()
383 mlxcpld_led->profile = mlxcpld_led_default_profile; in mlxcpld_led_probe()
384 mlxcpld_led->num_led_instances = in mlxcpld_led_probe()
389 spin_lock_init(&mlxcpld_led->lock); in mlxcpld_led_probe()
391 return mlxcpld_led_config(&pdev->dev, mlxcpld_led); in mlxcpld_led_probe()
406 return -ENODEV; in mlxcpld_led_init()
408 pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0); in mlxcpld_led_init()
425 platform_device_unregister(mlxcpld_led->pdev); in mlxcpld_led_exit()