On Sat, Oct 16, 2021 at 08:33:42PM -0500, David Lechner wrote:
This adds support for the Edge Capture Unit to the TI eQEP counter
driver. This just adds the minimum required features to measure speed
using the Unit Timer and the Edge Capture unit. Additional features can
be added in the future if needed.
This adds 4 new device-level attributes:
- edge_capture_unit_prescaler: selects a prescalar for the Counter count
coming into the Edge Capture Unit
- edge_capture_unit_max_period: selects the max time period that can be
measured by the Edge Capture Unit
What happens if a trigger occurs after the max period has elapsed; is
the latched period value invalid in that scenario?
- edge_capture_unit_latched_period: gets the period that was measured
when the event selected by the latch_mode attribute is triggered
Is this period value essentially the current latch count minus the
previous latch count?
static struct counter_comp ti_eqep_device_ext[] = {
+ COUNTER_COMP_DEVICE_BOOL("edge_capture_unit_enable",
+ ti_eqep_edge_capture_unit_enable_read,
+ ti_eqep_edge_capture_unit_enable_write),
+ COUNTER_COMP_DEVICE_U64("edge_capture_unit_latched_period",
+ ti_eqep_edge_capture_unit_latched_period_read,
+ NULL),
+ COUNTER_COMP_DEVICE_U64("edge_capture_unit_max_period",
+ ti_eqep_edge_capture_unit_max_period_read,
+ ti_eqep_edge_capture_unit_max_period_write),
+ COUNTER_COMP_DEVICE_ENUM("edge_capture_unit_prescaler",
+ ti_eqep_edge_capture_unit_prescaler_read,
+ ti_eqep_edge_capture_unit_prescaler_write,
+ ti_eqep_edge_capture_unit_prescaler_available),
Would it make sense for these to be Count 0 extensions so that they're
alongside the "latched_count" extension; or do these extensions also
represent values related to "latched_time" for the unit timer?