1*c66ec88fSEmmanuel VadotIntersil ISL12057 I2C RTC/Alarm chip 2*c66ec88fSEmmanuel Vadot 3*c66ec88fSEmmanuel VadotISL12057 is a trivial I2C device (it has simple device tree bindings, 4*c66ec88fSEmmanuel Vadotconsisting of a compatible field, an address and possibly an interrupt 5*c66ec88fSEmmanuel Vadotline). 6*c66ec88fSEmmanuel Vadot 7*c66ec88fSEmmanuel VadotNonetheless, it also supports an option boolean property 8*c66ec88fSEmmanuel Vadot("wakeup-source") to handle the specific use-case found 9*c66ec88fSEmmanuel Vadoton at least three in-tree users of the chip (NETGEAR ReadyNAS 102, 104 10*c66ec88fSEmmanuel Vadotand 2120 ARM-based NAS); On those devices, the IRQ#2 pin of the chip 11*c66ec88fSEmmanuel Vadot(associated with the alarm supported by the driver) is not connected 12*c66ec88fSEmmanuel Vadotto the SoC but to a PMIC. It allows the device to be powered up when 13*c66ec88fSEmmanuel VadotRTC alarm rings. In order to mark the device has a wakeup source and 14*c66ec88fSEmmanuel Vadotget access to the 'wakealarm' sysfs entry, this specific property can 15*c66ec88fSEmmanuel Vadotbe set when the IRQ#2 pin of the chip is not connected to the SoC but 16*c66ec88fSEmmanuel Vadotcan wake up the device. 17*c66ec88fSEmmanuel Vadot 18*c66ec88fSEmmanuel VadotRequired properties supported by the device: 19*c66ec88fSEmmanuel Vadot 20*c66ec88fSEmmanuel Vadot - "compatible": must be "isil,isl12057" 21*c66ec88fSEmmanuel Vadot - "reg": I2C bus address of the device 22*c66ec88fSEmmanuel Vadot 23*c66ec88fSEmmanuel VadotOptional properties: 24*c66ec88fSEmmanuel Vadot 25*c66ec88fSEmmanuel Vadot - "wakeup-source": mark the chip as a wakeup source, independently of 26*c66ec88fSEmmanuel Vadot the availability of an IRQ line connected to the SoC. 27*c66ec88fSEmmanuel Vadot 28*c66ec88fSEmmanuel Vadot 29*c66ec88fSEmmanuel VadotExample isl12057 node without IRQ#2 pin connected (no alarm support): 30*c66ec88fSEmmanuel Vadot 31*c66ec88fSEmmanuel Vadot isl12057: isl12057@68 { 32*c66ec88fSEmmanuel Vadot compatible = "isil,isl12057"; 33*c66ec88fSEmmanuel Vadot reg = <0x68>; 34*c66ec88fSEmmanuel Vadot }; 35*c66ec88fSEmmanuel Vadot 36*c66ec88fSEmmanuel Vadot 37*c66ec88fSEmmanuel VadotExample isl12057 node with IRQ#2 pin connected to main SoC via MPP6 (note 38*c66ec88fSEmmanuel Vadotthat the pinctrl-related properties below are given for completeness and 39*c66ec88fSEmmanuel Vadotmay not be required or may be different depending on your system or 40*c66ec88fSEmmanuel VadotSoC, and the main function of the MPP used as IRQ line, i.e. 41*c66ec88fSEmmanuel Vadot"interrupt-parent" and "interrupts" are usually sufficient): 42*c66ec88fSEmmanuel Vadot 43*c66ec88fSEmmanuel Vadot pinctrl { 44*c66ec88fSEmmanuel Vadot ... 45*c66ec88fSEmmanuel Vadot 46*c66ec88fSEmmanuel Vadot rtc_alarm_pin: rtc_alarm_pin { 47*c66ec88fSEmmanuel Vadot marvell,pins = "mpp6"; 48*c66ec88fSEmmanuel Vadot marvell,function = "gpio"; 49*c66ec88fSEmmanuel Vadot }; 50*c66ec88fSEmmanuel Vadot 51*c66ec88fSEmmanuel Vadot ... 52*c66ec88fSEmmanuel Vadot 53*c66ec88fSEmmanuel Vadot }; 54*c66ec88fSEmmanuel Vadot 55*c66ec88fSEmmanuel Vadot ... 56*c66ec88fSEmmanuel Vadot 57*c66ec88fSEmmanuel Vadot isl12057: isl12057@68 { 58*c66ec88fSEmmanuel Vadot compatible = "isil,isl12057"; 59*c66ec88fSEmmanuel Vadot reg = <0x68>; 60*c66ec88fSEmmanuel Vadot pinctrl-0 = <&rtc_alarm_pin>; 61*c66ec88fSEmmanuel Vadot pinctrl-names = "default"; 62*c66ec88fSEmmanuel Vadot interrupt-parent = <&gpio0>; 63*c66ec88fSEmmanuel Vadot interrupts = <6 IRQ_TYPE_EDGE_FALLING>; 64*c66ec88fSEmmanuel Vadot }; 65*c66ec88fSEmmanuel Vadot 66*c66ec88fSEmmanuel Vadot 67*c66ec88fSEmmanuel VadotExample isl12057 node without IRQ#2 pin connected to the SoC but to a 68*c66ec88fSEmmanuel VadotPMIC, allowing the device to be started based on configured alarm: 69*c66ec88fSEmmanuel Vadot 70*c66ec88fSEmmanuel Vadot isl12057: isl12057@68 { 71*c66ec88fSEmmanuel Vadot compatible = "isil,isl12057"; 72*c66ec88fSEmmanuel Vadot reg = <0x68>; 73*c66ec88fSEmmanuel Vadot wakeup-source; 74*c66ec88fSEmmanuel Vadot }; 75