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