Re: [PATCH 4/4] rtc: isl1208: add support for isl1219 with hwmon for tamper detection

From: Denis OSTERLAND
Date: Tue Jan 30 2018 - 04:06:34 EST


Am Montag, den 29.01.2018, 17:41 -0600 schrieb Rob Herring:
> On Tue, Jan 23, 2018 at 01:18:01PM +0100, Michael Grzeschik wrote:
> >
> > We add support for the ISL1219 chip that got an integrated tamper
> > detection function. This patch implements the feature by using an hwmon
> > interface.
> >
> > The ISL1219 can also describe the timestamp of the intrusion
> > event. For this we add the documentation of the new interface
> > intrusion[0-*]_timestamp.
> >
> > The devicetree documentation for the ISL1219 device tree
> > binding is added with an short example.
> >
> > Signed-off-by: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx>
> > Signed-off-by: Denis Osterland <Denis.Osterland@xxxxxxxxx>
> > ---
> > Â.../rtc/{intersil,isl1208.txt => isil,isl1208.txt} |ÂÂ18 +-
> > ÂDocumentation/hwmon/sysfs-interfaceÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ7 +
> > Âdrivers/rtc/rtc-isl1208.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 190 +++++++++++++++++++--
> > Â3 files changed, 201 insertions(+), 14 deletions(-)
> > Ârename Documentation/devicetree/bindings/rtc/{intersil,isl1208.txt => isil,isl1208.txt} (57%)
> >
> > diff --git a/Documentation/devicetree/bindings/rtc/intersil,isl1208.txt b/Documentation/devicetree/bindings/rtc/isil,isl1208.txt
> > similarity index 57%
> > rename from Documentation/devicetree/bindings/rtc/intersil,isl1208.txt
> > rename to Documentation/devicetree/bindings/rtc/isil,isl1208.txt
> > index a54e99feae1ca..d549699e1cfc4 100644
> > --- a/Documentation/devicetree/bindings/rtc/intersil,isl1208.txt
> > +++ b/Documentation/devicetree/bindings/rtc/isil,isl1208.txt
> > @@ -1,14 +1,21 @@
> > -Intersil ISL1208, ISL1218 I2C RTC/Alarm chip
> > +Intersil ISL1208, ISL1218, ISL1219 I2C RTC/Alarm chip
> > Â
> > ÂISL1208 is a trivial I2C device (it has simple device tree bindings,
> > Âconsisting of a compatible field, an address and possibly an interrupt
> > Âline).
> > Â
> > +ISL1219 supports tamper detection user space representation through
> > +case intrusion hwmon sensor.
> User space and hwmon are Linux details not relevant to the binding. JustÂ
> describe the h/w.
OK.
>
> >
> > +ISL1219 has additional pins EVIN and #EVDET for tamper detection.
> > +I2C devices support only one irq. #IRQ and #EVDET are open-drain active low,
> > +so it is possible layout them to one SoC pin with pull-up.
> > +
> > ÂRequired properties supported by the device:
> > Â
> > Â - "compatible": must be one of
> > Â "isil,isl1208"
> > Â "isil,isl1218"
> > + "isil,isl1219"
> > Â - "reg": I2C bus address of the device
> > Â
> > ÂOptional properties:
> > @@ -33,3 +40,12 @@ Example isl1208 node with #IRQ pin connected to SoC gpio1 pin 12:
> > Â interrupt-parent = <&gpio1>;
> > Â interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
> > Â };
> > +
> > +Example isl1219 node with #IRQ pin and #EVDET pin connected to SoC gpio1 pin 12:
> > +
> > + isl1219: isl1219@68 {
> > + compatible = "intersil,isl1219";
> > + reg = <0x68>;
> > + interrupts-extended = <&gpio1 12 IRQ_TYPE_EDGE_FALLING>;
> With 2 interrupts, you should have 2 values. If they are connectedÂ
> together, just repeat the connection. Otherwise, you can't tell if EVDETÂ
> is a no connect.
If I got you right, you suggest an additional IRQ entry to parse.
A short example, #IRQ pin connected to gpio1 pin 12 and
#EVDET pin connected to gpio2 pin 24:

isl1219: rtc@68Â{
compatible = "intersil,isl1219";
reg = <0x68>;
interrupt-names = "irq", "evdet";
interrupts-extended = <&gpio1 12 IRQ_TYPE_EDGE_FALLING>,
<&gpio2 24 IRQ_TYPE_EDGE_FALLING>;
};

In driver implementation we need only one interrupt, because we can
determinate action to take based on value of status register.
In current implementation there was no need to do some additional
OF parsing, everything is done by I2C generic code.
I guess, it is not much additional work to do so, but I am not sure
if itÂs worthwhile.
>
> There's not much point in having an example for every compatible. ThisÂ
> binding is simple enough, one should be enough.
Shell we remove the example without an interrupt?
>
> >
> > + };
> > +
Diehl AKO Stiftung & Co. KG, PfannerstraÃe 75-83, 88239 Wangen im AllgÃu
Bereichsvorstand: Dr.-Ing. Michael Siedentop (Sprecher), Josef Fellner (Mitglied)
Sitz der Gesellschaft: Wangen i.A. â Registergericht: Amtsgericht Ulm HRA 620609 â PersÃnlich haftende Gesellschafterin: Diehl Verwaltungs-Stiftung â Sitz: NÃrnberg â Registergericht: Amtsgericht NÃrnberg HRA 11756 â
Vorstand: Dr.-Ing. E.h. Thomas Diehl (â) (Vorsitzender), Herr Dipl.-Wirtsch.-Ing. Wolfgang Weggen (stellvertretender Vorsitzender), Dipl.-Kfm. Claus GÃnther, Dipl.-Kfm. Frank Gutzeit, Dr.-Ing. Heinrich Schunk, Dr.-Ing. Michael Siedentop , Dipl.-Kfm. Dr.-Ing. Martin Sommer, Dipl.-Ing. (FH) Rainer von Borstel, Vorsitzender des Aufsichtsrates: Dr. Klaus Maier
___________________________________________________________________________________________________
Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht. Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt.
The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited.