Hi @Zhiming_Liu ,
Thank you.
Since I cannot config pca6408 gpio as led device by gpio-pca953x driver and leds-gpio driver, how about leds-pca* driver? I see some leds-pca* drivers in kernel/drivers/leds/, such as leds-pca9532.c, leds-pca955x.c and leds-pca963x.c. Is there any leds-pca* driver compatible with pcal6408 just like gpio-pca953x driver?
I have tried to insert pcal6408 in leds-pca9532.c
enum {
...
pcal6408,
};
static const struct i2c_device_id pca9532_id[] = {
...
{ "pcal6408", pcal6408 },
{ }
};
static const struct pca9532_chip_info pca9532_chip_info_tbl[] = {
...
[pcal6408] = {
.num_leds = 8,
},
};
static const struct of_device_id of_pca9532_leds_match[] = {
...
{ .compatible = "nxp,pcal6408", .data = (void *)pcal6408 },
{},
};
And also leds-pca955x.c
enum pca955x_type {
...
pcal6408,
};
static struct pca955x_chipdef pca955x_chipdefs[] = {
...
[pcal6408] = {
.bits = 8,
.slv_addr = 0x20,
.slv_addr_shift = 3,
},
};
static const struct i2c_device_id pca955x_id[] = {
...
{ "pcal6408", pcal6408 },
{ }
};
static const struct of_device_id of_pca955x_match[] = {
...
{ .compatible = "nxp,pcal6408", .data = (void *)pcal6408 },
{},
};
But they don't work.