2008-01-01 00:18:15

by Miguel Botón

[permalink] [raw]
Subject: [PATCH 1/2] ssb: add 'ssb_pcihost_set_power_state' function

This patch adds the 'ssb_pcihost_set_power_state' function.

This function allows us to set the power state of a PCI device
(for example b44 ethernet device).=20

Signed-off-by: Miguel Bot=C3=B3n <[email protected]>

diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index a21ab29..aa70fd0 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -349,6 +349,13 @@ static inline void ssb_pcihost_unregister(struct p=
ci_driver *driver)
{
pci_unregister_driver(driver);
}
+
+static inline
+void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t =
state)
+{
+ if (sdev->bus->bustype =3D=3D SSB_BUSTYPE_PCI)
+ pci_set_power_state(sdev->bus->host_pci, state);
+}
#endif /* CONFIG_SSB_PCIHOST */
=20
=20

--=20
Miguel Bot=C3=B3n


2008-01-01 00:52:24

by Michael Büsch

[permalink] [raw]
Subject: Re: [PATCH 1/2] ssb: add 'ssb_pcihost_set_power_state' function

On Tuesday 01 January 2008 01:16:46 Miguel Bot=C3=B3n wrote:
> This patch adds the 'ssb_pcihost_set_power_state' function.
>=20
> This function allows us to set the power state of a PCI device
> (for example b44 ethernet device).=20
>=20
> Signed-off-by: Miguel Bot=C3=B3n <[email protected]>

Acked-by: Michael Buesch <[email protected]>

>=20
> diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
> index a21ab29..aa70fd0 100644
> --- a/include/linux/ssb/ssb.h
> +++ b/include/linux/ssb/ssb.h
> @@ -349,6 +349,13 @@ static inline void ssb_pcihost_unregister(struct=
pci_driver *driver)
> {
> pci_unregister_driver(driver);
> }
> +
> +static inline
> +void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_=
t state)
> +{
> + if (sdev->bus->bustype =3D=3D SSB_BUSTYPE_PCI)
> + pci_set_power_state(sdev->bus->host_pci, state);
> +}
> #endif /* CONFIG_SSB_PCIHOST */
> =20
> =20
>=20



--=20
Greetings Michael.