mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-02 03:56:49 +00:00
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 013a956f08
)
This commit is contained in:
parent
26cd0c1ee9
commit
40610c5322
@ -99,6 +99,12 @@ out_gpio:
|
|||||||
|
|
||||||
static void ubnt_ledbar_reset(struct ubnt_ledbar *ledbar)
|
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)
|
if (!ledbar->reset_gpio)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -108,6 +114,14 @@ static void ubnt_ledbar_reset(struct ubnt_ledbar *ledbar)
|
|||||||
msleep(10);
|
msleep(10);
|
||||||
gpiod_set_value(ledbar->reset_gpio, 0);
|
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);
|
mutex_unlock(&ledbar->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user