• Dimitri Fedrau's avatar
    iio: temperature: mcp9600: add threshold events support · dea750f8
    Dimitri Fedrau authored
    The device has four programmable temperature alert outputs which can be
    used to monitor hot or cold-junction temperatures and detect falling and
    rising temperatures. It supports up to 255 degree celsius programmable
    hysteresis. Each alert can be individually configured by setting following
    options in the associated alert configuration register:
    - monitor hot or cold junction temperature
    - monitor rising or falling temperature
    - set comparator or interrupt mode
    - set output polarity
    - enable alert
    
    This patch binds alert outputs to iio events:
    - alert1: hot junction, rising temperature
    - alert2: hot junction, falling temperature
    - alert3: cold junction, rising temperature
    - alert4: cold junction, falling temperature
    
    All outputs are set in comparator mode and polarity depends on interrupt
    configuration.
    Signed-off-by: default avatarDimitri Fedrau <dima.fedrau@gmail.com>
    Link: https://lore.kernel.org/r/20240604133639.959682-1-dima.fedrau@gmail.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    dea750f8
mcp9600.c 12.9 KB