diff options
author | Sven Wegener <sven.wegener@stealer.net> | 2021-06-12 21:56:22 +0200 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2022-09-18 15:39:41 +0100 |
commit | 40610c53226931e9ccab4c9e4b225e7ca6039c1d (patch) | |
tree | 2a0f76f86781ab00dc129beb2c453637c10c09bc /target/linux/mediatek | |
parent | 26cd0c1ee93c9c986367927394776071e28d3f86 (diff) | |
download | upstream-40610c53226931e9ccab4c9e4b225e7ca6039c1d.tar.gz upstream-40610c53226931e9ccab4c9e4b225e7ca6039c1d.tar.bz2 upstream-40610c53226931e9ccab4c9e4b225e7ca6039c1d.zip |
mediatek: add initialization after reset
During GPIO initialization the pin state flips and triggers a reset of
the ledbar MCU. It needs to be moved through an initialization sequence
before working correctly.
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
(cherry picked from commit 013a956f086dc5d88f6e9cbd852ed4d900d436e0)
Diffstat (limited to 'target/linux/mediatek')
-rw-r--r-- | target/linux/mediatek/files-5.10/drivers/leds/leds-ubnt-ledbar.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/target/linux/mediatek/files-5.10/drivers/leds/leds-ubnt-ledbar.c b/target/linux/mediatek/files-5.10/drivers/leds/leds-ubnt-ledbar.c index 1d687b7686..10d240d2be 100644 --- a/target/linux/mediatek/files-5.10/drivers/leds/leds-ubnt-ledbar.c +++ b/target/linux/mediatek/files-5.10/drivers/leds/leds-ubnt-ledbar.c @@ -99,6 +99,12 @@ out_gpio: static void ubnt_ledbar_reset(struct ubnt_ledbar *ledbar) { + static const char init_msg[16] = {0x02, 0x81, 0xfd, 0x7e, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00}; + char init_response[4]; + if (!ledbar->reset_gpio) return; @@ -108,6 +114,14 @@ static void ubnt_ledbar_reset(struct ubnt_ledbar *ledbar) msleep(10); gpiod_set_value(ledbar->reset_gpio, 0); + msleep(10); + + gpiod_set_value(ledbar->enable_gpio, 1); + msleep(10); + ubnt_ledbar_perform_transaction(ledbar, init_msg, sizeof(init_msg), init_response, sizeof(init_response)); + msleep(10); + gpiod_set_value(ledbar->enable_gpio, 0); + mutex_unlock(&ledbar->lock); } |