diff mbox

[v2,1/3] i2c: hix5hd2: add devicetree documentation

Message ID 1411878129-19743-2-git-send-email-zhangfei.gao@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Zhangfei Gao Sept. 28, 2014, 4:22 a.m. UTC
From: Wei Yan <sledge.yanwei@huawei.com>

Signed-off-by: Wei Yan <sledge.yanwei@huawei.com>
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
---
 .../devicetree/bindings/i2c/i2c-hix5hd2.txt        |   31 ++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-hix5hd2.txt

Comments

Arnd Bergmann Sept. 30, 2014, 9:01 a.m. UTC | #1
On Sunday 28 September 2014 12:22:07 Zhangfei Gao wrote:
> +
> +Required properties:
> +- compatible: Must be "hisilicon,hix5hd2-i2c"
> +  Specifically, the following versions of the chipset are supported:
> +         Hi3716CV200 (support six I2C module)
> +         Hi3719CV100 (support six I2C module)
> +         Hi3718CV100 (support six I2C module)
> +         Hi3719MV100 (support two I2C module)
> +         Hi3718MV100 (support two I2C module)
> 

How do you detect the specific model? Is there a hardware register that
lets you know the type?
If you have a device specific "compatible" string, you should list all
the known strings.

	Arnd
Zhangfei Gao Sept. 30, 2014, 9:25 a.m. UTC | #2
On 09/30/2014 05:01 PM, Arnd Bergmann wrote:
> On Sunday 28 September 2014 12:22:07 Zhangfei Gao wrote:
>> +
>> +Required properties:
>> +- compatible: Must be "hisilicon,hix5hd2-i2c"
>> +  Specifically, the following versions of the chipset are supported:
>> +         Hi3716CV200 (support six I2C module)
>> +         Hi3719CV100 (support six I2C module)
>> +         Hi3718CV100 (support six I2C module)
>> +         Hi3719MV100 (support two I2C module)
>> +         Hi3718MV100 (support two I2C module)
>>
>
> How do you detect the specific model? Is there a hardware register that
> lets you know the type?
> If you have a device specific "compatible" string, you should list all
> the known strings.
>
In fact, no need to distinguish these hardware, the only difference is 
i2c module number.
The same compatible is used.
These info can be removed to remove the confusion.

Thanks
Arnd Bergmann Sept. 30, 2014, 10:24 a.m. UTC | #3
On Tuesday 30 September 2014 17:25:25 zhangfei wrote:
> On 09/30/2014 05:01 PM, Arnd Bergmann wrote:
> > On Sunday 28 September 2014 12:22:07 Zhangfei Gao wrote:
> >> +
> >> +Required properties:
> >> +- compatible: Must be "hisilicon,hix5hd2-i2c"
> >> +  Specifically, the following versions of the chipset are supported:
> >> +         Hi3716CV200 (support six I2C module)
> >> +         Hi3719CV100 (support six I2C module)
> >> +         Hi3718CV100 (support six I2C module)
> >> +         Hi3719MV100 (support two I2C module)
> >> +         Hi3718MV100 (support two I2C module)
> >>
> >
> > How do you detect the specific model? Is there a hardware register that
> > lets you know the type?
> > If you have a device specific "compatible" string, you should list all
> > the known strings.
> >
> In fact, no need to distinguish these hardware, the only difference is 
> i2c module number.
> The same compatible is used.

Ah, so you have multiple nodes in those cases, not just one node with
a variable number of I2C hosts. I was a bit confused by the
description

> These info can be removed to remove the confusion.

Yes, I think that would be better, both because it avoids the confusion,
and because it means you can use the driver for future machines without
having to update the binding each time.

	Arnd
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/i2c/i2c-hix5hd2.txt b/Documentation/devicetree/bindings/i2c/i2c-hix5hd2.txt
new file mode 100644
index 0000000..981a069
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-hix5hd2.txt
@@ -0,0 +1,31 @@ 
+I2C for Hisilicon hix5hd2 chipset platforms (3716,3719,3798...)
+
+Required properties:
+- compatible: Must be "hisilicon,hix5hd2-i2c"
+  Specifically, the following versions of the chipset are supported:
+	  Hi3716CV200 (support six I2C module)
+	  Hi3719CV100 (support six I2C module)
+	  Hi3718CV100 (support six I2C module)
+	  Hi3719MV100 (support two I2C module)
+	  Hi3718MV100 (support two I2C module)
+- reg: physical base address of the controller and length of memory mapped
+     region.
+- interrupts: interrupt number to the cpu.
+- #address-cells = <1>;
+- #size-cells = <0>;
+- clocks: phandles to input clocks.
+
+Optional properties:
+- clock-frequency: Desired I2C bus frequency in Hz, otherwise defaults to 100000
+- Child nodes conforming to i2c bus binding
+
+Examples:
+I2C0@f8b10000 {
+	compatible = "hisilicon,hix5hd2-i2c";
+	reg = <0xf8b10000 0x1000>;
+	interrupts = <0 38 4>;
+	clocks = <&clock HIX5HD2_I2C0_RST>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "disabled";
+}