Re: [PATCH 3/3] i2c-ocores: add some device tree documentation

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

 



On Wed, Nov 24, 2010 at 05:26:22PM +0100, Jonas Bonn wrote:
> This puts some documentation for the device tree configuration at the head
> of the driver file.  Hopefully this can get moved to a common area for this
> type of documentation at a later date; unfortunately, there isn't really
> such a place in the kernel tree at this time.
> 
> Furthermore, the regstep and clock-frequency parameters are really bus
> parameters and should probably be passed to the driver in a better way.
> Consider that a TODO.
> 
> Signed-off-by: Jonas Bonn <jonas@xxxxxxxxxxxx>
> ---
>  drivers/i2c/busses/i2c-ocores.c |   35 +++++++++++++++++++++++++++++++++++
>  1 files changed, 35 insertions(+), 0 deletions(-)

Binding looks good, except for a comment on the compatible value
below, but it should be kept with the other bindings.  Please move
into a file in Documentation/powerpc/dts-bindings (and, yes, this
directory does need to be moved out of Documentation/powerpc), or
document it on the devicetree.org wiki.

g.

> 
> diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
> index dee0352..ef3bcb1 100644
> --- a/drivers/i2c/busses/i2c-ocores.c
> +++ b/drivers/i2c/busses/i2c-ocores.c
> @@ -9,6 +9,41 @@
>   * kind, whether express or implied.
>   */
>  
> +/*
> + * Device tree configuration:
> + *
> + * Required properties:
> + * - compatible      : "opencores,i2c-ocores"

I assume the i2c-ocore interface could end up changing in the future.
This compatible value should have some form of version embedded into
it.

> + * - reg             : bus address start and address range size of device
> + * - interrupts      : interrupt number
> + * - regstep         : size of device registers in bytes
> + * - clock-frequency : frequency of bus clock in Hz
> + * 
> + * Example:
> + *
> + *  i2c0: ocores@a0000000 {
> + *              compatible = "opencores,i2c-ocores";
> + *              reg = <0xa0000000 0x8>;
> + *              interrupts = <10>;
> + *
> + *              regstep = <1>;
> + *              clock-frequency = <20000000>;
> + *
> + * -- Devices connected on this I2C bus get
> + * -- defined here; address- and size-cells
> + * -- apply to these child devices
> + *
> + *              #address-cells = <1>;
> + *              #size-cells = <0>;
> + *
> + *              dummy@60 {
> + *                     compatible = "dummy";
> + *                     reg = <60>;
> + *              };
> + *  };
> + *
> + */
> +
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/init.h>
> -- 
> 1.7.1
> 
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss@xxxxxxxxxxxxxxxx
> https://lists.ozlabs.org/listinfo/devicetree-discuss
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux