* rv8803: Implement event/tamper detection
@ 2022-05-24 18:22 embedded (VIVAVIS AG)
0 siblings, 0 replies; only message in thread
From: embedded (VIVAVIS AG) @ 2022-05-24 18:22 UTC (permalink / raw)
To: linux-rtc@vger.kernel.org
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-24 18:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-24 18:22 rv8803: Implement event/tamper detection embedded (VIVAVIS AG)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).