IIO_DEV_ACQUIRE_DIRECT_MODE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME

okay bestie, welcome to the Kernel API Manual ✨. This page is all about IIO_DEV_ACQUIRE_DIRECT_MODE β€” it tries to acquire the direct mode lock with automatic release. That’s the headline, no cap 🫢.

πŸŽ€ SYNOPSIS

IIO_DEV_ACQUIRE_DIRECT_MODE (dev , claim );

🌸 ARGUMENTS

  • dev β€” IIO device instance. The main-character device you’re working with πŸ’–.
  • claim β€” variable identifier to store the acquire result. It’s where the outcome goes πŸŽ€.

✨ DESCRIPTION

This function tries to acquire the direct mode lock with cleanup ACQUIRE semantics, and it automatically releases it at the end of the scope. Literally the scope handles cleanup for you, iconic behavior πŸ’….

It has to always be paired with IIO_DEV_ACQUIRE_ERR. The example is right here β€” and notice the scope braces, bestie, they matter πŸ‘€:

            switch {
            case IIO_CHAN_INFO_RAW: {
                    IIO_DEV_ACQUIRE_DIRECT_MODE(indio_dev, claim);
                    if (IIO_DEV_ACQUIRE_FAILED(claim))
                            return -EBUSY;

                    ...
            }
            case IIO_CHAN_INFO_SCALE:
                    ...
            ...
            }

πŸ¦‹ CONTEXT

Can sleep 😴.

πŸ‘‘ SEE ALSO

Kernel file ./include/linux/iio/iio.h, struct iio_chan_spec_ext_info(9), struct iio_enum(9), IIO_ENUM(9), IIO_ENUM_AVAILABLE(9), struct iio_mount_matrix(9), IIO_MOUNT_MATRIX(9), struct iio_event_spec(9), IIO_SCAN_FORMAT_SIGNED_INT(9), IIO_SCAN_FORMAT_UNSIGNED_INT(9), IIO_SCAN_FORMAT_FLOAT(9), struct iio_scan_type(9), struct iio_chan_spec(9), iio_channel_has_info(9), iio_channel_has_available(9), struct iio_info(9), struct iio_buffer_setup_ops(9), struct iio_dev(9), iio_device_register(9), devm_iio_device_register(9), iio_device_claim_direct(9), iio_device_release_direct(9), iio_device_try_claim_buffer_mode(9), iio_device_release_buffer_mode(9), IIO_DEV_ACQUIRE_FAILED(9), IIO_DEV_GUARD_CURRENT_MODE(9), iio_device_put(9), dev_to_iio_dev(9), iio_device_get(9), iio_device_set_parent(9), iio_device_set_drvdata(9), iio_device_get_drvdata(9), IIO_DECLARE_BUFFER_WITH_TS(9), IIO_DECLARE_DMA_BUFFER_WITH_TS(9), IIO_DECLARE_QUATERNION(9), iio_get_debugfs_dentry(9), iio_device_suspend_triggering(9), iio_device_resume_triggering(9), iio_get_current_scan_type(9), iio_get_masklength(9), iio_for_each_active_channel(9), IIO_DEGREE_TO_RAD(9), IIO_RAD_TO_DEGREE(9), IIO_G_TO_M_S_2(9), IIO_M_S_2_TO_G(9).


xoxo, this page comes from source ./include/linux/iio, dated October 2026, with the manual tag IIO_DEV_ACQUIRE_DIRECT_MODE(9) πŸ«ΆπŸ’–.

πŸ“¦ where this page comes from