/linux/drivers/iio/ |
H A D | industrialio-trigger.c | 53 struct iio_trigger *trig = to_iio_trigger(dev); in name_show() local 55 return sysfs_emit(buf, "%s\n", trig->name); in name_show() 114 int iio_trigger_set_immutable(struct iio_dev *indio_dev, struct iio_trigger *trig) in iio_trigger_set_immutable() argument 118 if (!indio_dev || !trig) in iio_trigger_set_immutable() 125 indio_dev->trig = iio_trigger_get(trig); in iio_trigger_set_immutable() 158 struct iio_trigger *trig = container_of(work, struct iio_trigger, in iio_reenable_work_fn() local 165 trig->ops->reenable(trig); in iio_reenable_work_fn() 182 static void iio_trigger_notify_done_atomic(struct iio_trigger *trig) in iio_trigger_notify_done_atomic() argument 184 if (atomic_dec_and_test(&trig->use_count) && trig->ops && in iio_trigger_notify_done_atomic() 185 trig->ops->reenable) in iio_trigger_notify_done_atomic() [all …]
|
H A D | iio_core_trigger.h | 24 int iio_trigger_attach_poll_func(struct iio_trigger *trig, 26 int iio_trigger_detach_poll_func(struct iio_trigger *trig, 48 static inline int iio_trigger_attach_poll_func(struct iio_trigger *trig, in iio_trigger_attach_poll_func() argument 53 static inline int iio_trigger_detach_poll_func(struct iio_trigger *trig, in iio_trigger_detach_poll_func() argument
|
/linux/drivers/leds/ |
H A D | led-triggers.c | 31 trigger_relevant(struct led_classdev *led_cdev, struct led_trigger *trig) in trigger_relevant() argument 33 return !trig->trigger_type || trig->trigger_type == led_cdev->trigger_type; in trigger_relevant() 42 struct led_trigger *trig; in led_trigger_write() local 58 list_for_each_entry(trig, &trigger_list, next_trig) { in led_trigger_write() 59 if (sysfs_streq(buf, trig->name) && trigger_relevant(led_cdev, trig)) { in led_trigger_write() 61 led_trigger_set(led_cdev, trig); in led_trigger_write() 97 struct led_trigger *trig; in led_trigger_format() local 101 list_for_each_entry(trig, &trigger_list, next_trig) { in led_trigger_format() 104 if (!trigger_relevant(led_cdev, trig)) in led_trigger_format() 107 hit = led_cdev->trigger && !strcmp(led_cdev->trigger->name, trig->name); in led_trigger_format() [all …]
|
/linux/include/linux/iio/ |
H A D | trigger.h | 33 int (*set_trigger_state)(struct iio_trigger *trig, bool state); 34 void (*reenable)(struct iio_trigger *trig); 35 int (*validate_device)(struct iio_trigger *trig, 87 static inline void iio_trigger_put(struct iio_trigger *trig) in iio_trigger_put() argument 89 module_put(trig->owner); in iio_trigger_put() 90 put_device(&trig->dev); in iio_trigger_put() 93 static inline struct iio_trigger *iio_trigger_get(struct iio_trigger *trig) in iio_trigger_get() argument 95 get_device(&trig->dev); in iio_trigger_get() 97 WARN_ONCE(list_empty(&trig->list), in iio_trigger_get() 99 trig->name); in iio_trigger_get() [all …]
|
/linux/drivers/power/supply/ |
H A D | power_supply_leds.c | 23 struct led_trigger trig; member 28 container_of(trigger, struct power_supply_led_trigger, trig) 55 psy_trig->trig.name = kasprintf(GFP_KERNEL, name_template, psy->desc->name); in power_supply_register_led_trigger() 56 if (!psy_trig->trig.name) in power_supply_register_led_trigger() 59 psy_trig->trig.activate = power_supply_led_trigger_activate; in power_supply_register_led_trigger() 62 ret = led_trigger_register(&psy_trig->trig); in power_supply_register_led_trigger() 66 *tp = &psy_trig->trig; in power_supply_register_led_trigger() 70 kfree(psy_trig->trig.name); in power_supply_register_led_trigger() 79 static void power_supply_unregister_led_trigger(struct led_trigger *trig) in power_supply_unregister_led_trigger() argument 83 if (!trig) in power_supply_unregister_led_trigger() [all …]
|
/linux/drivers/iio/gyro/ |
H A D | itg3200_buffer.c | 65 iio_trigger_notify_done(indio_dev->trig); in itg3200_trigger_handler() 82 static int itg3200_data_rdy_trigger_set_state(struct iio_trigger *trig, in itg3200_data_rdy_trigger_set_state() argument 85 struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig); in itg3200_data_rdy_trigger_set_state() 116 st->trig = iio_trigger_alloc(&st->i2c->dev, "%s-dev%d", indio_dev->name, in itg3200_probe_trigger() 118 if (!st->trig) in itg3200_probe_trigger() 125 st->trig); in itg3200_probe_trigger() 130 st->trig->ops = &itg3200_trigger_ops; in itg3200_probe_trigger() 131 iio_trigger_set_drvdata(st->trig, indio_dev); in itg3200_probe_trigger() 132 ret = iio_trigger_register(st->trig); in itg3200_probe_trigger() 137 indio_dev->trig = iio_trigger_get(st->trig); in itg3200_probe_trigger() [all …]
|
/linux/drivers/clk/bcm/ |
H A D | clk-bcm281xx.c | 17 .trig = TRIGGER(0x0e04, 0), 39 .trig = TRIGGER(0x0a40, 4), 49 .trig = TRIGGER(0x0a40, 0), 57 .trig = TRIGGER(0x0a40, 2), 80 .trig = TRIGGER(0x0e84, 1), 103 .trig = TRIGGER(0x0afc, 9), 115 .trig = TRIGGER(0x0afc, 10), 127 .trig = TRIGGER(0x0afc, 12), 139 .trig = TRIGGER(0x0afc, 11), 149 .trig = TRIGGER(0x0afc, 7), [all …]
|
H A D | clk-bcm21664.c | 39 .trig = TRIGGER(0x0a40, 4), 66 .trig = TRIGGER(0x0afc, 9), 78 .trig = TRIGGER(0x0afc, 10), 90 .trig = TRIGGER(0x0afc, 12), 102 .trig = TRIGGER(0x0afc, 11), 161 .trig = TRIGGER(0x0afc, 2), 171 .trig = TRIGGER(0x0afc, 3), 181 .trig = TRIGGER(0x0afc, 4), 192 .trig = TRIGGER(0x0afc, 23), 203 .trig = TRIGGER(0x0afc, 24), [all …]
|
H A D | clk-kona-setup.c | 14 #define trigger_clear_exists(trig) FLAG_CLEAR(trig, TRIG, EXISTS) argument 77 struct bcm_clk_trig *trig; in peri_clk_data_offsets_valid() local 149 trig = &peri->trig; in peri_clk_data_offsets_valid() 150 if (trigger_exists(trig)) { in peri_clk_data_offsets_valid() 151 if (trig->offset > limit) { in peri_clk_data_offsets_valid() 153 __func__, name, trig->offset, limit); in peri_clk_data_offsets_valid() 158 trig = &peri->pre_trig; in peri_clk_data_offsets_valid() 159 if (trigger_exists(trig)) { in peri_clk_data_offsets_valid() 160 if (trig->offset > limit) { in peri_clk_data_offsets_valid() 162 __func__, name, trig->offset, limit); in peri_clk_data_offsets_valid() [all …]
|
H A D | clk-kona.c | 545 static bool __clk_trigger(struct ccu_data *ccu, struct bcm_clk_trig *trig) in __clk_trigger() argument 548 __ccu_write(ccu, trig->offset, 1 << trig->bit); in __clk_trigger() 550 return __ccu_wait_bit(ccu, trig->offset, trig->bit, false); in __clk_trigger() 584 struct bcm_clk_div *div, struct bcm_clk_trig *trig) in __div_commit() argument 624 if (!__clk_trigger(ccu, trig)) in __div_commit() 640 struct bcm_clk_div *div, struct bcm_clk_trig *trig) in div_init() argument 644 return !__div_commit(ccu, gate, div, trig); in div_init() 648 struct bcm_clk_div *div, struct bcm_clk_trig *trig, in divider_write() argument 666 ret = __div_commit(ccu, gate, div, trig); in divider_write() 867 struct bcm_clk_sel *sel, struct bcm_clk_trig *trig) in __sel_commit() argument [all …]
|
/linux/drivers/media/pci/mgb4/ |
H A D | mgb4_trigger.c | 25 struct iio_trigger *trig; member 46 static int trigger_set_state(struct iio_trigger *trig, bool state) in trigger_set_state() argument 48 struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig); in trigger_set_state() 100 iio_trigger_notify_done(indio_dev->trig); in trigger_handler() 112 st->trig = iio_trigger_alloc(&st->mgbdev->pdev->dev, "%s-dev%d", in probe_trigger() 114 if (!st->trig) in probe_trigger() 118 "mgb4-trigger", st->trig); in probe_trigger() 122 st->trig->ops = &trigger_ops; in probe_trigger() 123 iio_trigger_set_drvdata(st->trig, indio_dev); in probe_trigger() 124 ret = iio_trigger_register(st->trig); in probe_trigger() [all …]
|
/linux/drivers/iio/common/st_sensors/ |
H A D | st_sensors_trigger.c | 59 struct iio_trigger *trig = p; in st_sensors_irq_handler() local 60 struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig); in st_sensors_irq_handler() 75 struct iio_trigger *trig = p; in st_sensors_irq_thread() local 76 struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig); in st_sensors_irq_thread() 127 sdata->trig = devm_iio_trigger_alloc(parent, "%s-trigger", in st_sensors_allocate_trigger() 129 if (sdata->trig == NULL) { in st_sensors_allocate_trigger() 134 iio_trigger_set_drvdata(sdata->trig, indio_dev); in st_sensors_allocate_trigger() 135 sdata->trig->ops = trigger_ops; in st_sensors_allocate_trigger() 214 sdata->trig->name, in st_sensors_allocate_trigger() 215 sdata->trig); in st_sensors_allocate_trigger() [all …]
|
/linux/arch/arm64/boot/dts/arm/ |
H A D | juno-cs-r1r2.dtsi | 95 trig-conns@0 { 97 arm,trig-in-sigs = <0 1>; 98 arm,trig-in-types = <SNK_FULL SNK_ACQCOMP>; 99 arm,trig-out-sigs = <0 1>; 100 arm,trig-out-types = <SNK_FLUSHIN SNK_TRIGIN>; 104 trig-conns@1 { 106 arm,trig-in-sigs = <2 3 4>; 107 arm,trig-in-types = <ELA_DBGREQ ELA_TSTART ELA_TSTOP>; 108 arm,trig-conn-name = "ela_clus_0"; 111 trig-conns@2 { [all …]
|
H A D | juno-base.dtsi | 583 trig-conns@0 { 585 arm,trig-in-sigs = <2 3>; 586 arm,trig-in-types = <SNK_FULL SNK_ACQCOMP>; 587 arm,trig-out-sigs = <0 1>; 588 arm,trig-out-types = <SNK_FLUSHIN SNK_TRIGIN>; 592 trig-conns@1 { 594 arm,trig-in-sigs = <0 1>; 595 arm,trig-in-types = <SNK_FULL SNK_ACQCOMP>; 596 arm,trig-out-sigs = <7 6>; 597 arm,trig-out-types = <SNK_FLUSHIN SNK_TRIGIN>; [all …]
|
/linux/drivers/iio/trigger/ |
H A D | stm32-lptimer-trigger.c | 31 static int stm32_lptim_validate_device(struct iio_trigger *trig, in stm32_lptim_validate_device() argument 51 bool is_stm32_lptim_trigger(struct iio_trigger *trig) in is_stm32_lptim_trigger() argument 53 return (trig->ops == &stm32_lptim_trigger_ops); in is_stm32_lptim_trigger() 59 struct iio_trigger *trig; in stm32_lptim_setup_trig() local 61 trig = devm_iio_trigger_alloc(priv->dev, "%s", priv->trg); in stm32_lptim_setup_trig() 62 if (!trig) in stm32_lptim_setup_trig() 65 trig->dev.parent = priv->dev->parent; in stm32_lptim_setup_trig() 66 trig->ops = &stm32_lptim_trigger_ops; in stm32_lptim_setup_trig() 67 iio_trigger_set_drvdata(trig, priv); in stm32_lptim_setup_trig() 69 return devm_iio_trigger_register(priv->dev, trig); in stm32_lptim_setup_trig()
|
H A D | iio-trig-sysfs.c | 17 struct iio_trigger *trig; member 94 struct iio_sysfs_trig *trig = container_of(work, struct iio_sysfs_trig, in iio_sysfs_trigger_work() local 97 iio_trigger_poll(trig->trig); in iio_sysfs_trigger_work() 103 struct iio_trigger *trig = to_iio_trigger(dev); in iio_sysfs_trigger_poll() local 104 struct iio_sysfs_trig *sysfs_trig = iio_trigger_get_drvdata(trig); in iio_sysfs_trigger_poll() 149 t->trig = iio_trigger_alloc(&iio_sysfs_trig_dev, "sysfstrig%d", id); in iio_sysfs_trigger_probe() 150 if (!t->trig) { in iio_sysfs_trigger_probe() 155 t->trig->dev.groups = iio_sysfs_trigger_attr_groups; in iio_sysfs_trigger_probe() 156 iio_trigger_set_drvdata(t->trig, t); in iio_sysfs_trigger_probe() 160 ret = iio_trigger_register(t->trig); in iio_sysfs_trigger_probe() [all …]
|
H A D | iio-trig-loop.c | 44 struct iio_trigger *trig = data; in iio_loop_thread() local 49 iio_trigger_poll_nested(trig); in iio_loop_thread() 55 static int iio_loop_trigger_set_state(struct iio_trigger *trig, bool state) in iio_loop_trigger_set_state() argument 57 struct iio_loop_info *loop_trig = iio_trigger_get_drvdata(trig); in iio_loop_trigger_set_state() 61 trig, trig->name); in iio_loop_trigger_set_state() 63 dev_err(&trig->dev, in iio_loop_trigger_set_state()
|
/linux/drivers/leds/trigger/ |
H A D | ledtrig-cpu.c | 53 struct led_trigger_cpu *trig = this_cpu_ptr(&cpu_trig); in ledtrig_cpu() local 54 bool is_active = trig->is_active; in ledtrig_cpu() 76 if (is_active != trig->is_active) { in ledtrig_cpu() 81 trig->is_active = is_active; in ledtrig_cpu() 86 led_trigger_event(trig->_trig, in ledtrig_cpu() 150 struct led_trigger_cpu *trig = &per_cpu(cpu_trig, cpu); in ledtrig_cpu_init() local 155 snprintf(trig->name, MAX_NAME_LEN, "cpu%u", cpu); in ledtrig_cpu_init() 157 led_trigger_register_simple(trig->name, &trig->_trig); in ledtrig_cpu_init()
|
/linux/drivers/iio/imu/ |
H A D | adis_trigger.c | 18 static int adis_data_rdy_trigger_set_state(struct iio_trigger *trig, bool state) in adis_data_rdy_trigger_set_state() argument 20 struct adis *adis = iio_trigger_get_drvdata(trig); in adis_data_rdy_trigger_set_state() 74 adis->trig = devm_iio_trigger_alloc(&adis->spi->dev, "%s-dev%d", in devm_adis_probe_trigger() 77 if (!adis->trig) in devm_adis_probe_trigger() 80 adis->trig->ops = &adis_trigger_ops; in devm_adis_probe_trigger() 81 iio_trigger_set_drvdata(adis->trig, adis); in devm_adis_probe_trigger() 93 adis->trig); in devm_adis_probe_trigger() 99 adis->trig); in devm_adis_probe_trigger() 103 return devm_iio_trigger_register(&adis->spi->dev, adis->trig); in devm_adis_probe_trigger()
|
/linux/drivers/iio/common/hid-sensors/ |
H A D | hid-sensor-trigger.c | 206 static int hid_sensor_data_rdy_trigger_set_state(struct iio_trigger *trig, in hid_sensor_data_rdy_trigger_set_state() argument 209 return hid_sensor_power_state(iio_trigger_get_drvdata(trig), state); in hid_sensor_data_rdy_trigger_set_state() 236 struct iio_trigger *trig; in hid_sensor_setup_trigger() local 252 trig = iio_trigger_alloc(indio_dev->dev.parent, in hid_sensor_setup_trigger() 254 if (trig == NULL) { in hid_sensor_setup_trigger() 260 iio_trigger_set_drvdata(trig, attrb); in hid_sensor_setup_trigger() 261 trig->ops = &hid_sensor_trigger_ops; in hid_sensor_setup_trigger() 262 ret = iio_trigger_register(trig); in hid_sensor_setup_trigger() 268 attrb->trigger = trig; in hid_sensor_setup_trigger() 269 indio_dev->trig = iio_trigger_get(trig); in hid_sensor_setup_trigger() [all …]
|
/linux/drivers/iio/chemical/ |
H A D | ens160_core.c | 263 iio_trigger_notify_done(indio_dev->trig); in ens160_trigger_handler() 268 static int ens160_set_trigger_state(struct iio_trigger *trig, bool state) in ens160_set_trigger_state() argument 270 struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig); in ens160_set_trigger_state() 292 struct iio_trigger *trig; in ens160_setup_trigger() local 295 trig = devm_iio_trigger_alloc(dev, "%s-dev%d", indio_dev->name, in ens160_setup_trigger() 297 if (!trig) in ens160_setup_trigger() 301 trig->ops = &ens160_trigger_ops; in ens160_setup_trigger() 302 iio_trigger_set_drvdata(trig, indio_dev); in ens160_setup_trigger() 304 ret = devm_iio_trigger_register(dev, trig); in ens160_setup_trigger() 308 indio_dev->trig = iio_trigger_get(trig); in ens160_setup_trigger() [all …]
|
/linux/drivers/net/wireless/intel/iwlwifi/ |
H A D | iwl-dbg-tlv.c | 253 const struct iwl_fw_ini_trigger_tlv *trig = (const void *)tlv->data; in iwl_dbg_tlv_alloc_trigger() local 254 u32 tp = le32_to_cpu(trig->time_point); in iwl_dbg_tlv_alloc_trigger() 255 u32 rf = le32_to_cpu(trig->reset_fw); in iwl_dbg_tlv_alloc_trigger() 258 if (le32_to_cpu(tlv->length) < sizeof(*trig)) in iwl_dbg_tlv_alloc_trigger() 278 if (!le32_to_cpu(trig->occurrences)) { in iwl_dbg_tlv_alloc_trigger() 954 .trig = (void *)timer_node->tlv->data, in iwl_dbg_tlv_periodic_trig_handler() 960 u32 occur = le32_to_cpu(dump_data.trig->occurrences); in iwl_dbg_tlv_periodic_trig_handler() 961 u32 collect_interval = le32_to_cpu(dump_data.trig->data[0]); in iwl_dbg_tlv_periodic_trig_handler() 977 struct iwl_fw_ini_trigger_tlv *trig = (void *)node->tlv.data; in iwl_dbg_tlv_set_periodic_trigs() local 979 u32 occur = le32_to_cpu(trig->occurrences), collect_interval; in iwl_dbg_tlv_set_periodic_trigs() [all …]
|
/linux/drivers/iio/adc/ |
H A D | ad7766.c | 42 struct iio_trigger *trig; member 80 iio_trigger_notify_done(indio_dev->trig); in ad7766_trigger_handler() 193 static int ad7766_set_trigger_state(struct iio_trigger *trig, bool enable) in ad7766_set_trigger_state() argument 195 struct ad7766 *ad7766 = iio_trigger_get_drvdata(trig); in ad7766_set_trigger_state() 249 ad7766->trig = devm_iio_trigger_alloc(&spi->dev, "%s-dev%d", in ad7766_probe() 252 if (!ad7766->trig) in ad7766_probe() 255 ad7766->trig->ops = &ad7766_trigger_ops; in ad7766_probe() 256 iio_trigger_set_drvdata(ad7766->trig, ad7766); in ad7766_probe() 266 ad7766->trig); in ad7766_probe() 270 ret = devm_iio_trigger_register(&spi->dev, ad7766->trig); in ad7766_probe()
|
/linux/Documentation/translations/zh_CN/iio/ |
H A D | iio_configfs.rst | 48 * drivers/iio/trigger/iio-trig-sample.c 74 .name = "trig-sample", 81 每种触发器类型在/config/iio/triggers下都有其自己的目录。加载iio-trig-sample 82 模块将创建“trig-sample”触发器类型目录/config/iio/triggers/trig-sample. 91 加载iio-trig-hrtimer模块将注册hrtimer触发器类型,从而允许用户在
|
/linux/drivers/iio/light/ |
H A D | acpi-als.c | 63 struct iio_trigger *trig; member 111 iio_trigger_poll_nested(als->trig); in acpi_als_notify() 180 iio_trigger_notify_done(indio_dev->trig); in acpi_als_trigger_handler() 207 als->trig = devm_iio_trigger_alloc(dev, "%s-dev%d", indio_dev->name, in acpi_als_add() 209 if (!als->trig) in acpi_als_add() 212 ret = devm_iio_trigger_register(dev, als->trig); in acpi_als_add() 219 indio_dev->trig = iio_trigger_get(als->trig); in acpi_als_add()
|