Re: Status variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Friday 29 January 2016 14:40:33 Ryan wrote:
> Hello Bergman,
> 
> Thanks for your help and time. Also I have seen that sometimes we use
> 
> i2c0: i2c@44e0b000 {
> 
> 
> }
> 
> and Sometimes
> 
> i2c@44e0b000
> 
> Why is that? What is the purpose of adding a i2c0: infront of the i2c
> entry. that too in the same file.

The "i2c0" is a label that can be used to reference the device as a
shortcut, so you don't have to write the entire path. If you
have a device with the full path "/soc/axi/ahb/i2c@44e0b000",
you can add the status="okay" propert by writing

/soc/axi/ahb/i2c@44e0b000 {
	status = "okay";
};

or you can do the shortcut and write

&i2c0 {
	status = "okay";
};

after you have defined the label. Some people prefer the latter
for brevity, others prefer an even more elaborate version by
always writing

/ {
	soc {
		axi {
			ahb {
				i2c0: i2c@44e0b000 {
					status = "okay";
				};
			};
		};
	};
};

which is the same thing as the above two again, but even duplicates
the label. I would recommend one of the first two approaches, and do
it consistently.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux