On Saturday, 11 October 2014 17:50:10 UTC+1, Maxime Ripard wrote:
On Fri, Oct 10, 2014 at 08:48:53AM -0700, bruce bushby wrote: > > So I'm guessing it's those sort of addresses that should now come > > from DTS variables? ...are their specific "structures" that pass > > "DTS variables" to a driver? > > For the generic resources (clocks, addresses, interrupts, dma > channels, etc.), there is generic structures that are _not_ specific > to the DT. > > > The most excellent: > > > http://free-electrons.com/pub/conferences/2013/elce/petazzoni-device-tree-dummies/petazzoni-device-tree-dummies.pdf > > > > > Mentions the following on page 15: > > > > described by the clocks property > > I s->clk = clk_get(&pdev->dev, NULL); > > > > described by the interrupts property > > I s->irq = platform_get_irq(pdev, 0); > > > > Where are these functions defined? > > http://lxr.free-electrons.com/ident?i=clk_get > http://lxr.free-electrons.com/ident?i=platform_get_irq > > > Assuming there are some magic includes that all DTS enabled drivers > > must use? > > No. > > > Are there other functions to get spi or i2c addresses? > > The SPI and I2C addresses will be filled and passed to the drivers > through the spi_master / i2c_client structures. > > Maxime > > -- > Maxime Ripard, Free Electrons > Embedded Linux, Kernel and Android engineering > http://free-electrons.com > Thanks Maxime .....there really are no short cuts to understanding device drivers and dts :( I'm seeing a lot of references to: #include <linux/of.h> #include <linux/of_device.h> #include <linux/of_platform.h> http://lxr.free-electrons.com/source/include/linux/of.h#L47 struct device_node <http://lxr.free-electrons.com/ident?i=device_node> { 48 <http://lxr.free-electrons.com/source/include/linux/of.h#L48> const char *name <http://lxr.free-electrons.com/ident?i=name>; 49 <http://lxr.free-electrons.com/source/include/linux/of.h#L49> const char *type <http://lxr.free-electrons.com/ident?i=type>; 50 <http://lxr.free-electrons.com/source/include/linux/of.h#L50> phandle <http://lxr.free-electrons.com/ident?i=phandle> phandle <http://lxr.free-electrons.com/ident?i=phandle>; 51 <http://lxr.free-electrons.com/source/include/linux/of.h#L51> const char *full_name; 52 <http://lxr.free-electrons.com/source/include/linux/of.h#L52> 53 <http://lxr.free-electrons.com/source/include/linux/of.h#L53> struct property <http://lxr.free-electrons.com/ident?i=property> *properties <http://lxr.free-electrons.com/ident?i=properties>; 54 <http://lxr.free-electrons.com/source/include/linux/of.h#L54> struct property <http://lxr.free-electrons.com/ident?i=property> *deadprops; */* removed properties */* 55 <http://lxr.free-electrons.com/source/include/linux/of.h#L55> struct device_node <http://lxr.free-electrons.com/ident?i=device_node> *parent <http://lxr.free-electrons.com/ident?i=parent>; 56 <http://lxr.free-electrons.com/source/include/linux/of.h#L56> struct device_node <http://lxr.free-electrons.com/ident?i=device_node> *child <http://lxr.free-electrons.com/ident?i=child>; 57 <http://lxr.free-electrons.com/source/include/linux/of.h#L57> struct device_node <http://lxr.free-electrons.com/ident?i=device_node> *sibling; 58 <http://lxr.free-electrons.com/source/include/linux/of.h#L58> struct device_node <http://lxr.free-electrons.com/ident?i=device_node> *next <http://lxr.free-electrons.com/ident?i=next>; */* next device of same type */* 59 <http://lxr.free-electrons.com/source/include/linux/of.h#L59> struct device_node <http://lxr.free-electrons.com/ident?i=device_node> *allnext; */* next in list of all nodes */* 60 <http://lxr.free-electrons.com/source/include/linux/of.h#L60> struct kobject <http://lxr.free-electrons.com/ident?i=kobject> kobj <http://lxr.free-electrons.com/ident?i=kobj>; 61 <http://lxr.free-electrons.com/source/include/linux/of.h#L61> unsigned long _flags; 62 <http://lxr.free-electrons.com/source/include/linux/of.h#L62> void *data <http://lxr.free-electrons.com/ident?i=data>; 63 <http://lxr.free-electrons.com/source/include/linux/of.h#L63> #if defined(CONFIG_SPARC) 64 <http://lxr.free-electrons.com/source/include/linux/of.h#L64> const char *path_component_name; 65 <http://lxr.free-electrons.com/source/include/linux/of.h#L65> unsigned int unique_id; 66 <http://lxr.free-electrons.com/source/include/linux/of.h#L66> struct of_irq_controller <http://lxr.free-electrons.com/ident?i=of_irq_controller> *irq_trans <http://lxr.free-electrons.com/ident?i=irq_trans>; 67 <http://lxr.free-electrons.com/source/include/linux/of.h#L67> #endif 68 <http://lxr.free-electrons.com/source/include/linux/of.h#L68> }; Are these "of.." headers specific to device tree? Bruce -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
