From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: linuxppc-dev@ozlabs.org, linux1394-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] firewire: fw-ohci: PPC PMac platform code
Date: Sat, 01 Mar 2008 13:59:52 +1100 [thread overview]
Message-ID: <1204340392.15052.455.camel@pasglop> (raw)
In-Reply-To: <tkrat.7e8e04e66a38dcd6@s5r6.in-berlin.de>
> +#ifdef CONFIG_PPC_PMAC
> + /* Necessary on some machines if fw-ohci was loaded/ unloaded before */
> + if (machine_is(powermac)) {
> + struct device_node *ofn = pci_device_to_OF_node(dev);
> +
> + if (ofn) {
> + pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, ofn, 0, 1);
> + pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 1);
> + }
> + }
> +#endif /* CONFIG_PPC_PMAC */
I -think- that the hunk above can be removed if you just call
pci_enable_device(). I have a hook in the arch pcibios_enable_device()
that detects the internal firewire and does the calls. Can you verify it
works ?
> +#ifdef CONFIG_PPC_PMAC
> + /* On UniNorth, power down the cable and turn off the chip clock
> + * to save power on laptops */
> + if (machine_is(powermac)) {
> + struct device_node* ofn = pci_device_to_OF_node(dev);
> +
> + if (ofn) {
> + pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 0);
> + pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, ofn, 0, 0);
> + }
> + }
> +#endif /* CONFIG_PPC_PMAC */
Unfortunately, I don't have the pending hook here for disable so you
need to keep that one for now.
> kfree(&ohci->card);
>
> fw_notify("Removed fw-ohci device.\n");
> @@ -2211,6 +2241,16 @@ static int pci_suspend(struct pci_dev *p
> if (err)
> fw_error("pci_set_power_state failed with %d\n", err);
>
> +/* PowerMac suspend code comes last */
> +#ifdef CONFIG_PPC_PMAC
> + if (machine_is(powermac)) {
> + struct device_node *ofn = pci_device_to_OF_node(pdev);
> +
> + if (ofn)
> + pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 0);
> + }
> +#endif /* CONFIG_PPC_PMAC */
I wonder why we don't do the cable power thingy here...
Cheers,
Ben.
WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: linux1394-devel@lists.sourceforge.net, linuxppc-dev@ozlabs.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] firewire: fw-ohci: PPC PMac platform code
Date: Sat, 01 Mar 2008 13:59:52 +1100 [thread overview]
Message-ID: <1204340392.15052.455.camel@pasglop> (raw)
In-Reply-To: <tkrat.7e8e04e66a38dcd6@s5r6.in-berlin.de>
> +#ifdef CONFIG_PPC_PMAC
> + /* Necessary on some machines if fw-ohci was loaded/ unloaded before */
> + if (machine_is(powermac)) {
> + struct device_node *ofn = pci_device_to_OF_node(dev);
> +
> + if (ofn) {
> + pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, ofn, 0, 1);
> + pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 1);
> + }
> + }
> +#endif /* CONFIG_PPC_PMAC */
I -think- that the hunk above can be removed if you just call
pci_enable_device(). I have a hook in the arch pcibios_enable_device()
that detects the internal firewire and does the calls. Can you verify it
works ?
> +#ifdef CONFIG_PPC_PMAC
> + /* On UniNorth, power down the cable and turn off the chip clock
> + * to save power on laptops */
> + if (machine_is(powermac)) {
> + struct device_node* ofn = pci_device_to_OF_node(dev);
> +
> + if (ofn) {
> + pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 0);
> + pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, ofn, 0, 0);
> + }
> + }
> +#endif /* CONFIG_PPC_PMAC */
Unfortunately, I don't have the pending hook here for disable so you
need to keep that one for now.
> kfree(&ohci->card);
>
> fw_notify("Removed fw-ohci device.\n");
> @@ -2211,6 +2241,16 @@ static int pci_suspend(struct pci_dev *p
> if (err)
> fw_error("pci_set_power_state failed with %d\n", err);
>
> +/* PowerMac suspend code comes last */
> +#ifdef CONFIG_PPC_PMAC
> + if (machine_is(powermac)) {
> + struct device_node *ofn = pci_device_to_OF_node(pdev);
> +
> + if (ofn)
> + pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 0);
> + }
> +#endif /* CONFIG_PPC_PMAC */
I wonder why we don't do the cable power thingy here...
Cheers,
Ben.
next prev parent reply other threads:[~2008-03-01 3:01 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-01 1:42 [PATCH 0/3] firewire: PPC PMac updates Stefan Richter
2008-03-01 1:42 ` [PATCH 1/3] firewire: fw-ohci: PPC PMac platform code Stefan Richter
2008-03-01 2:04 ` Stefan Richter
2008-03-01 2:59 ` Benjamin Herrenschmidt [this message]
2008-03-01 2:59 ` Benjamin Herrenschmidt
2008-03-01 8:06 ` Stefan Richter
2008-03-01 11:33 ` [PATCH 0/4] firewire, ieee1394: bus power lost after resume (PPC PMac) Stefan Richter
2008-03-01 11:34 ` [PATCH 1/4] firewire: fw-ohci: switch on bus power after resume on PPC PMac Stefan Richter
2008-03-01 11:34 ` Stefan Richter
2008-03-01 11:35 ` [PATCH 2/4] firewire: fw-ohci: refactor probe, remove, suspend, resume Stefan Richter
2008-03-01 11:35 ` Stefan Richter
2008-03-01 11:36 ` [PATCH 3/4] ieee1394: ohci1394: switch on bus power after resume on PPC PMac Stefan Richter
2008-03-01 11:36 ` Stefan Richter
2008-03-01 11:36 ` [PATCH 4/4] ieee1394: ohci1394: refactor probe, remove, suspend, resume Stefan Richter
2008-03-01 11:36 ` Stefan Richter
2008-03-01 19:43 ` [PATCH 1/3] firewire: fw-ohci: PPC PMac platform code Jarod Wilson
2008-03-01 19:43 ` Jarod Wilson
2008-03-01 23:48 ` Benjamin Herrenschmidt
2008-03-01 23:48 ` Benjamin Herrenschmidt
2008-03-01 1:47 ` [PATCH 2/3] firewire: fw-ohci: Apple UniNorth 1st generation support Stefan Richter
2008-03-01 1:50 ` [PATCH 3/3] firewire: fw-ohci: shut up false compiler warning on PPC32 Stefan Richter
2008-03-01 3:17 ` Stephen Rothwell
2008-03-01 3:17 ` Stephen Rothwell
2008-03-01 8:10 ` Stefan Richter
2008-03-01 11:21 ` [PATCH 3/3 update] " Stefan Richter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1204340392.15052.455.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
--cc=linuxppc-dev@ozlabs.org \
--cc=stefanr@s5r6.in-berlin.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.