x86/platform/intel_mid_pci: Remove duplicate power off
Subsystems (3)
PATCH 1/2 x86/platform/intel_mid_pci: Remove duplicate power off
Intel MID platforms (Moorestown, Medfield, Clovertrail, Merrifield) are sharing the code in intel_mid_pci.c module. There is no need to power off specific Moorestown devices after commit 5823d0893ec2 ("x86/platform/intel-mid: Add Power Management Unit driver") because the condition in mrfld_power_off_dev() is true for any platform from the above list.
Remove duplicate power off certain devices on Intel Moorestown and rename functions to show that they are applied to any of Intel MID platforms.
--- arch/x86/pci/intel_mid_pci.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
arch/x86/pci/intel_mid_pci.c +4 -9
@@ -316,7 +316,7 @@ static void pci_d3delay_fixup(struct pci_dev *dev) }DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,PCI_ANY_ID , pci_d3delay_fixup); -static void mid_power_off_dev (struct pci_dev *dev) +static void mid_power_off_one_device (struct pci_dev *dev) {u16 pmcsr;
@@ -330,12 +330,7 @@ static void mid_power_off_dev(struct pci_dev *dev)pci_set_power_state (dev, PCI_D3hot); } -DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x0801 , mid_power_off_dev); -DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x0809 , mid_power_off_dev); -DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x080C , mid_power_off_dev); -DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x0815 , mid_power_off_dev); - -static void mrfld_power_off_dev (struct pci_dev *dev) +static void mid_power_off_devices (struct pci_dev *dev) {int id;
@@ -350,10 +345,10 @@ static void mrfld_power_off_dev(struct pci_dev *dev)* This sets only PMCSR bits. The actual power off will happen in * arch/x86/platform/intel-mid/pwr.c. */ -mid_power_off_dev (dev); +mid_power_off_one_device (dev); } -DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,PCI_ANY_ID , mrfld_power_off_dev); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,PCI_ANY_ID , mid_power_off_devices);/* * Langwell devices reside at fixed offsets, don't try to move them.
Signature · 1 line
2.8.1
PATCH 2/2 x86/platform/intel-mid: Extend PWRMU to support Penwell
Intel Penwell is one of the first SoCs in Intel MID series. It has slightly older version of PWRMU IP, though it is compatible with one found on Intel Tangier. Since we are not using (yet) any advanced stuff in the driver we may safely re-use what it's done for Intel Tangier for now.
Extend PWRMU driver to support Intel Penwell by adding PCI ID and re-using existing ->set_initial_state() function.
--- arch/x86/platform/intel-mid/pwr.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
arch/x86/platform/intel-mid/pwr.c +6 -4
@@ -75,6 +75,7 @@#define LSS_PWS_BITS 2/* power state width */ /* Supported device IDs */ +#define PCI_DEVICE_ID_PENWELL 0x0828#define PCI_DEVICE_ID_TANGIER 0x11a1struct mid_pwr_dev {
@@ -354,7 +355,7 @@ static int mid_pwr_probe(struct pci_dev *pdev, const struct pci_device_id *id)return 0 ; } -static int tng_set_initial_state (struct mid_pwr *pwr) +static int mid_set_initial_state (struct mid_pwr *pwr) {unsigned int i, j;int ret;
@@ -397,12 +398,13 @@ static int tng_set_initial_state(struct mid_pwr *pwr)return 0 ; } -static const struct mid_pwr_device_info tng_info = { - .set_initial_state = tng_set_initial_state, +static const struct mid_pwr_device_info mid_info = { + .set_initial_state = mid_set_initial_state, };static const struct pci_device_id mid_pwr_pci_ids[] = { - {PCI_VDEVICE (INTEL ,PCI_DEVICE_ID_TANGIER ), (kernel_ulong_t)&tng_info }, + {PCI_VDEVICE (INTEL ,PCI_DEVICE_ID_PENWELL ), (kernel_ulong_t)&mid_info }, + {PCI_VDEVICE (INTEL ,PCI_DEVICE_ID_TANGIER ), (kernel_ulong_t)&mid_info }, {} };MODULE_DEVICE_TABLE (pci, mid_pwr_pci_ids);
Signature · 1 line
2.8.1
tip-bot for Andy Shevchenko
merge bot[tip:x86/platform] x86/pci, x86/platform/intel_mid_pci: Remove duplicate power off code
In reply to Andy Shevchenkox86/pci, x86/platform/intel_mid_pci: Remove duplicate power off code
Commit-ID: e99a0745bdf8a5f7e3126a686846af4aeb852cc9 Gitweb: http://git.kernel.org/tip/e99a0745bdf8a5f7e3126a686846af4aeb852cc9 Author: Andy Shevchenko <[email protected]> AuthorDate: Tue, 5 Jul 2016 23:09:07 +0300 Committer: Ingo Molnar <[email protected]> CommitDate: Fri, 8 Jul 2016 11:00:05 +0200
x86/pci, x86/platform/intel_mid_pci: Remove duplicate power off code
Intel MID platforms (Moorestown, Medfield, Clovertrail, Merrifield) are sharing the code in the intel_mid_pci.c module. There is no need to power off specific Moorestown devices after the following commit:
5823d0893ec2 ("x86/platform/intel-mid: Add Power Management Unit driver")
... because the condition in mrfld_power_off_dev() is true for any platform from the above list.
Remove duplicate power off certain devices on Intel Moorestown and rename the affected functions to show that they are applied to any of Intel MID platforms.
--- arch/x86/pci/intel_mid_pci.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
arch/x86/pci/intel_mid_pci.c +4 -9
@@ -316,7 +316,7 @@ static void pci_d3delay_fixup(struct pci_dev *dev) }DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,PCI_ANY_ID , pci_d3delay_fixup); -static void mid_power_off_dev (struct pci_dev *dev) +static void mid_power_off_one_device (struct pci_dev *dev) {u16 pmcsr;
@@ -330,12 +330,7 @@ static void mid_power_off_dev(struct pci_dev *dev)pci_set_power_state (dev, PCI_D3hot); } -DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x0801 , mid_power_off_dev); -DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x0809 , mid_power_off_dev); -DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x080C , mid_power_off_dev); -DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x0815 , mid_power_off_dev); - -static void mrfld_power_off_dev (struct pci_dev *dev) +static void mid_power_off_devices (struct pci_dev *dev) {int id;
@@ -350,10 +345,10 @@ static void mrfld_power_off_dev(struct pci_dev *dev)* This sets only PMCSR bits. The actual power off will happen in * arch/x86/platform/intel-mid/pwr.c. */ -mid_power_off_dev (dev); +mid_power_off_one_device (dev); } -DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,PCI_ANY_ID , mrfld_power_off_dev); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,PCI_ANY_ID , mid_power_off_devices);/* * Langwell devices reside at fixed offsets, don't try to move them.
tip-bot for Andy Shevchenko
merge bot[tip:x86/platform] x86/platform/intel-mid: Extend PWRMU to support Penwell
In reply to Andy Shevchenkox86/platform/intel-mid: Extend PWRMU to support Penwell
Commit-ID: ca22312dc840065206285626829ceed8bb4df88c Gitweb: http://git.kernel.org/tip/ca22312dc840065206285626829ceed8bb4df88c Author: Andy Shevchenko <[email protected]> AuthorDate: Tue, 5 Jul 2016 23:09:08 +0300 Committer: Ingo Molnar <[email protected]> CommitDate: Fri, 8 Jul 2016 11:00:06 +0200
x86/platform/intel-mid: Extend PWRMU to support Penwell
Intel Penwell is one of the first SoCs in Intel MID series. It has slightly older version of PWRMU IP, though it is compatible with one found on Intel Tangier. Since we are not using (yet) any advanced stuff in the driver we may safely re-use what it's done for Intel Tangier for now.
Extend PWRMU driver to support Intel Penwell by adding PCI ID and re-using existing ->set_initial_state() function.
--- arch/x86/platform/intel-mid/pwr.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
arch/x86/platform/intel-mid/pwr.c +6 -4
@@ -75,6 +75,7 @@#define LSS_PWS_BITS 2/* power state width */ /* Supported device IDs */ +#define PCI_DEVICE_ID_PENWELL 0x0828#define PCI_DEVICE_ID_TANGIER 0x11a1struct mid_pwr_dev {
@@ -354,7 +355,7 @@ static int mid_pwr_probe(struct pci_dev *pdev, const struct pci_device_id *id)return 0 ; } -static int tng_set_initial_state (struct mid_pwr *pwr) +static int mid_set_initial_state (struct mid_pwr *pwr) {unsigned int i, j;int ret;
@@ -397,12 +398,13 @@ static int tng_set_initial_state(struct mid_pwr *pwr)return 0 ; } -static const struct mid_pwr_device_info tng_info = { - .set_initial_state = tng_set_initial_state, +static const struct mid_pwr_device_info mid_info = { + .set_initial_state = mid_set_initial_state, };static const struct pci_device_id mid_pwr_pci_ids[] = { - {PCI_VDEVICE (INTEL ,PCI_DEVICE_ID_TANGIER ), (kernel_ulong_t)&tng_info }, + {PCI_VDEVICE (INTEL ,PCI_DEVICE_ID_PENWELL ), (kernel_ulong_t)&mid_info }, + {PCI_VDEVICE (INTEL ,PCI_DEVICE_ID_TANGIER ), (kernel_ulong_t)&mid_info }, {} };MODULE_DEVICE_TABLE (pci, mid_pwr_pci_ids);