fbd-dev-led-qcom-multicolor: Support QCOM LPG LED multicolor
QCOM LPG LEDs can also operate in a multicolor fashion. Re-use the probing sequence of multicolor LEDs and the hw_pattern configuration of single color QCOM LPG LEDs.
This commit is contained in:
committed by
Guido Günther
parent
10e6d3cba8
commit
2b53725fcb
@@ -9,6 +9,7 @@
|
||||
#include "fbd-dev-led.h"
|
||||
#include "fbd-dev-led-multicolor.h"
|
||||
#include "fbd-dev-led-qcom.h"
|
||||
#include "fbd-dev-led-qcom-multicolor.h"
|
||||
|
||||
#include "testlib.h"
|
||||
|
||||
@@ -95,6 +96,34 @@ test_fbd_dev_led_qcom_simple (FbdUmockdevFixture *fixture, gconstpointer unused)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
test_fbd_dev_led_qcom_multicolor (FbdUmockdevFixture *fixture, gconstpointer unused)
|
||||
{
|
||||
GUdevClient *client;
|
||||
g_autolist (GUdevDevice) leds = NULL;
|
||||
FbdDevLed *led;
|
||||
g_autoptr (GError) err = NULL;
|
||||
GUdevDevice *dev;
|
||||
|
||||
client = g_udev_client_new ((const char *const []){ "leds", NULL});
|
||||
leds = g_udev_client_query_by_subsystem (client, "leds");
|
||||
|
||||
/* There should be a single device only */
|
||||
g_assert_cmpint (g_list_length (leds), ==, 1);
|
||||
dev = G_UDEV_DEVICE (leds->data);
|
||||
|
||||
g_assert_cmpstr (g_udev_device_get_property (dev, "FEEDBACKD_TYPE"), ==, "led");
|
||||
|
||||
led = fbd_dev_led_qcom_multicolor_new (dev, &err);
|
||||
g_assert_no_error (err);
|
||||
g_assert_cmpint (fbd_dev_led_get_max_brightness (led), ==, 511);
|
||||
g_assert_true (fbd_dev_led_supports_color (led, FBD_FEEDBACK_LED_COLOR_BLUE));
|
||||
g_assert_true (fbd_dev_led_start_periodic (led, 50, 50));
|
||||
|
||||
g_assert_finalize_object (led);
|
||||
}
|
||||
|
||||
|
||||
gint
|
||||
main (gint argc, gchar *argv[])
|
||||
{
|
||||
@@ -109,6 +138,9 @@ main (gint argc, gchar *argv[])
|
||||
FBD_UMOCKDEV_TEST_ADD ("/feedbackd/fbd/dev/led/qcom/simple",
|
||||
test_fbd_dev_led_qcom_simple,
|
||||
"led-qcom-simple");
|
||||
FBD_UMOCKDEV_TEST_ADD ("/feedbackd/fbd/dev/led/qcom/multicolor",
|
||||
test_fbd_dev_led_qcom_multicolor,
|
||||
"led-qcom-multicolor");
|
||||
|
||||
return g_test_run();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user