Lines Matching +full:hw +full:- +full:channels
1 // SPDX-License-Identifier: GPL-2.0-only
42 struct hts221_hw *hw = iio_priv(iio_dev); in hts221_trig_set_state() local
44 return regmap_update_bits(hw->regmap, HTS221_REG_DRDY_EN_ADDR, in hts221_trig_set_state()
55 struct hts221_hw *hw = private; in hts221_trigger_handler_thread() local
58 err = regmap_read(hw->regmap, HTS221_REG_STATUS_ADDR, &status); in hts221_trigger_handler_thread()
65 * Here we can assume data channels are both available if H_DA bit in hts221_trigger_handler_thread()
71 iio_trigger_poll_nested(hw->trig); in hts221_trigger_handler_thread()
78 struct hts221_hw *hw = iio_priv(iio_dev); in hts221_allocate_trigger() local
79 struct st_sensors_platform_data *pdata = dev_get_platdata(hw->dev); in hts221_allocate_trigger()
84 irq_type = irqd_get_trigger_type(irq_get_irq_data(hw->irq)); in hts221_allocate_trigger()
95 dev_info(hw->dev, in hts221_allocate_trigger()
102 err = regmap_update_bits(hw->regmap, HTS221_REG_DRDY_HL_ADDR, in hts221_allocate_trigger()
109 if (device_property_read_bool(hw->dev, "drive-open-drain") || in hts221_allocate_trigger()
110 (pdata && pdata->open_drain)) { in hts221_allocate_trigger()
115 err = regmap_update_bits(hw->regmap, HTS221_REG_DRDY_PP_OD_ADDR, in hts221_allocate_trigger()
122 err = devm_request_threaded_irq(hw->dev, hw->irq, NULL, in hts221_allocate_trigger()
125 hw->name, hw); in hts221_allocate_trigger()
127 dev_err(hw->dev, "failed to request trigger irq %d\n", in hts221_allocate_trigger()
128 hw->irq); in hts221_allocate_trigger()
132 hw->trig = devm_iio_trigger_alloc(hw->dev, "%s-trigger", in hts221_allocate_trigger()
133 iio_dev->name); in hts221_allocate_trigger()
134 if (!hw->trig) in hts221_allocate_trigger()
135 return -ENOMEM; in hts221_allocate_trigger()
137 iio_trigger_set_drvdata(hw->trig, iio_dev); in hts221_allocate_trigger()
138 hw->trig->ops = &hts221_trigger_ops; in hts221_allocate_trigger()
140 err = devm_iio_trigger_register(hw->dev, hw->trig); in hts221_allocate_trigger()
142 iio_dev->trig = iio_trigger_get(hw->trig); in hts221_allocate_trigger()
165 struct iio_dev *iio_dev = pf->indio_dev; in hts221_buffer_handler_thread()
166 struct hts221_hw *hw = iio_priv(iio_dev); in hts221_buffer_handler_thread() local
171 ch = &iio_dev->channels[HTS221_SENSOR_H]; in hts221_buffer_handler_thread()
172 err = regmap_bulk_read(hw->regmap, ch->address, in hts221_buffer_handler_thread()
173 &hw->scan.channels[0], in hts221_buffer_handler_thread()
174 sizeof(hw->scan.channels[0])); in hts221_buffer_handler_thread()
179 ch = &iio_dev->channels[HTS221_SENSOR_T]; in hts221_buffer_handler_thread()
180 err = regmap_bulk_read(hw->regmap, ch->address, in hts221_buffer_handler_thread()
181 &hw->scan.channels[1], in hts221_buffer_handler_thread()
182 sizeof(hw->scan.channels[1])); in hts221_buffer_handler_thread()
186 iio_push_to_buffers_with_timestamp(iio_dev, &hw->scan, in hts221_buffer_handler_thread()
190 iio_trigger_notify_done(hw->trig); in hts221_buffer_handler_thread()
197 struct hts221_hw *hw = iio_priv(iio_dev); in hts221_allocate_buffers() local
198 return devm_iio_triggered_buffer_setup(hw->dev, iio_dev, in hts221_allocate_buffers()