From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manjunatha GK Subject: Re: Converting i2c-omap driver to use device tree Date: Mon, 27 Jun 2011 00:21:27 +0530 Message-ID: References: <20110626081202.GB24241@ponder.secretlab.ca> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0082352406499356842==" Return-path: In-Reply-To: <20110626081202.GB24241-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: Grant Likely Cc: "devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org\"" List-Id: devicetree@vger.kernel.org --===============0082352406499356842== Content-Type: multipart/alternative; boundary=000e0cd215780e5e8a04a6a1ec68 --000e0cd215780e5e8a04a6a1ec68 Content-Type: text/plain; charset=ISO-8859-1 Hi Grant, On 26 June 2011 13:42, Grant Likely wrote: > On Fri, Jun 24, 2011 at 07:08:34PM +0530, Manjunatha GK wrote: > > Hi Thomas, > > > > On 24 June 2011 18:13, Thomas Abraham wrote: > > > > > Hi Manjunath, > > > > [...] > > > > > > > With the above changes, i was expecting probe function to be called > since > > > > device gets binded to driver. But probe will never get called. > > > > > > > > Did I miss anything with above procedure? > > > > > > What about platform_driver->driver.of_match_table? Is it populated > > > (set to omap_i2c_of_match)? > > > > > > > Yes. This entry was missing with my changes. With of_match_table, probe > is > > getting called. > > Thanks for the pointer. > > Glad to hear you got it sorted out. > Yes. Now I am able to get i2c base address from DT through device node structure but not able to get irq number from DT. The .dts entries are: + gic: intc@48241000 { + compatible = "arm,omap-gic", "arm,gic"; + interrupt-controller; + #interrupt-cells = <1>; + reg = <0x48241000 0x1000>; + }; + + i2c@48072000 { + interrupts = <88>; + interrupt-parent = <&gic>; + compatible = "ti,omap_i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x48072000 0x80>; + + twl@0x48 { + compatible = "ti,twl6030"; + reg = < 0x48 >; + }; + + }; >>From the debug log, it is observed that, the interrupts field will not exists in device_node data structure. It captures all the fields from the about i2c DT entries except interrupts field. [ 0.293182] of_irq_map_one: dev=/i2c@48072000, index=0 [ 0.293212] of_find_property; pp->name: compatible name: interrupts [ 0.293212] of_find_property; pp->name: reg name: interrupts [ 0.293243] of_find_property; pp->name: #address-cells name: interrupts [ 0.293243] of_find_property; pp->name: #size-cells name: interrupts [ 0.293273] of_find_property; pp->name: name name: interrupts [ 0.293304] omap_i2c_probe: i2c: dev->base: fa072000 [ 0.293304] omap_i2c_probe: i2c: dev->irq: ffffffff Any specific reason for missing entries in device node structures? Since you explored other ARM boards, is this interrupts field used and tested? -Manjunath --000e0cd215780e5e8a04a6a1ec68 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Grant,

On 26 June 2011 13:42, Grant Li= kely <gra= nt.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> wrote:
On Fri, Jun 24, 2011 at 07:08:34PM +0530,= Manjunatha GK wrote:
> Hi Thomas,
>
> On 24 June 2011 18:13, Thomas Abraham <thomas.abraham-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>
> > Hi Manjunath,
> >

[...]

> > >
> > > With the above changes, i was expecting probe function to be= called since
> > > device gets binded to driver. But probe will never get calle= d.
> > >
> > > Did I miss anything with above procedure?
> >
> > What about platform_driver->driver.of_match_table? Is it popul= ated
> > (set to omap_i2c_of_match)?
> >
>
> Yes. This entry was missing with my changes. With of_match_table, prob= e is
> getting called.
> Thanks for the pointer.

Glad to hear you got it sorted out.
=A0
Yes. Now I am able to get i2c base address from DT through device n= ode structure but not able to get irq number from DT. The .dts entries are:=

+=A0=A0=A0=A0=A0=A0 gic: intc@48241000 {
+=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 compatible =3D "arm,omap-gic", "arm,gic&q= uot;;
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 interrupt-controller;<= br>+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 #interrupt-cells =3D <1&g= t;;
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 reg =3D <0x48241000 0= x1000>;
+=A0=A0=A0=A0=A0=A0 };
+
+=A0=A0=A0=A0=A0=A0 i2c@48072000 {
+=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 interrupts =3D <88>;
+=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 interrupt-parent =3D <&gic&g= t;;
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 compatible =3D "ti,= omap_i2c";
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 #address-cel= ls =3D <1>;
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 #size-cells =3D <0>;
+= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 reg =3D <0x48072000 0x80>;=
+
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 twl@0x48 {
+=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 compatible =3D= "ti,twl6030";
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 reg =3D < 0x48 >;
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 };
+
+=A0=A0=A0=A0=A0=A0 = };

From the debug log, it is observed that, the interrupts field wil= l not exists in device_node data structure. It captures all the fields from= the about i2c DT entries except interrupts field.

[=A0=A0=A0 0.293182] of_irq_map_one: dev=3D/i2c@48072000, index=3D0
= [=A0=A0=A0 0.293212] of_find_property; pp->name: compatible=A0=A0=A0 nam= e: interrupts
[=A0=A0=A0 0.293212] of_find_property; pp->name: reg=A0= =A0 name: interrupts
[=A0=A0=A0 0.293243] of_find_property; pp->name:= #address-cells=A0=A0=A0=A0=A0=A0=A0 name: interrupts
[=A0=A0=A0 0.293243] of_find_property; pp->name: #size-cells=A0=A0 name:= interrupts
[=A0=A0=A0 0.293273] of_find_property; pp->name: name=A0 = name: interrupts
[=A0=A0=A0 0.293304] omap_i2c_probe: i2c: dev->base:= fa072000
[=A0=A0=A0 0.293304] omap_i2c_probe: i2c: dev->irq: fffffff= f

Any specific reason for missing entries in device node structures?
=
Since you explored other ARM boards, is this interrupts field used and = tested?

-Manjunath

--000e0cd215780e5e8a04a6a1ec68-- --===============0082352406499356842== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ devicetree-discuss mailing list devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org https://lists.ozlabs.org/listinfo/devicetree-discuss --===============0082352406499356842==--