Re: UCB1400: Passing IRQ through platform_data

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

 



Dne Po 22. března 2010 23:44:26 Graham Gower napsal(a):
> Marek Vasut wrote:
> > Dne Po 22. března 2010 07:03:29 Graham Gower napsal(a):
> >> Hi Marek,
> >> I wish to use the ucb1400_ts driver on my device. But I'm having trouble
> >> passing the platform_data to the ucb1400_core driver.
> >>
> >> I couldn't see any in tree examples of this being done and my attempts
> >> to do this via registering a platform_driver for ucb1400_core have
> >> failed (probably since this driver is ac97_bus_type, not a
> >> platform_driver).
> >>
> >> Can you provide me with info regarding the correct method for passing
> >> the irq to the driver?
> >>
> >> Thanks,
> >> -Graham
> >
> > static struct ucb1400_pdata pdata = {
> > 	.irq	= IRQ_GPIO(123),
> > };
> >
> > static struct platform_device ucb1400_core = {
> >         .name   = "ucb1400_core",
> >         .id     = -1,
> > 	.dev	= {
> > 		.platform_data = &pdata,
> > 	},
> > };
> >
> > init() {
> > 	platform_device_register(&ucb1400_core);
> > }
> >
> > Like this ?
> 
> That is the first thing I tried and it doesn't work. I suggest you printk
> the pdata in the ucb1400_core driver after having done this to confirm (I
>  got NULL). You don't need to register a platform driver for
>  ucb1400_core_probe() to be called anyway - presumably its enumerated from
>  the ac97 bus.

Oh yes you have to, otherwise the pdata won't be passed. Besides, it's weird 
probe()'s called if you didn't register it. But obviously whatever calls it 
doesn't pass the pdata.

And yes, I printk'd it when I was sending this patch in and it worked for me ... 
register the platform device and you should be ok.
> 
> > btw. you don't have to pass pdata at all ... the logic for auto-detecting
> > IRQ is still there and is active if no pdata are supplied.
> 
> This does not work for me. I have not yet investigated why.

I'd better get rid of that autodetection stuff altogether, but fttb it can be 
there.
> 
> -Graham
> 
> PS: I am on mips, not arm. Arm CC removed.
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux