How can I call the trigger_set_state ops function from a userland app?
You connect to a trigger via a iio_device struct, but from that, how do you call the function?
You don't since this is a in-kernel API - please see here:
You can connect triggers that may have a user interface such as iio trigger sysfs - please see here:
Retrieving data ...