162306a36Sopenharmony_ciIntersil ISL12057 I2C RTC/Alarm chip
262306a36Sopenharmony_ci
362306a36Sopenharmony_ciISL12057 is a trivial I2C device (it has simple device tree bindings,
462306a36Sopenharmony_ciconsisting of a compatible field, an address and possibly an interrupt
562306a36Sopenharmony_ciline).
662306a36Sopenharmony_ci
762306a36Sopenharmony_ciNonetheless, it also supports an option boolean property
862306a36Sopenharmony_ci("wakeup-source") to handle the specific use-case found
962306a36Sopenharmony_cion at least three in-tree users of the chip (NETGEAR ReadyNAS 102, 104
1062306a36Sopenharmony_ciand 2120 ARM-based NAS); On those devices, the IRQ#2 pin of the chip
1162306a36Sopenharmony_ci(associated with the alarm supported by the driver) is not connected
1262306a36Sopenharmony_cito the SoC but to a PMIC. It allows the device to be powered up when
1362306a36Sopenharmony_ciRTC alarm rings. In order to mark the device has a wakeup source and
1462306a36Sopenharmony_ciget access to the 'wakealarm' sysfs entry, this specific property can
1562306a36Sopenharmony_cibe set when the IRQ#2 pin of the chip is not connected to the SoC but
1662306a36Sopenharmony_cican wake up the device.
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ciRequired properties supported by the device:
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci - "compatible": must be "isil,isl12057"
2162306a36Sopenharmony_ci - "reg": I2C bus address of the device
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ciOptional properties:
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci - "wakeup-source": mark the chip as a wakeup source, independently of
2662306a36Sopenharmony_ci    the availability of an IRQ line connected to the SoC.
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ciExample isl12057 node without IRQ#2 pin connected (no alarm support):
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci	isl12057: isl12057@68 {
3262306a36Sopenharmony_ci		compatible = "isil,isl12057";
3362306a36Sopenharmony_ci		reg = <0x68>;
3462306a36Sopenharmony_ci	};
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ciExample isl12057 node with IRQ#2 pin connected to main SoC via MPP6 (note
3862306a36Sopenharmony_cithat the pinctrl-related properties below are given for completeness and
3962306a36Sopenharmony_cimay not be required or may be different depending on your system or
4062306a36Sopenharmony_ciSoC, and the main function of the MPP used as IRQ line, i.e.
4162306a36Sopenharmony_ci"interrupt-parent" and "interrupts" are usually sufficient):
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci		    pinctrl {
4462306a36Sopenharmony_ci				...
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci				rtc_alarm_pin: rtc_alarm_pin {
4762306a36Sopenharmony_ci					marvell,pins = "mpp6";
4862306a36Sopenharmony_ci					marvell,function = "gpio";
4962306a36Sopenharmony_ci				};
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci				...
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci		    };
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci	...
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci	isl12057: isl12057@68 {
5862306a36Sopenharmony_ci		compatible = "isil,isl12057";
5962306a36Sopenharmony_ci		reg = <0x68>;
6062306a36Sopenharmony_ci		pinctrl-0 = <&rtc_alarm_pin>;
6162306a36Sopenharmony_ci		pinctrl-names = "default";
6262306a36Sopenharmony_ci		interrupt-parent = <&gpio0>;
6362306a36Sopenharmony_ci		interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
6462306a36Sopenharmony_ci	};
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ciExample isl12057 node without IRQ#2 pin connected to the SoC but to a
6862306a36Sopenharmony_ciPMIC, allowing the device to be started based on configured alarm:
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ci	isl12057: isl12057@68 {
7162306a36Sopenharmony_ci		compatible = "isil,isl12057";
7262306a36Sopenharmony_ci		reg = <0x68>;
7362306a36Sopenharmony_ci		wakeup-source;
7462306a36Sopenharmony_ci	};
75