Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kestrel/leds/trigger: implement led trigger driver for group pwm #23

Open
wants to merge 1 commit into
base: cp-release/lf-5.15.y
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions drivers/leds/leds-pca963x.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <linux/property.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/i2c-pca963x.h>

/* LED select registers determine the source that drives LED outputs */
#define PCA963X_LED_OFF 0x0 /* LED driver off */
Expand Down Expand Up @@ -371,6 +372,14 @@ static const struct of_device_id of_pca963x_match[] = {
};
MODULE_DEVICE_TABLE(of, of_pca963x_match);

static struct i2c_client *g_client;

struct i2c_client *i2c_get_pca963x_device(void)
{
return g_client;
}
EXPORT_SYMBOL_GPL(i2c_get_pca963x_device);

static int pca963x_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
Expand Down Expand Up @@ -398,6 +407,8 @@ static int pca963x_probe(struct i2c_client *client,
chip->chipdef = chipdef;
chip->client = client;

g_client = client;

/* Turn off LEDs by default*/
for (i = 0; i < chipdef->n_leds / 4; i++)
i2c_smbus_write_byte_data(client, chipdef->ledout_base + i, 0x00);
Expand Down
8 changes: 8 additions & 0 deletions drivers/leds/trigger/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ config LEDS_TRIGGER_TIMER

If unsure, say Y.

config LEDS_TRIGGER_GRPPWM
tristate "LED Group PWM trigger"
help
This allows LEDs to be controlled by group pwm feature,
supported by pca9633 i2c driver

if unsure, say Y.

config LEDS_TRIGGER_ONESHOT
tristate "LED One-shot Trigger"
help
Expand Down
1 change: 1 addition & 0 deletions drivers/leds/trigger/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ obj-$(CONFIG_LEDS_TRIGGER_NETDEV) += ledtrig-netdev.o
obj-$(CONFIG_LEDS_TRIGGER_PATTERN) += ledtrig-pattern.o
obj-$(CONFIG_LEDS_TRIGGER_AUDIO) += ledtrig-audio.o
obj-$(CONFIG_LEDS_TRIGGER_TTY) += ledtrig-tty.o
obj-$(CONFIG_LEDS_TRIGGER_GRPPWM) += ledtrig-grppwm.o
Loading