// SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2011 bct electronic GmbH * Copyright 2013 Qtechnology/AS * * Author: Peter Meerwald <p.meerwald@bct-electronic.com> * Author: Ricardo Ribalda <ribalda@kernel.org> * * Based on leds-pca955x.c * * LED driver for the PCA9633 I2C LED driver (7-bit slave address 0x62) * LED driver for the PCA9634/5 I2C LED driver (7-bit slave address set by hw.) * * Note that hardware blinking violates the leds infrastructure driver * interface since the hardware only supports blinking all LEDs with the * same delay_on/delay_off rates. That is, only the LEDs that are set to * blink will actually blink but all LEDs that are set to blink will blink * in identical fashion. The delay_on/delay_off values of the last LED * that is set to blink will be used for all of the blinking LEDs. * Hardware blinking is disabled by default but can be enabled by setting * the 'blink_type' member in the platform_data struct to 'PCA963X_HW_BLINK' * or by adding the 'nxp,hw-blink' property to the DTS.
*/
/* LED select registers determine the source that drives LED outputs */ #define PCA963X_LED_OFF 0x0 /* LED driver off */ #define PCA963X_LED_ON 0x1 /* LED driver on */ #define PCA963X_LED_PWM 0x2 /* Controlled through PWM */ #define PCA963X_LED_GRP_PWM 0x3 /* Controlled through PWM/GRPPWM */
#define PCA963X_MODE1_SLEEP 0x04 /* Normal mode or Low Power mode, oscillator off */ #define PCA963X_MODE2_OUTDRV 0x04 /* Open-drain or totem pole */ #define PCA963X_MODE2_INVRT 0x10 /* Normal or inverted direction */ #define PCA963X_MODE2_DMBLNK 0x20 /* Enable blinking */
led = container_of(led_cdev, struct pca963x_led, led_cdev);
time_on = *delay_on;
time_off = *delay_off;
/* If both zero, pick reasonable defaults of 500ms each */ if (!time_on && !time_off) {
time_on = 500;
time_off = 500;
}
period = pca963x_period_scale(led, time_on + time_off);
/* If period not supported by hardware, default to someting sane. */ if ((period < PCA963X_BLINK_PERIOD_MIN) ||
(period > PCA963X_BLINK_PERIOD_MAX)) {
time_on = 500;
time_off = 500;
period = pca963x_period_scale(led, 1000);
}
ret = devm_led_classdev_register_ext(dev, &led->led_cdev,
&init_data); if (ret) {
dev_err(dev, "Failed to register LED for node %pfw\n",
child); return ret;
}
MODULE_AUTHOR("Peter Meerwald <p.meerwald@bct-electronic.com>");
MODULE_DESCRIPTION("PCA963X LED driver");
MODULE_LICENSE("GPL v2");
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.11Bemerkung:
(vorverarbeitet am 2026-04-27)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.