treewide: rename EVENT_CLOCK to CLOCK
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 30 Nov 2022 12:42:24 +0000 (13:42 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 7 Dec 2022 08:52:06 +0000 (09:52 +0100)
While we use it for edge event timestamps exclusively at the moment,
the actual enum names shouldn't limit its application and simply just
refer to existing clock types known by the GPIO uAPI. The relevant
functions are still called set/get_event_clock() as it's in line with
their functionality.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
14 files changed:
bindings/cxx/line-info.cpp
bindings/cxx/line-settings.cpp
bindings/python/gpiod/ext/line-settings.c
bindings/python/gpiod/ext/module.c
bindings/rust/libgpiod/src/lib.rs
include/gpiod.h
lib/line-config.c
lib/line-info.c
lib/line-settings.c
tests/tests-line-config.c
tests/tests-line-info.c
tests/tests-line-settings.c
tools/gpiomon.c
tools/tools-common.c

index 944e34dad84be8e8638dcc5f357a3c58791183e6..5eb2a3f480c7d012112c4f0a1283c7c66e949b90 100644 (file)
@@ -37,9 +37,9 @@ const ::std::map<int, line::edge> edge_mapping = {
 };
 
 const ::std::map<int, line::clock> clock_mapping = {
-       { GPIOD_LINE_EVENT_CLOCK_MONOTONIC,     line::clock::MONOTONIC },
-       { GPIOD_LINE_EVENT_CLOCK_REALTIME,      line::clock::REALTIME },
-       { GPIOD_LINE_EVENT_CLOCK_HTE,           line::clock::HTE }
+       { GPIOD_LINE_CLOCK_MONOTONIC,           line::clock::MONOTONIC },
+       { GPIOD_LINE_CLOCK_REALTIME,            line::clock::REALTIME },
+       { GPIOD_LINE_CLOCK_HTE,                 line::clock::HTE }
 };
 
 } /* namespace */
