linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* newbie: phy platform interrupt config
@ 2012-01-24 14:37 Tim Sander
  2012-02-09  6:29 ` Andy Fleming
  0 siblings, 1 reply; 2+ messages in thread
From: Tim Sander @ 2012-01-24 14:37 UTC (permalink / raw)
  To: netdev
  Cc: Andy Fleming, David S. Miller, Richard Cochran,
	Greg Kroah-Hartman, Eric Dumazet, David Decotigny, linux-kernel

Hi

I would like to set the interrupt for the phy on the i.mx35 pcm43 in the file 
arch/arm/mach-imx/mach-pcm043.c. Unfortunatly i didn't find a way to specify 
it. So i want to set the field (struct phy_device*)->irq.

What i managed so far is to request the gpio for the interrupt:
#define IMX_PHY_IRQ IMX_GPIO_NR(2,7)
gpio_request(IMX_PHY_IRQ, "FEC PHY irq");
gpio_direction_input(IMX_PHY_IRQ);

Now i guess the result of "gpio_to_irq(IMX_PHY_IRQ)" should go into some kind 
of argument to imx35_add_fec(pdata) which is a macro 
imx_add_fec(&imx35_fec_data, pdata).
pdata is of type (?) struct fec_platform_data which contains phy_interface_t 
and unsigned char array. So i don't see a way to set the phy interrupt there.

I tried search for a driver which set the phy irq but i didn't find any and 
setting the phy in the phy_fixup function is also not working since the 
interrupt seems not get registered when opening the device.

So how do i set the phy interrupt line in the platform file?

Best regards
Tim

PS:
The cc list is from scripts/get_maintainer.pl -f drivers/net/phy/ which are 
hopefully the right maintainers plus Andy Fleming which commited the 
documentation for libphy.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: newbie: phy platform interrupt config
  2012-01-24 14:37 newbie: phy platform interrupt config Tim Sander
@ 2012-02-09  6:29 ` Andy Fleming
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Fleming @ 2012-02-09  6:29 UTC (permalink / raw)
  To: Tim Sander
  Cc: netdev, Andy Fleming, David S. Miller, Richard Cochran,
	Greg Kroah-Hartman, Eric Dumazet, David Decotigny, linux-kernel

On Tue, Jan 24, 2012 at 8:37 AM, Tim Sander <tim01@iss.tu-darmstadt.de> wrote:
> Hi
>
> I would like to set the interrupt for the phy on the i.mx35 pcm43 in the file
> arch/arm/mach-imx/mach-pcm043.c. Unfortunatly i didn't find a way to specify
> it. So i want to set the field (struct phy_device*)->irq.
>
> What i managed so far is to request the gpio for the interrupt:
> #define IMX_PHY_IRQ IMX_GPIO_NR(2,7)
> gpio_request(IMX_PHY_IRQ, "FEC PHY irq");
> gpio_direction_input(IMX_PHY_IRQ);
>
> Now i guess the result of "gpio_to_irq(IMX_PHY_IRQ)" should go into some kind
> of argument to imx35_add_fec(pdata) which is a macro
> imx_add_fec(&imx35_fec_data, pdata).
> pdata is of type (?) struct fec_platform_data which contains phy_interface_t
> and unsigned char array. So i don't see a way to set the phy interrupt there.
>
> I tried search for a driver which set the phy irq but i didn't find any and
> setting the phy in the phy_fixup function is also not working since the
> interrupt seems not get registered when opening the device.
>
> So how do i set the phy interrupt line in the platform file?

Look in drivers/of/of_mdio.c.

It's the job of the mdio driver to set the IRQs for the device. I
don't honestly know why I designed it that way. I suspect it's because
the MDIO controller's driver is the entity most likely to communicate
directly with the platform code.

So wherever you set up your mdio bus, set the IRQs for all the PHYs on
the bus there.

Andy

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-09  6:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-24 14:37 newbie: phy platform interrupt config Tim Sander
2012-02-09  6:29 ` Andy Fleming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).