From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Subject: Re: [PATCH] powerpc: i2c-mpc: make speed registers configurable via FDT Date: Thu, 31 Jul 2008 14:01:46 -0500 Message-ID: <48920C1A.7010605@freescale.com> References: <4889EFFE.2070201@grandegger.com> <4889FD1D.4010804@freescale.com> <20080727012722.GH12191@secretlab.ca> <4891A744.6060005@grandegger.com> <9e4733910807310849g7e5612dbk9536733e061af8ad@mail.gmail.com> <4891F4D8.9090905@grandegger.com> <4891FC3A.7040609@freescale.com> <20080731180959.GA29057@secretlab.ca> <489200B6.9060906@freescale.com> <20080731182810.GB29097@secretlab.ca> <48920607.5040606@freescale.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <48920607.5040606-KZfg59tc24xl57MIdRCFDg@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: i2c-bounces-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org Errors-To: i2c-bounces-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org To: Timur Tabi Cc: Grant Likely , Linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org, Wolfgang Grandegger , Linux I2C List-Id: linux-i2c@vger.kernel.org Timur Tabi wrote: > Grant Likely wrote: > >> No it doesn't, it depends on the register interface to decide >> compatibility. Clock interface is part of that. > > I don't think so. The interface for programming the clock registers is > identical on all 8[356]xx parts. The only thing that matters is what specific > values to put in the FDR and DFSR registers to get a desired I2C bus speed. If it affects the values you need to write to the registers to achieve a given result, how is it not a difference in the register interface? > I propose the property "clock-frequency", like this: > > i2c@3000 { > #address-cells = <1>; > #size-cells = <0>; > cell-index = <0>; > compatible = "fsl-i2c"; > reg = <0x3000 0x100>; > interrupts = <14 0x8>; > interrupt-parent = <&ipic>; > dfsrr; > clock-frequency = <0xblablabla>; <-- added by U-Boot > }; A clock-frequency property is OK, and is in line with what we do in other types of nodes. However, in the long run it might be nice to introduce some sort of clock binding where, for example, the i2c node can point to a clock elsewhere in the device tree as an input clock. That way, less knowledge is required by the firmware to poke values all over the place, and it also allows one to describe situations where the frequency of the input clock can change (such as in low-power modes). -Scott _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c