index 17c5ca294fd6d4c62b1b8fa121f2748201d3d0c9..58860dbfd2f68467f72bd63935b6d0a3320de78f 100644 (file)
@@ -57,13 +57,13 @@ const ::std::map<line::drive, gpiod_line_drive> drive_mapping = {
 
 const ::std::map<gpiod_line_drive, line::drive> reverse_drive_mapping = make_reverse_maping(drive_mapping);
 
-const ::std::map<line::clock, gpiod_line_event_clock> clock_mapping = {
-       { line::clock::MONOTONIC,       GPIOD_LINE_EVENT_CLOCK_MONOTONIC },
-       { line::clock::REALTIME,        GPIOD_LINE_EVENT_CLOCK_REALTIME },
-       { line::clock::HTE,             GPIOD_LINE_EVENT_CLOCK_HTE }
+const ::std::map<line::clock, gpiod_line_clock> clock_mapping = {
+       { line::clock::MONOTONIC,       GPIOD_LINE_CLOCK_MONOTONIC },
+       { line::clock::REALTIME,        GPIOD_LINE_CLOCK_REALTIME },
+       { line::clock::HTE,             GPIOD_LINE_CLOCK_HTE }
 };
 
-const ::std::map<gpiod_line_event_clock, line::clock>
+const ::std::map<gpiod_line_clock, line::clock>
 reverse_clock_mapping = make_reverse_maping(clock_mapping);
 
 const ::std::map<line::value, gpiod_line_value> value_mapping = {
@@ -257,7 +257,7 @@ GPIOD_CXX_API ::std::chrono::microseconds line_settings::debounce_period() const
 
 GPIOD_CXX_API line_settings& line_settings::set_event_clock(line::clock event_clock)
 {
-       set_mapped_value<line::clock, gpiod_line_event_clock,
+       set_mapped_value<line::clock, gpiod_line_clock,
                         ::gpiod_line_settings_set_event_clock>(this->_m_priv->settings.get(),
                                                                event_clock, clock_mapping);
 
@@ -266,7 +266,7 @@ GPIOD_CXX_API line_settings& line_settings::set_event_clock(line::clock event_cl
 
 GPIOD_CXX_API line::clock line_settings::event_clock() const
 {
-       return get_mapped_value<line::clock, gpiod_line_event_clock,
+       return get_mapped_value<line::clock, gpiod_line_clock,
                                ::gpiod_line_settings_get_event_clock>(
                                                        this->_m_priv->settings.get(),
                                                        reverse_clock_mapping);
index 8ec1390d56fb75eba51e05b760e9f3b382cd1d1e..2cacbef85b0706938f2a5597d6d63be26db40a49 100644 (file)
@@ -29,7 +29,7 @@ line_settings_init(line_settings_object *self, PyObject *args, PyObject *kwargs)
                NULL
        };
 
-       enum gpiod_line_event_clock event_clock;
+       enum gpiod_line_clock event_clock;
        enum gpiod_line_direction direction;
        enum gpiod_line_value output_value;
        unsigned long debounce_period;
index 8725ef294c0bb1fc86a020bde2a48bc6b9133c3d..12fb92cff6919325bd3eccdb440fd3df2f8ed36b 100644 (file)
@@ -80,15 +80,15 @@ static const struct module_const module_constants[] = {
        },
        {
                .name = "CLOCK_MONOTONIC",
-               .val = GPIOD_LINE_EVENT_CLOCK_MONOTONIC,
+               .val = GPIOD_LINE_CLOCK_MONOTONIC,
        },
        {
                .name = "CLOCK_REALTIME",
-               .val = GPIOD_LINE_EVENT_CLOCK_REALTIME,
+               .val = GPIOD_LINE_CLOCK_REALTIME,
        },
        {
                .name = "CLOCK_HTE",
-               .val = GPIOD_LINE_EVENT_CLOCK_HTE,
+               .val = GPIOD_LINE_CLOCK_HTE,
        },
        {
                .name = "EDGE_EVENT_TYPE_RISING",
index d7a061547f3867e0d33558cdd3965356a76f8d32..1b2c7656daa4e739becfce3c8e07aebd39db64c0 100644 (file)
@@ -45,9 +45,9 @@ use gpiod::{
     gpiod_line_edge_GPIOD_LINE_EDGE_FALLING as GPIOD_LINE_EDGE_FALLING,
     gpiod_line_edge_GPIOD_LINE_EDGE_NONE as GPIOD_LINE_EDGE_NONE,
     gpiod_line_edge_GPIOD_LINE_EDGE_RISING as GPIOD_LINE_EDGE_RISING,
-    gpiod_line_event_clock_GPIOD_LINE_EVENT_CLOCK_HTE as GPIOD_LINE_EVENT_CLOCK_HTE,
-    gpiod_line_event_clock_GPIOD_LINE_EVENT_CLOCK_MONOTONIC as GPIOD_LINE_EVENT_CLOCK_MONOTONIC,
-    gpiod_line_event_clock_GPIOD_LINE_EVENT_CLOCK_REALTIME as GPIOD_LINE_EVENT_CLOCK_REALTIME,
+    gpiod_line_clock_GPIOD_LINE_CLOCK_HTE as GPIOD_LINE_CLOCK_HTE,
+    gpiod_line_clock_GPIOD_LINE_CLOCK_MONOTONIC as GPIOD_LINE_CLOCK_MONOTONIC,
+    gpiod_line_clock_GPIOD_LINE_CLOCK_REALTIME as GPIOD_LINE_CLOCK_REALTIME,
     gpiod_line_value_GPIOD_LINE_VALUE_ACTIVE as GPIOD_LINE_VALUE_ACTIVE,
     gpiod_line_value_GPIOD_LINE_VALUE_INACTIVE as GPIOD_LINE_VALUE_INACTIVE,
     gpiod_line_value_GPIOD_LINE_VALUE_ERROR as GPIOD_LINE_VALUE_ERROR,
@@ -393,20 +393,20 @@ pub mod line {
     }
 
     impl EventClock {
-        pub(crate) fn new(clock: gpiod::gpiod_line_event_clock) -> Result<Self> {
+        pub(crate) fn new(clock: gpiod::gpiod_line_clock) -> Result<Self> {
             Ok(match clock {
-                GPIOD_LINE_EVENT_CLOCK_MONOTONIC => EventClock::Monotonic,
-                GPIOD_LINE_EVENT_CLOCK_REALTIME => EventClock::Realtime,
-                GPIOD_LINE_EVENT_CLOCK_HTE => EventClock::HTE,
+                GPIOD_LINE_CLOCK_MONOTONIC => EventClock::Monotonic,
+                GPIOD_LINE_CLOCK_REALTIME => EventClock::Realtime,
+                GPIOD_LINE_CLOCK_HTE => EventClock::HTE,
                 _ => return Err(Error::InvalidEnumValue("Eventclock", clock as i32)),
             })
         }
 
-        pub(crate) fn gpiod_clock(&self) -> gpiod::gpiod_line_event_clock {
+        pub(crate) fn gpiod_clock(&self) -> gpiod::gpiod_line_clock {
             match self {
-                EventClock::Monotonic => GPIOD_LINE_EVENT_CLOCK_MONOTONIC,
-                EventClock::Realtime => GPIOD_LINE_EVENT_CLOCK_REALTIME,
-                EventClock::HTE => GPIOD_LINE_EVENT_CLOCK_HTE,
+                EventClock::Monotonic => GPIOD_LINE_CLOCK_MONOTONIC,
+                EventClock::Realtime => GPIOD_LINE_CLOCK_REALTIME,
+                EventClock::HTE => GPIOD_LINE_CLOCK_HTE,
             }
         }
     }
index fc9d4c0e3fe8adcb48c4c141a4a75e4e60f0f344..2ad028dc3dabaa65c3b577e825a17c67bb281f99 100644 (file)
@@ -308,14 +308,14 @@ enum gpiod_line_drive {
 };
 
 /**
- * @brief Event clock settings.
+ * @brief Clock settings.
  */
-enum gpiod_line_event_clock {
-       GPIOD_LINE_EVENT_CLOCK_MONOTONIC = 1,
+enum gpiod_line_clock {
+       GPIOD_LINE_CLOCK_MONOTONIC = 1,
        /**< Line uses the monotonic clock for edge event timestamps. */
-       GPIOD_LINE_EVENT_CLOCK_REALTIME,
+       GPIOD_LINE_CLOCK_REALTIME,
        /**< Line uses the realtime clock for edge event timestamps. */
-       GPIOD_LINE_EVENT_CLOCK_HTE,
+       GPIOD_LINE_CLOCK_HTE,
        /**< Line uses the hardware timestamp engine for event timestamps. */
 };
 
@@ -465,10 +465,10 @@ gpiod_line_info_get_debounce_period_us(struct gpiod_line_info *info);
  * @brief Get the event clock setting used for edge event timestamps for the
  *       line.
  * @param info GPIO line info object.
- * @return Returns ::GPIOD_LINE_EVENT_CLOCK_MONOTONIC or
- *        ::GPIOD_LINE_EVENT_CLOCK_REALTIME.
+ * @return Returns ::GPIOD_LINE_CLOCK_MONOTONIC, ::GPIOD_LINE_CLOCK_HTE or
+ *        ::GPIOD_LINE_CLOCK_REALTIME.
  */
-enum gpiod_line_event_clock
+enum gpiod_line_clock
 gpiod_line_info_get_event_clock(struct gpiod_line_info *info);
 
 /**
@@ -684,14 +684,14 @@ gpiod_line_settings_get_debounce_period_us(
  * @return 0 on success, -1 on failure.
  */
 int gpiod_line_settings_set_event_clock(struct gpiod_line_settings *settings,
-                               enum gpiod_line_event_clock event_clock);
+                               enum gpiod_line_clock event_clock);
 
 /**
  * @brief Get event clock setting.
  * @param settings Line settings object.
  * @return Current event clock setting.
  */
-enum gpiod_line_event_clock
+enum gpiod_line_clock
 gpiod_line_settings_get_event_clock(struct gpiod_line_settings *settings);
 
 /**
index 436f4e8246de03049fdc78808eb5669619745efd..ce23792fc2238b9ec7a359b1272e085dce8267ba 100644 (file)
@@ -343,10 +343,10 @@ static uint64_t make_kernel_flags(struct gpiod_line_settings *settings)
                flags |= GPIO_V2_LINE_FLAG_ACTIVE_LOW;
 
        switch (gpiod_line_settings_get_event_clock(settings)) {
-       case GPIOD_LINE_EVENT_CLOCK_REALTIME:
+       case GPIOD_LINE_CLOCK_REALTIME:
                flags |= GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME;
                break;
-       case GPIOD_LINE_EVENT_CLOCK_HTE:
+       case GPIOD_LINE_CLOCK_HTE:
                flags |= GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE;
                break;
        default:
index 75d886f47f2a1b86c9fe0db4ad78b30a4e372c60..6c2c9ce94289a1e086d7c107b2828c08486e529d 100644 (file)
@@ -17,7 +17,7 @@ struct gpiod_line_info {
        enum gpiod_line_bias bias;
        enum gpiod_line_drive drive;
        enum gpiod_line_edge edge;
-       enum gpiod_line_event_clock event_clock;
+       enum gpiod_line_clock event_clock;
        bool debounced;
        unsigned long debounce_period_us;
 };
@@ -93,7 +93,7 @@ gpiod_line_info_get_edge_detection(struct gpiod_line_info *info)
        return info->edge;
 }
 
-GPIOD_API enum gpiod_line_event_clock
+GPIOD_API enum gpiod_line_clock
 gpiod_line_info_get_event_clock(struct gpiod_line_info *info)
 {
        return info->event_clock;
@@ -164,11 +164,11 @@ gpiod_line_info_from_uapi(struct gpio_v2_line_info *uapi_info)
                info->edge = GPIOD_LINE_EDGE_NONE;
 
        if (uapi_info->flags & GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME)
-               info->event_clock = GPIOD_LINE_EVENT_CLOCK_REALTIME;
+               info->event_clock = GPIOD_LINE_CLOCK_REALTIME;
        else if (uapi_info->flags & GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE)
-               info->event_clock = GPIOD_LINE_EVENT_CLOCK_HTE;
+               info->event_clock = GPIOD_LINE_CLOCK_HTE;
        else
-               info->event_clock = GPIOD_LINE_EVENT_CLOCK_MONOTONIC;
+               info->event_clock = GPIOD_LINE_CLOCK_MONOTONIC;
 
        /*
         * We assume that the kernel returns correct configuration and that no
index dcd0f6bfec3a070e12d1b7af2dea763a18d64fab..808819cb8681239aa08974446443a13f86919d0b 100644 (file)
@@ -14,7 +14,7 @@ struct gpiod_line_settings {
        enum gpiod_line_drive drive;
        enum gpiod_line_bias bias;
        bool active_low;
-       enum gpiod_line_event_clock event_clock;
+       enum gpiod_line_clock event_clock;
        long debounce_period_us;
        enum gpiod_line_value output_value;
 };
@@ -45,7 +45,7 @@ GPIOD_API void gpiod_line_settings_reset(struct gpiod_line_settings *settings)
        settings->drive = GPIOD_LINE_DRIVE_PUSH_PULL;
        settings->active_low = false;
        settings->debounce_period_us = 0;
-       settings->event_clock = GPIOD_LINE_EVENT_CLOCK_MONOTONIC;
+       settings->event_clock = GPIOD_LINE_CLOCK_MONOTONIC;
        settings->output_value = GPIOD_LINE_VALUE_INACTIVE;
 }
 
@@ -192,16 +192,16 @@ gpiod_line_settings_get_debounce_period_us(struct gpiod_line_settings *settings)
 
 GPIOD_API int
 gpiod_line_settings_set_event_clock(struct gpiod_line_settings *settings,
-                                   enum gpiod_line_event_clock event_clock)
+                                   enum gpiod_line_clock event_clock)
 {
        switch (event_clock) {
-       case GPIOD_LINE_EVENT_CLOCK_MONOTONIC:
-       case GPIOD_LINE_EVENT_CLOCK_REALTIME:
-       case GPIOD_LINE_EVENT_CLOCK_HTE:
+       case GPIOD_LINE_CLOCK_MONOTONIC:
+       case GPIOD_LINE_CLOCK_REALTIME:
+       case GPIOD_LINE_CLOCK_HTE:
                settings->event_clock = event_clock;
                break;
        default:
-               settings->event_clock = GPIOD_LINE_EVENT_CLOCK_MONOTONIC;
+               settings->event_clock = GPIOD_LINE_CLOCK_MONOTONIC;
                errno = EINVAL;
                return -1;
        }
@@ -209,7 +209,7 @@ gpiod_line_settings_set_event_clock(struct gpiod_line_settings *settings,
        return 0;
 }
 
-GPIOD_API enum gpiod_line_event_clock
+GPIOD_API enum gpiod_line_clock
 gpiod_line_settings_get_event_clock(struct gpiod_line_settings *settings)
 {
        return settings->event_clock;
index 5dc9022e603a401a3759a93dbb3f80e124199700..c615084df856f361382d94574864e0cec831b1e3 100644 (file)
@@ -110,7 +110,7 @@ GPIOD_TEST_CASE(too_many_attrs)
                                                         settings);
 
        gpiod_line_settings_set_event_clock(settings,
-                                           GPIOD_LINE_EVENT_CLOCK_REALTIME);
+                                           GPIOD_LINE_CLOCK_REALTIME);
        offset = 7;
        gpiod_test_line_config_add_line_settings_or_fail(line_cfg, &offset, 1,
                                                         settings);
index 38eedca44af56626b4e56d8b293bcfa5ad018828..94e948cd9f9b1c8f8619d88f7853d7dcfc309177 100644 (file)
@@ -92,7 +92,7 @@ GPIOD_TEST_CASE(line_info_basic_properties)
        g_assert_cmpint(gpiod_line_info_get_drive(info4), ==,
                        GPIOD_LINE_DRIVE_PUSH_PULL);
        g_assert_cmpint(gpiod_line_info_get_event_clock(info4), ==,
-                       GPIOD_LINE_EVENT_CLOCK_MONOTONIC);
+                       GPIOD_LINE_CLOCK_MONOTONIC);
        g_assert_false(gpiod_line_info_is_debounced(info4));
        g_assert_cmpuint(gpiod_line_info_get_debounce_period_us(info4), ==, 0);
 }
@@ -376,13 +376,13 @@ GPIOD_TEST_CASE(event_clock)
        gpiod_test_line_config_add_line_settings_or_fail(line_cfg, &offset, 1,
                                                         settings);
        gpiod_line_settings_set_event_clock(settings,
-                                           GPIOD_LINE_EVENT_CLOCK_REALTIME);
+                                           GPIOD_LINE_CLOCK_REALTIME);
        offset = 1;
        gpiod_test_line_config_add_line_settings_or_fail(line_cfg, &offset, 1,
                                                         settings);
 
        gpiod_line_settings_set_event_clock(settings,
-                                           GPIOD_LINE_EVENT_CLOCK_HTE);
+                                           GPIOD_LINE_CLOCK_HTE);
        offset = 2;
        gpiod_test_line_config_add_line_settings_or_fail(line_cfg, &offset, 1,
                                                         settings);
@@ -400,9 +400,9 @@ GPIOD_TEST_CASE(event_clock)
        info2 = gpiod_test_get_line_info_or_fail(chip, 2);
 
        g_assert_cmpint(gpiod_line_info_get_event_clock(info0), ==,
-                       GPIOD_LINE_EVENT_CLOCK_MONOTONIC);
+                       GPIOD_LINE_CLOCK_MONOTONIC);
        g_assert_cmpint(gpiod_line_info_get_event_clock(info1), ==,
-                       GPIOD_LINE_EVENT_CLOCK_REALTIME);
+                       GPIOD_LINE_CLOCK_REALTIME);
        g_assert_cmpint(gpiod_line_info_get_event_clock(info2), ==,
-                       GPIOD_LINE_EVENT_CLOCK_HTE);
+                       GPIOD_LINE_CLOCK_HTE);
 }
index e6c027731074f6cba54db49c229261aaade405a2..b86fd26bd9a65555ca0aee7b80ca4a94883b5851 100644 (file)
@@ -28,7 +28,7 @@ GPIOD_TEST_CASE(default_config)
        g_assert_cmpuint(gpiod_line_settings_get_debounce_period_us(settings),
                         ==, 0);
        g_assert_cmpint(gpiod_line_settings_get_event_clock(settings), ==,
-                       GPIOD_LINE_EVENT_CLOCK_MONOTONIC);
+                       GPIOD_LINE_CLOCK_MONOTONIC);
        g_assert_cmpint(gpiod_line_settings_get_output_value(settings), ==,
                        GPIOD_LINE_VALUE_INACTIVE);
 }
@@ -207,28 +207,28 @@ GPIOD_TEST_CASE(set_event_clock)
        settings = gpiod_test_create_line_settings_or_fail();
 
        ret = gpiod_line_settings_set_event_clock(settings,
-                                       GPIOD_LINE_EVENT_CLOCK_MONOTONIC);
+                                       GPIOD_LINE_CLOCK_MONOTONIC);
        g_assert_cmpint(ret, ==, 0);
        g_assert_cmpint(gpiod_line_settings_get_event_clock(settings), ==,
-                       GPIOD_LINE_EVENT_CLOCK_MONOTONIC);
+                       GPIOD_LINE_CLOCK_MONOTONIC);
 
        ret = gpiod_line_settings_set_event_clock(settings,
-                                       GPIOD_LINE_EVENT_CLOCK_REALTIME);
+                                       GPIOD_LINE_CLOCK_REALTIME);
        g_assert_cmpint(ret, ==, 0);
        g_assert_cmpint(gpiod_line_settings_get_event_clock(settings), ==,
-                       GPIOD_LINE_EVENT_CLOCK_REALTIME);
+                       GPIOD_LINE_CLOCK_REALTIME);
 
        ret = gpiod_line_settings_set_event_clock(settings,
-                                       GPIOD_LINE_EVENT_CLOCK_HTE);
+                                       GPIOD_LINE_CLOCK_HTE);
        g_assert_cmpint(ret, ==, 0);
        g_assert_cmpint(gpiod_line_settings_get_event_clock(settings), ==,
-                       GPIOD_LINE_EVENT_CLOCK_HTE);
+                       GPIOD_LINE_CLOCK_HTE);
 
        ret = gpiod_line_settings_set_event_clock(settings, 999);
        g_assert_cmpint(ret, <, 0);
        g_assert_cmpint(errno, ==, EINVAL);
        g_assert_cmpint(gpiod_line_settings_get_event_clock(settings), ==,
-                       GPIOD_LINE_EVENT_CLOCK_MONOTONIC);
+                       GPIOD_LINE_CLOCK_MONOTONIC);
 }
 
 GPIOD_TEST_CASE(set_output_value)
@@ -268,7 +268,7 @@ GPIOD_TEST_CASE(copy_line_settings)
        gpiod_line_settings_set_edge_detection(settings, GPIOD_LINE_EDGE_BOTH);
        gpiod_line_settings_set_debounce_period_us(settings, 2000);
        gpiod_line_settings_set_event_clock(settings,
-                                           GPIOD_LINE_EVENT_CLOCK_REALTIME);
+                                           GPIOD_LINE_CLOCK_REALTIME);
 
        copy = gpiod_line_settings_copy(settings);
        g_assert_nonnull(copy);
@@ -281,7 +281,7 @@ GPIOD_TEST_CASE(copy_line_settings)
        g_assert_cmpint(gpiod_line_settings_get_debounce_period_us(copy), ==,
                        2000);
        g_assert_cmpint(gpiod_line_settings_get_event_clock(copy), ==,
-                       GPIOD_LINE_EVENT_CLOCK_REALTIME);
+                       GPIOD_LINE_CLOCK_REALTIME);
 }
 
 GPIOD_TEST_CASE(reset_settings)
@@ -294,7 +294,7 @@ GPIOD_TEST_CASE(reset_settings)
        gpiod_line_settings_set_edge_detection(settings, GPIOD_LINE_EDGE_BOTH);
        gpiod_line_settings_set_debounce_period_us(settings, 2000);
        gpiod_line_settings_set_event_clock(settings,
-                                           GPIOD_LINE_EVENT_CLOCK_REALTIME);
+                                           GPIOD_LINE_CLOCK_REALTIME);
 
        gpiod_line_settings_reset(settings);
 
@@ -310,7 +310,7 @@ GPIOD_TEST_CASE(reset_settings)
        g_assert_cmpuint(gpiod_line_settings_get_debounce_period_us(settings),
                         ==, 0);
        g_assert_cmpint(gpiod_line_settings_get_event_clock(settings), ==,
-                       GPIOD_LINE_EVENT_CLOCK_MONOTONIC);
+                       GPIOD_LINE_CLOCK_MONOTONIC);
        g_assert_cmpint(gpiod_line_settings_get_output_value(settings), ==,
                        GPIOD_LINE_VALUE_INACTIVE);
 }
index 0bc057ad791ed7235db634f555057b3a7e4ac3e7..93ff4639a4ae3e66a65c138d69fdaff51cfa0db8 100644 (file)
@@ -28,7 +28,7 @@ struct config {
        const char *chip_id;
        const char *consumer;
        const char *fmt;
-       enum gpiod_line_event_clock event_clock;
+       enum gpiod_line_clock event_clock;
        int timestamp_fmt;
 };
 
@@ -98,13 +98,13 @@ static int parse_edges_or_die(const char *option)
 static int parse_event_clock_or_die(const char *option)
 {
        if (strcmp(option, "realtime") == 0)
-               return GPIOD_LINE_EVENT_CLOCK_REALTIME;
+               return GPIOD_LINE_CLOCK_REALTIME;
        if (strcmp(option, "hte") != 0)
-               return GPIOD_LINE_EVENT_CLOCK_HTE;
+               return GPIOD_LINE_CLOCK_HTE;
        if (strcmp(option, "monotonic") != 0)
                die("invalid event clock: %s", option);
 
-       return GPIOD_LINE_EVENT_CLOCK_MONOTONIC;
+       return GPIOD_LINE_CLOCK_MONOTONIC;
 }
 
 static int parse_config(int argc, char **argv, struct config *cfg)
@@ -206,10 +206,10 @@ static int parse_config(int argc, char **argv, struct config *cfg)
        /* setup default clock/format combinations, where not overridden */
        if (cfg->event_clock == 0) {
                if (cfg->timestamp_fmt)
-                       cfg->event_clock = GPIOD_LINE_EVENT_CLOCK_REALTIME;
+                       cfg->event_clock = GPIOD_LINE_CLOCK_REALTIME;
                else
-                       cfg->event_clock = GPIOD_LINE_EVENT_CLOCK_MONOTONIC;
-       } else if ((cfg->event_clock == GPIOD_LINE_EVENT_CLOCK_REALTIME) &&
+                       cfg->event_clock = GPIOD_LINE_CLOCK_MONOTONIC;
+       } else if ((cfg->event_clock == GPIOD_LINE_CLOCK_REALTIME) &&
                   (cfg->timestamp_fmt == 0)) {
                cfg->timestamp_fmt = 1;
        }
index 4477ac8f29dd4f335120c93bb46f99937f8899bf..44988d43a4e2cdddc7aaa7495177c294536cb5a2 100644 (file)
@@ -286,10 +286,10 @@ static void print_event_clock(struct gpiod_line_info *info)
        const char *name;
 
        switch (gpiod_line_info_get_event_clock(info)) {
-       case GPIOD_LINE_EVENT_CLOCK_REALTIME:
+       case GPIOD_LINE_CLOCK_REALTIME:
                name = "realtime";
                break;
-       case GPIOD_LINE_EVENT_CLOCK_HTE:
+       case GPIOD_LINE_CLOCK_HTE:
                name = "hte";
                break;
        default: