]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/iio/industrialio-core.c
Merge tag 'char-misc-4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
[linux.git] / drivers / iio / industrialio-core.c
index 19bdf3d2962ab9bcc1f8b86bc3d2bb5db5587215..a062cfddc5af76da66a14bcf4178ee8487925099 100644 (file)
@@ -85,6 +85,8 @@ static const char * const iio_chan_type_name_spec[] = {
        [IIO_COUNT] = "count",
        [IIO_INDEX] = "index",
        [IIO_GRAVITY]  = "gravity",
+       [IIO_POSITIONRELATIVE]  = "positionrelative",
+       [IIO_PHASE] = "phase",
 };
 
 static const char * const iio_modifier_names[] = {
@@ -108,6 +110,7 @@ static const char * const iio_modifier_names[] = {
        [IIO_MOD_LIGHT_GREEN] = "green",
        [IIO_MOD_LIGHT_BLUE] = "blue",
        [IIO_MOD_LIGHT_UV] = "uv",
+       [IIO_MOD_LIGHT_DUV] = "duv",
        [IIO_MOD_QUATERNION] = "quaternion",
        [IIO_MOD_TEMP_AMBIENT] = "ambient",
        [IIO_MOD_TEMP_OBJECT] = "object",
@@ -207,35 +210,27 @@ static int iio_device_set_clock(struct iio_dev *indio_dev, clockid_t clock_id)
  */
 s64 iio_get_time_ns(const struct iio_dev *indio_dev)
 {
-       struct timespec tp;
+       struct timespec64 tp;
 
        switch (iio_device_get_clock(indio_dev)) {
        case CLOCK_REALTIME:
-               ktime_get_real_ts(&tp);
-               break;
+               return ktime_get_real_ns();
        case CLOCK_MONOTONIC:
-               ktime_get_ts(&tp);
-               break;
+               return ktime_get_ns();
        case CLOCK_MONOTONIC_RAW:
-               getrawmonotonic(&tp);
-               break;
+               return ktime_get_raw_ns();
        case CLOCK_REALTIME_COARSE:
-               tp = current_kernel_time();
-               break;
+               return ktime_to_ns(ktime_get_coarse_real());
        case CLOCK_MONOTONIC_COARSE:
-               tp = get_monotonic_coarse();
-               break;
+               ktime_get_coarse_ts64(&tp);
+               return timespec64_to_ns(&tp);
        case CLOCK_BOOTTIME:
-               get_monotonic_boottime(&tp);
-               break;
+               return ktime_get_boot_ns();
        case CLOCK_TAI:
-               timekeeping_clocktai(&tp);
-               break;
+               return ktime_get_tai_ns();
        default:
                BUG();
        }
-
-       return timespec_to_ns(&tp);
 }
 EXPORT_SYMBOL(iio_get_time_ns);