rv8803: Implement event/tamper detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear maintainer,

I'd like to contribute to the rv8803 driver by implementing event/tamper detection.

Micro Crystal's RV8803 as well as Epson's RX8803 provide an event input pin (EVI).
This pin can be used to provide a tamper detection, which even works in battery backup
mode, when the device is not mains powered.

This feature can be enabled/disabled by bit ECP (event capture enable) within the
capture/event control register of the RTC. The EHL (event high low) flag selects the
positive or negative edge on the monitored EVI pin. Additionally, debouncing the
event input signal can be achieved by setting ET[0:1] (event chattering removal).
All this features should be controlled by related devicetree settings.

If the external event detection feature is enabled and an event occurres, the EVF flag
is set to 1. At this time, the second and 1/100 seconds registers are internally copied
to the capture/buffer registers. But this information is useless, because it doesn't store
a meaningful timestamp like Unix epoch. Therefore, the EVF flag is of interest, only.

To reset the external event flag, 0 must be written to the EVF bit in the RTC's flag register.

My question is how to provide the event/tamper information and reset logic to the
userspace application? Sysfs or IOCTL?

Looking around, I've found that the pcf2127 driver is using the sysfs approach.
For my needs, this will be completely adequate.

It would be great, if you can give me some guidance how to implement the interface,
such that my contribution might have the chance going it's way mainline. And of course,
possibly I've overlooked a patch and somebody did it already before.

Regards,

Carsten Stelling





[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux