diff mbox

[v3,1/2] dt-bindings: add hym8563 binding

Message ID 201312012047.42669.heiko@sntech.de
State Superseded
Headers show

Commit Message

Heiko Stübner Dec. 1, 2013, 7:47 p.m. UTC
Add binding documentation for the hym8563 rtc chip.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 .../devicetree/bindings/rtc/haoyu,hym8563.txt      |   27 ++++++++++++++++++++
 .../devicetree/bindings/vendor-prefixes.txt        |    1 +
 2 files changed, 28 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/haoyu,hym8563.txt

Comments

Mark Brown Dec. 2, 2013, 1:41 p.m. UTC | #1
On Sun, Dec 01, 2013 at 08:47:42PM +0100, Heiko Stübner wrote:

> +Required properties:
> +- compatible: should be: "haoyu,hym8563"
> +- reg: i2c address
> +- gpios: alarm interrupt gpio

Why is this specified as a GPIO and not as an interrupt?
Heiko Stübner Dec. 7, 2013, 1:46 p.m. UTC | #2
Hi Mark,

Am Montag, 2. Dezember 2013, 14:41:10 schrieb Mark Brown:
> On Sun, Dec 01, 2013 at 08:47:42PM +0100, Heiko Stübner wrote:
> > +Required properties:
> > +- compatible: should be: "haoyu,hym8563"
> > +- reg: i2c address
> > +- gpios: alarm interrupt gpio
> 
> Why is this specified as a GPIO and not as an interrupt?

sorry for the late reply, but it seems I got somehow droppen from your 
recipient list, so just found this mail on the mailinglist.

In v1 I specified the interrupt and the gpio. Apart from the resulting 
duplication of information this also resulted in the gpio only being requested 
but never used itself, which Mark Rutland did not seem to like this much :-) .

As I'd like to keep the sanity check that really requesting the interrupt gpio 
provides I did go this way, as the interrupt pin of the chip is of course 
always provided thru a gpio. As there are other drivers going this route it 
looked like an ok way to go.


So what would be the real way to go? Specify only the interrupt, only the gpio 
or both?


Heiko
Mark Brown Dec. 9, 2013, 11:14 a.m. UTC | #3
On Sat, Dec 07, 2013 at 02:46:11PM +0100, Heiko Stübner wrote:
> Am Montag, 2. Dezember 2013, 14:41:10 schrieb Mark Brown:
> > On Sun, Dec 01, 2013 at 08:47:42PM +0100, Heiko Stübner wrote:

> > > +Required properties:
> > > +- compatible: should be: "haoyu,hym8563"
> > > +- reg: i2c address
> > > +- gpios: alarm interrupt gpio

> > Why is this specified as a GPIO and not as an interrupt?
> 
> sorry for the late reply, but it seems I got somehow droppen from your 
> recipient list, so just found this mail on the mailinglist.

Your mail had reply to set on it.

> In v1 I specified the interrupt and the gpio. Apart from the resulting 
> duplication of information this also resulted in the gpio only being requested 
> but never used itself, which Mark Rutland did not seem to like this much :-) .
> 
> As I'd like to keep the sanity check that really requesting the interrupt gpio 
> always provided thru a gpio. As there are other drivers going this route it 
> looked like an ok way to go.

> So what would be the real way to go? Specify only the interrupt, only the gpio 
> or both?

Specify only the interrupt if it's genuinely an interrupt - requiring a
GPIO is broken as not all interrupt controllers are also GPIOs.  There
are some OMAP drivers that are broken in this regard but they shouldn't
be doing that.  Only use a GPIO specifier if it's used as a GPIO.
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/rtc/haoyu,hym8563.txt b/Documentation/devicetree/bindings/rtc/haoyu,hym8563.txt
new file mode 100644
index 0000000..5ec0828
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/haoyu,hym8563.txt
@@ -0,0 +1,27 @@ 
+Haoyu Microelectronics HYM8563 Real Time Clock
+
+The HYM8563 provides basic rtc and alarm functionality
+as well as a clock output of up to 32kHz.
+
+Required properties:
+- compatible: should be: "haoyu,hym8563"
+- reg: i2c address
+- gpios: alarm interrupt gpio
+- #clock-cells: the value should be 0
+
+Example:
+
+hym8563: hym8563@51 {
+	compatible = "haoyu,hym8563";
+	reg = <0x51>;
+
+	gpios = <&gpio0 13 0>;
+
+	#clock-cells = <0>;
+};
+
+device {
+...
+	clocks = <&hym8563>;
+...
+};
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 2956800..3452270 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -28,6 +28,7 @@  est	ESTeem Wireless Modems
 fsl	Freescale Semiconductor
 GEFanuc	GE Fanuc Intelligent Platforms Embedded Systems, Inc.
 gef	GE Fanuc Intelligent Platforms Embedded Systems, Inc.
+haoyu	Haoyu Microelectronic Co. Ltd.
 hisilicon	Hisilicon Limited.
 hp	Hewlett Packard
 ibm	International Business Machines (IBM)