PCI: rockchip: Move PCIe WAKE# handling into pci core
Subsystems (9)
v9 cover PCI: rockchip: Move PCIe WAKE# handling into pci core
Currently we are handling wake irq in mrvl wifi driver. Move it into pci core.
Tested on my chromebook bob(with cros 4.4 kernel and mrvl wifi).
Changes in v9:
Add section for PCI devices and rewrite the commit message. Rewrite the commit message.
Fix check error in .cleanup().
Move dedicated wakeirq setup to setup() callback and use device_set_wakeup_enable() to enable/disable.
Changes in v8:
Add optional "pci", and rewrite commit message.
Rewrite the commit message.
Add pci-of.c and use platform_pm_ops to handle the PCIe WAKE# signal.
Changes in v7:
Move PCIE_WAKE handling into pci core.
Changes in v6:
Fix device_init_wake error handling, and add some comments.
Changes in v5:
Move to pci.txt
Use "wakeup" instead of "wake"
Rebase.
Changes in v3:
Fix error handling.
Changes in v2:
Use dev_pm_set_dedicated_wake_irq.
Jeffy Chen (7):
dt-bindings: PCI: Add definition of PCIe WAKE# irq and PCI irq of/irq: Adjust of_pci_irq parsing for multiple interrupts
mwifiex: Disable wakeup irq handling for pcie
arm64: dts: rockchip: Move PCIe WAKE# irq to pcie driver for Gru
PCI: Make pci_platform_pm_ops's callbacks optional PCI / PM: Move acpi wakeup code to pci core
PCI / PM: Add support for the PCIe WAKE# signal for OF
Documentation/devicetree/bindings/pci/pci.txt | 8 ++ arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 15 +-- drivers/net/wireless/marvell/mwifiex/main.c | 4 + drivers/of/of_pci_irq.c | 13 ++- drivers/pci/Makefile | 2 +- drivers/pci/pci-acpi.c | 121 ++++++++++++------------- drivers/pci/pci-driver.c | 9 ++ drivers/pci/pci-of.c | 126 ++++++++++++++++++++++++++ drivers/pci/pci.c | 112 +++++++++++++++++++---- drivers/pci/pci.h | 31 +++++-- drivers/pci/probe.c | 12 ++- drivers/pci/remove.c | 2 + include/linux/pci.h | 2 + 13 files changed, 360 insertions(+), 97 deletions(-) create mode 100644 drivers/pci/pci-of.c
Signature · 1 line
2.11.0
RFC PATCH v9 1/7 dt-bindings: PCI: Add definition of PCIe WAKE# irq and PCI irq
We are going to handle PCIe WAKE# pin for PCI bus bridges and PCI devices in the pci core, so add definitions of the optional PCIe WAKE# pin for PCI bus bridges and PCI devices.
Also add an definition of the optional PCI interrupt pin for PCI devices to distinguish it from the PCIe WAKE# pin.
---
Changes in v9:
Add section for PCI devices and rewrite the commit message.
Changes in v8:
Add optional "pci", and rewrite commit message.
Changes in v7: None
Changes in v6: None
Changes in v5:
Move to pci.txt
Changes in v3: None
Changes in v2: None
Documentation/devicetree/bindings/pci/pci.txt | 8 ++++++++ 1 file changed, 8 insertions(+)
Documentation/devicetree/bindings/pci/pci.txt +8 -0
@@ -24,3 +24,11 @@ driver implementation may support the following properties: unsupported link speed, for instance, trying to do training for unsupported link speed, etc. Must be '4' for gen4, '3' for gen3, '2' for gen2, and '1' for gen1. Any other values are invalid. +- interrupts: Interrupt specifier for each name in interrupt-names. +- interrupt-names: May contains "wakeup" for PCIe WAKE# interrupt. + +PCI devices have standardized Device Tree bindings: + +- interrupts: Interrupt specifier for each name in interrupt-names. +- interrupt-names: May contains "wakeup" for PCIe WAKE# interrupt and "pci" for + PCI interrupt.
Signature · 1 line
2.11.0
RFC PATCH v9 2/7 of/irq: Adjust of_pci_irq parsing for multiple interrupts
In reply to Jeffy ChenCurrently we are considering the first irq as the PCI interrupt pin, but a PCI device may have multiple interrupts(e.g. PCIe WAKE# pin).
Only parse the PCI interrupt pin when the irq is unnamed or named as "pci".
---
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v3: None
Changes in v2: None
drivers/of/of_pci_irq.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/of/of_pci_irq.c +12 -1
@@ -27,7 +27,18 @@ int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq*/ dn =pci_device_to_OF_node (pdev);if (dn) { - rc =of_irq_parse_one (dn,0 , out_irq); +struct property *prop; +const char *name; +int index =0 ; + + prop =of_find_property (dn,"interrupt-names" ,NULL ); +for (name =of_prop_next_string (prop,NULL ); name; + name =of_prop_next_string (prop, name), index++) { +if (!strcmp (name,"pci" )) +break ; + } + + rc =of_irq_parse_one (dn, index, out_irq);if (!rc)return rc; }
Signature · 1 line
2.11.0
RFC PATCH v9 3/7 mwifiex: Disable wakeup irq handling for pcie
In reply to Jeffy ChenWe are going to handle the wakeup irq in the pci core.
---
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v3: None
Changes in v2: None
drivers/net/wireless/marvell/mwifiex/main.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/wireless/marvell/mwifiex/main.c +4 -0
@@ -1568,6 +1568,10 @@ static void mwifiex_probe_of(struct mwifiex_adapter *adapter) goto err_exit; adapter->dt_node = dev->of_node; + +if (adapter->iface_type !=MWIFIEX_PCIE ) + goto err_exit; + adapter->irq_wakeup =irq_of_parse_and_map (adapter->dt_node,0 );if (!adapter->irq_wakeup) {dev_dbg (dev,"fail to parse irq_wakeup from device tree\n" );
Signature · 1 line
2.11.0
RFC PATCH v9 4/7 arm64: dts: rockchip: Move PCIe WAKE# irq to pcie driver for Gru
In reply to Jeffy ChenCurrently we are handling PCIe WAKE# irq in mrvl wifi driver.
Move it to rockchip pcie driver since we are going to handle it in the pci core.
Also avoid this irq been considered as the PCI interrupt pin in the of_irq_parse_pci().
---
Changes in v9:
Rewrite the commit message.
Changes in v8:
Rewrite the commit message.
Changes in v7: None
Changes in v6: None
Changes in v5:
Use "wakeup" instead of "wake"
Changes in v3: None
Changes in v2: None
arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi +9 -6
@@ -708,7 +708,15 @@ ap_i2c_audio: &i2c8 { ep-gpios = <&gpio2 27 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; - pinctrl-0 = <&pcie_clkreqn_cpm>, <&wifi_perst_l>; + pinctrl-0 = <&pcie_clkreqn_cpm>, <&wlan_host_wake_l>, <&wifi_perst_l>; + + interrupts-extended = <&gic GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH 0>, + <&gic GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH 0>, + <&gic GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH 0>, + <&gpio0 8 IRQ_TYPE_LEVEL_LOW>; + interrupt-names = "sys", "legacy", "client", "wakeup"; + /delete-property/ interrupts; + vpcie3v3-supply = <&pp3300_wifi_bt>; vpcie1v8-supply = <&wlan_pd_n>; /* HACK: see &wlan_pd_n */ vpcie0v9-supply = <&pp900_pcie>;
@@ -723,11 +731,6 @@ ap_i2c_audio: &i2c8 { compatible = "pci1b4b,2b42"; reg = <0x83010000 0x0 0x00000000 0x0 0x00100000 0x83010000 0x0 0x00100000 0x0 0x00100000>; - interrupt-parent = <&gpio0>; - interrupts = <8 IRQ_TYPE_LEVEL_LOW>; - pinctrl-names = "default"; - pinctrl-0 = <&wlan_host_wake_l>; - wakeup-source; }; }; };
Signature · 1 line
2.11.0
RFC PATCH v9 5/7 PCI: Make pci_platform_pm_ops's callbacks optional
In reply to Jeffy ChenAllow platforms not to provide some of the pci_platform_pm_ops's callbacks.
Also change the return value from -ENOSYS to -ENODEV for:
warning: drivers/pci/pci.c,594: ENOSYS means 'invalid syscall nr' and nothing else
---
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v3: None
Changes in v2: None
drivers/pci/pci.c | 38 +++++++++++++++++++++++++------------- drivers/pci/pci.h | 5 +---- 2 files changed, 26 insertions(+), 17 deletions(-)
drivers/pci/pci.c +25 -13
@@ -572,46 +572,58 @@ static void pci_restore_bars(struct pci_dev *dev)static const struct pci_platform_pm_ops *pci_platform_pm; -int pci_set_platform_pm (const struct pci_platform_pm_ops *ops) +void pci_set_platform_pm (const struct pci_platform_pm_ops *ops) { -if (!ops->is_manageable || !ops->set_state || !ops->get_state || - !ops->choose_state || !ops->set_wakeup || !ops->need_resume) -return -EINVAL ; pci_platform_pm = ops; -return 0 ; }static inline bool platform_pci_power_manageable (struct pci_dev *dev) { -return pci_platform_pm ? pci_platform_pm->is_manageable (dev) : false; +if (pci_platform_pm && pci_platform_pm->is_manageable) +return pci_platform_pm->is_manageable (dev); + +return false; }static inline int platform_pci_set_power_state (struct pci_dev *dev,pci_power_t t) { -return pci_platform_pm ? pci_platform_pm->set_state (dev, t) : -ENOSYS ; +if (pci_platform_pm && pci_platform_pm->set_state) +return pci_platform_pm->set_state (dev, t); + +return -ENODEV ; }static inline pci_power_t platform_pci_get_power_state (struct pci_dev *dev) { -return pci_platform_pm ? pci_platform_pm->get_state (dev) :PCI_UNKNOWN ; +if (pci_platform_pm && pci_platform_pm->get_state) +return pci_platform_pm->get_state (dev); + +return PCI_UNKNOWN ; }static inline pci_power_t platform_pci_choose_state (struct pci_dev *dev) { -return pci_platform_pm ? - pci_platform_pm->choose_state (dev) :PCI_POWER_ERROR ; +if (pci_platform_pm && pci_platform_pm->choose_state) +return pci_platform_pm->choose_state (dev); + +return PCI_POWER_ERROR ; }static inline int platform_pci_set_wakeup (struct pci_dev *dev,bool enable) { -return pci_platform_pm ? - pci_platform_pm->set_wakeup (dev, enable) : -ENODEV ; +if (pci_platform_pm && pci_platform_pm->set_wakeup) +return pci_platform_pm->set_wakeup (dev, enable); + +return -ENODEV ; }static inline bool platform_pci_need_resume (struct pci_dev *dev) { -return pci_platform_pm ? pci_platform_pm->need_resume (dev) : false; +if (pci_platform_pm && pci_platform_pm->need_resume) +return pci_platform_pm->need_resume (dev); + +return false; }/**
drivers/pci/pci.h +1 -4
@@ -52,9 +52,6 @@ int pci_probe_reset_function(struct pci_dev *dev);* @need_resume: returns 'true' if the given device (which is currently * suspended) needs to be resumed to be configured for system * wakeup. -* -* If given platform is generally capable of power managing PCI devices, all of -* these callbacks are mandatory. */ struct pci_platform_pm_ops {bool (*is_manageable)(struct pci_dev *dev);
@@ -65,7 +62,7 @@ struct pci_platform_pm_ops {bool (*need_resume)(struct pci_dev *dev); }; -int pci_set_platform_pm (const struct pci_platform_pm_ops *ops); +void pci_set_platform_pm (const struct pci_platform_pm_ops *ops);void pci_update_current_state (struct pci_dev *dev,pci_power_t state);void pci_power_up (struct pci_dev *dev);void pci_disable_enabled_device (struct pci_dev *dev);
Signature · 1 line
2.11.0
RFC PATCH v9 6/7 PCI / PM: Move acpi wakeup code to pci core
In reply to Jeffy ChenMove acpi wakeup code to pci core as pci_set_wakeup(), so that other platforms could reuse it.
Also add .setup_dev() / .setup_host_bridge() / .cleanup() platform pm ops's callbacks to setup and cleanup pci devices and host bridge for wakeup.
---
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v3: None
Changes in v2: None
drivers/pci/pci-acpi.c | 121 +++++++++++++++++++++++------------------------ drivers/pci/pci-driver.c | 9 ++++ drivers/pci/pci.c | 84 ++++++++++++++++++++++++++++---- drivers/pci/pci.h | 28 +++++++++-- drivers/pci/probe.c | 12 ++++- drivers/pci/remove.c | 2 + include/linux/pci.h | 2 + 7 files changed, 180 insertions(+), 78 deletions(-)
drivers/pci/pci-acpi.c +58 -63
@@ -569,31 +569,6 @@ static pci_power_t acpi_pci_get_power_state(struct pci_dev *dev)return state_conv[state]; } -static int acpi_pci_propagate_wakeup (struct pci_bus *bus,bool enable) -{ -while (bus->parent) { -if (acpi_pm_device_can_wakeup (&bus->self->dev)) -return acpi_pm_set_bridge_wakeup (&bus->self->dev, enable); - - bus = bus->parent; - } - -/* We have reached the root bus. */ -if (bus->bridge) { -if (acpi_pm_device_can_wakeup (bus->bridge)) -return acpi_pm_set_bridge_wakeup (bus->bridge, enable); - } -return 0 ; -} - -static int acpi_pci_wakeup (struct pci_dev *dev,bool enable) -{ -if (acpi_pm_device_can_wakeup (&dev->dev)) -return acpi_pm_set_device_wakeup (&dev->dev, enable); - -return acpi_pci_propagate_wakeup (dev->bus, enable); -} -static bool acpi_pci_need_resume (struct pci_dev *dev) {struct acpi_device *adev =ACPI_COMPANION (&dev->dev);
@@ -610,14 +585,29 @@ static bool acpi_pci_need_resume(struct pci_dev *dev)return !!adev->power.flags.dsw_present; } -static const struct pci_platform_pm_ops acpi_pci_platform_pm = { - .is_manageable = acpi_pci_power_manageable, - .set_state = acpi_pci_set_power_state, - .get_state = acpi_pci_get_power_state, - .choose_state = acpi_pci_choose_state, - .set_wakeup = acpi_pci_wakeup, - .need_resume = acpi_pci_need_resume, -}; +static bool acpi_pci_can_wakeup (void *pmdata) +{ +struct device *dev = pmdata; + +if (!dev) +return false; + +return acpi_pm_device_can_wakeup (dev); +} + +static int acpi_pci_dev_wakeup (void *pmdata,bool enable) +{ +struct device *dev = pmdata; + +return acpi_pm_set_device_wakeup (dev, enable); +} + +static int acpi_pci_bridge_wakeup (void *pmdata,bool enable) +{ +struct device *dev = pmdata; + +return acpi_pm_set_bridge_wakeup (dev, enable); +}void acpi_pci_add_bus (struct pci_bus *bus) {
@@ -658,20 +648,6 @@ void acpi_pci_remove_bus(struct pci_bus *bus)acpi_pci_slot_remove (bus); } -/* ACPI bus type */ -static struct acpi_device *acpi_pci_find_companion (struct device *dev) -{ -struct pci_dev *pci_dev =to_pci_dev (dev); -bool check_children; -u64 addr; - - check_children =pci_is_bridge (pci_dev); -/* Please ref to ACPI spec for the syntax of _ADR */ - addr = (PCI_SLOT (pci_dev->devfn) <<16 ) |PCI_FUNC (pci_dev->devfn); -return acpi_find_child_device (ACPI_COMPANION (dev->parent), addr, - check_children); -} -/** * pci_acpi_optimize_delay - optimize PCI D3 and D3cold delay from ACPI * @pdev: the PCI device whose delay is to be updated
@@ -723,34 +699,55 @@ static void pci_acpi_optimize_delay(struct pci_dev *pdev,ACPI_FREE (obj); } -static void pci_acpi_setup (struct device *dev) +static void *acpi_pci_setup_dev (struct pci_dev *pci_dev) { -struct pci_dev *pci_dev =to_pci_dev (dev); -struct acpi_device *adev =ACPI_COMPANION (dev); +struct acpi_device *adev =ACPI_COMPANION (&pci_dev->dev);if (!adev) -return ; +return NULL ;pci_acpi_optimize_delay (pci_dev, adev->handle);pci_acpi_add_pm_notifier (adev, pci_dev);if (!adev->wakeup.flags.valid) -return ; +return NULL ; + +device_set_wakeup_capable (&pci_dev->dev, true); +acpi_pm_set_device_wakeup (&pci_dev->dev, false); -device_set_wakeup_capable (dev, true); -acpi_pci_wakeup (pci_dev, false); +return &pci_dev->dev; } -static void pci_acpi_cleanup (struct device *dev) +static void *acpi_pci_setup_host_bridge (struct pci_host_bridge *bridge) { -struct acpi_device *adev =ACPI_COMPANION (dev); +return &bridge->dev; +} -if (!adev) -return ; +static const struct pci_platform_pm_ops acpi_pci_platform_pm = { + .is_manageable = acpi_pci_power_manageable, + .set_state = acpi_pci_set_power_state, + .get_state = acpi_pci_get_power_state, + .choose_state = acpi_pci_choose_state, + .need_resume = acpi_pci_need_resume, + .setup_dev = acpi_pci_setup_dev, + .setup_host_bridge = acpi_pci_setup_host_bridge, + .can_wakeup = acpi_pci_can_wakeup, + .dev_wakeup = acpi_pci_dev_wakeup, + .bridge_wakeup = acpi_pci_bridge_wakeup, +}; + +/* ACPI bus type */ +static struct acpi_device *acpi_pci_find_companion (struct device *dev) +{ +struct pci_dev *pci_dev =to_pci_dev (dev); +bool check_children; +u64 addr; -pci_acpi_remove_pm_notifier (adev); -if (adev->wakeup.flags.valid) -device_set_wakeup_capable (dev, false); + check_children =pci_is_bridge (pci_dev); +/* Please ref to ACPI spec for the syntax of _ADR */ + addr = (PCI_SLOT (pci_dev->devfn) <<16 ) |PCI_FUNC (pci_dev->devfn); +return acpi_find_child_device (ACPI_COMPANION (dev->parent), addr, + check_children); }static bool pci_acpi_bus_match (struct device *dev)
@@ -762,8 +759,6 @@ static struct acpi_bus_type acpi_pci_bus = { .name = "PCI", .match = pci_acpi_bus_match, .find_companion = acpi_pci_find_companion, - .setup = pci_acpi_setup, - .cleanup = pci_acpi_cleanup, };
drivers/pci/pci-driver.c +9 -0
@@ -421,10 +421,17 @@ static int pci_device_probe(struct device *dev)if (error <0 )return error; + pci_dev->pmdata =platform_pci_setup_dev (pci_dev); +if (IS_ERR (pci_dev->pmdata)) { +pcibios_free_irq (pci_dev); +return PTR_ERR (pci_dev->pmdata); + } +pci_dev_get (pci_dev);if (pci_device_can_probe (pci_dev)) { error =__pci_device_probe (drv, pci_dev);if (error) { +platform_pci_cleanup (pci_dev->pmdata);pcibios_free_irq (pci_dev);pci_dev_put (pci_dev); }
@@ -438,6 +445,8 @@ static int pci_device_remove(struct device *dev)struct pci_dev *pci_dev =to_pci_dev (dev);struct pci_driver *drv = pci_dev->driver; +platform_pci_cleanup (pci_dev->pmdata); +if (drv) {if (drv->remove) {pm_runtime_get_sync (dev);
drivers/pci/pci.c +74 -10
113 lines not on this page · raw message
drivers/pci/pci.h +25 -3
@@ -47,21 +47,43 @@ int pci_probe_reset_function(struct pci_dev *dev);* platform; to be used during system-wide transitions from a * sleeping state to the working state and vice versa * -* @set_wakeup: enables/disables wakeup capability for the device -* * @need_resume: returns 'true' if the given device (which is currently * suspended) needs to be resumed to be configured for system * wakeup. +* +* @setup_dev: setup device's wakeup ability, alloc and return device's private +* pm data. +* +* @setup_host_bridge: setup host bridge's wakeup ability, alloc and return host +* bridge's private pm data. +* +* @cleanup: cleanup the private pm data and deinit wakeup ability. +* +* @can_wakeup: returns 'true' if given device is capable of waking up the +* system from a sleeping state. +* +* @dev_wakeup: enables/disables wakeup capability for the device. +* +* @bridge_wakeup: enables/disables wakeup capability for the bridge. */ struct pci_platform_pm_ops {bool (*is_manageable)(struct pci_dev *dev);int (*set_state)(struct pci_dev *dev,pci_power_t state);pci_power_t (*get_state)(struct pci_dev *dev);pci_power_t (*choose_state)(struct pci_dev *dev); -int (*set_wakeup)(struct pci_dev *dev,bool enable);bool (*need_resume)(struct pci_dev *dev); +void *(*setup_dev)(struct pci_dev *dev); +void *(*setup_host_bridge)(struct pci_host_bridge *bridge); +void (*cleanup)(void *pmdata); +bool (*can_wakeup)(void *pmdata); +int (*dev_wakeup)(void *pmdata,bool enable); +int (*bridge_wakeup)(void *pmdata,bool enable); }; +void *platform_pci_setup_dev (struct pci_dev *dev); +void *platform_pci_setup_host_bridge (struct pci_host_bridge *bridge); +void platform_pci_cleanup (void *pmdata); +void pci_set_platform_pm (const struct pci_platform_pm_ops *ops);void pci_update_current_state (struct pci_dev *dev,pci_power_t state);void pci_power_up (struct pci_dev *dev);
drivers/pci/probe.c +10 -2
@@ -809,7 +809,13 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge) err =device_register (&bus->dev);if (err) - goto unregister; + goto unregister_bridge; + + bridge->pmdata =platform_pci_setup_host_bridge (bridge); +if (IS_ERR (bridge->pmdata)) { + err =PTR_ERR (bridge->pmdata); + goto unregister_bus; + }pcibios_add_bus (bus);
@@ -853,7 +859,9 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge)return 0 ; -unregister: +unregister_bus: +device_unregister (&bus->dev); +unregister_bridge:put_device (&bridge->dev);device_unregister (&bridge->dev);
drivers/pci/remove.c +2 -0
@@ -153,6 +153,8 @@ void pci_remove_root_bus(struct pci_bus *bus)if (!pci_is_root_bus (bus))return ; +platform_pci_cleanup (host_bridge->pmdata); + host_bridge =to_pci_host_bridge (bus->bridge);list_for_each_entry_safe (child, tmp, &bus->devices, bus_list)
include/linux/pci.h +2 -0
@@ -293,6 +293,7 @@ struct pci_dev {struct pci_bus *subordinate;/* bus this device bridges to */ void *sysdata;/* hook for sys-specific extension */ +void *pmdata;/* data for platform pm */ struct proc_dir_entry *procent;/* device entry in /proc/bus/pci */ struct pci_slot *slot;/* Physical slot this device is in */
@@ -467,6 +468,7 @@ struct pci_host_bridge {struct pci_bus *bus;/* root bus */ struct pci_ops *ops;void *sysdata; +void *pmdata;/* data for platform pm */ int busnr;struct list_head windows;/* resource_entry */ u8 (*swizzle_irq)(struct pci_dev *,u8 *);/* platform IRQ swizzler */
Signature · 1 line
2.11.0
RFC PATCH v9 7/7 PCI / PM: Add support for the PCIe WAKE# signal for OF
In reply to Jeffy ChenAdd pci-of.c to handle the PCIe WAKE# interrupt.
Also use the dedicated wakeirq infrastructure to simplify it.
---
Changes in v9:
Fix check error in .cleanup().
Move dedicated wakeirq setup to setup() callback and use device_set_wakeup_enable() to enable/disable.
Changes in v8:
Add pci-of.c and use platform_pm_ops to handle the PCIe WAKE# signal.
Changes in v7:
Move PCIE_WAKE handling into pci core.
Changes in v6:
Fix device_init_wake error handling, and add some comments.
Changes in v5:
Rebase.
Changes in v3:
Fix error handling.
Changes in v2:
Use dev_pm_set_dedicated_wake_irq.
drivers/pci/Makefile | 2 +- drivers/pci/pci-of.c | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 drivers/pci/pci-of.c
drivers/pci/Makefile +1 -1
@@ -49,7 +49,7 @@ obj-$(CONFIG_PCI_ECAM) += ecam.o obj-$(CONFIG_XEN_PCIDEV_FRONTEND) += xen-pcifront.o -obj-$(CONFIG_OF) += of.o +obj-$(CONFIG_OF) += of.o pci-of.o ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG
drivers/pci/pci-of.c new file +126 -0
126 lines not on this page · raw message
Signature · 1 line
2.11.0