diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2013-08-27 13:11:10 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-08-27 14:50:13 -0400 |
commit | d2ab1fa68c61f01b28ab0859a972c892d81f5d32 (patch) | |
tree | 4e38144c01023a1ff640a3000fe1da94b60abae3 | |
parent | 808e34e2cd6bc74a2311b6a00d12a52e37fb50c0 (diff) |
PCI: Rename PCIe capability definitions to follow convention
All other PCIe capability register fields include "PCI_EXP" + <reg-name> +
<field-name>. This renames PCI_EXP_OBFF_MASK, PCI_EXP_IDO_REQ_EN,
PCI_EXP_LTR_EN, and related fields using the same convention.
No functional change.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com> # for MFD driver
-rw-r--r-- | drivers/mfd/rts5227.c | 2 | ||||
-rw-r--r-- | drivers/pci/pci.c | 31 | ||||
-rw-r--r-- | include/uapi/linux/pci_regs.h | 24 |
3 files changed, 30 insertions, 27 deletions
diff --git a/drivers/mfd/rts5227.c b/drivers/mfd/rts5227.c index fc831dcb1480..164b7faa70c9 100644 --- a/drivers/mfd/rts5227.c +++ b/drivers/mfd/rts5227.c | |||
@@ -44,7 +44,7 @@ static int rts5227_extra_init_hw(struct rtsx_pcr *pcr) | |||
44 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, OLT_LED_CTL, 0x0F, 0x02); | 44 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, OLT_LED_CTL, 0x0F, 0x02); |
45 | /* Configure LTR */ | 45 | /* Configure LTR */ |
46 | pcie_capability_read_word(pcr->pci, PCI_EXP_DEVCTL2, &cap); | 46 | pcie_capability_read_word(pcr->pci, PCI_EXP_DEVCTL2, &cap); |
47 | if (cap & PCI_EXP_LTR_EN) | 47 | if (cap & PCI_EXP_DEVCTL2_LTR_EN) |
48 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, LTR_CTL, 0xFF, 0xA3); | 48 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, LTR_CTL, 0xFF, 0xA3); |
49 | /* Configure OBFF */ | 49 | /* Configure OBFF */ |
50 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, OBFF_CFG, 0x03, 0x03); | 50 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, OBFF_CFG, 0x03, 0x03); |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 42e5f86e2387..3d5d45cdc4dd 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -2095,9 +2095,9 @@ void pci_enable_ido(struct pci_dev *dev, unsigned long type) | |||
2095 | u16 ctrl = 0; | 2095 | u16 ctrl = 0; |
2096 | 2096 | ||
2097 | if (type & PCI_EXP_IDO_REQUEST) | 2097 | if (type & PCI_EXP_IDO_REQUEST) |
2098 | ctrl |= PCI_EXP_IDO_REQ_EN; | 2098 | ctrl |= PCI_EXP_DEVCTL2_IDO_REQ_EN; |
2099 | if (type & PCI_EXP_IDO_COMPLETION) | 2099 | if (type & PCI_EXP_IDO_COMPLETION) |
2100 | ctrl |= PCI_EXP_IDO_CMP_EN; | 2100 | ctrl |= PCI_EXP_DEVCTL2_IDO_CMP_EN; |
2101 | if (ctrl) | 2101 | if (ctrl) |
2102 | pcie_capability_set_word(dev, PCI_EXP_DEVCTL2, ctrl); | 2102 | pcie_capability_set_word(dev, PCI_EXP_DEVCTL2, ctrl); |
2103 | } | 2103 | } |
@@ -2113,9 +2113,9 @@ void pci_disable_ido(struct pci_dev *dev, unsigned long type) | |||
2113 | u16 ctrl = 0; | 2113 | u16 ctrl = 0; |
2114 | 2114 | ||
2115 | if (type & PCI_EXP_IDO_REQUEST) | 2115 | if (type & PCI_EXP_IDO_REQUEST) |
2116 | ctrl |= PCI_EXP_IDO_REQ_EN; | 2116 | ctrl |= PCI_EXP_DEVCTL2_IDO_REQ_EN; |
2117 | if (type & PCI_EXP_IDO_COMPLETION) | 2117 | if (type & PCI_EXP_IDO_COMPLETION) |
2118 | ctrl |= PCI_EXP_IDO_CMP_EN; | 2118 | ctrl |= PCI_EXP_DEVCTL2_IDO_CMP_EN; |
2119 | if (ctrl) | 2119 | if (ctrl) |
2120 | pcie_capability_clear_word(dev, PCI_EXP_DEVCTL2, ctrl); | 2120 | pcie_capability_clear_word(dev, PCI_EXP_DEVCTL2, ctrl); |
2121 | } | 2121 | } |
@@ -2147,7 +2147,7 @@ int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type type) | |||
2147 | int ret; | 2147 | int ret; |
2148 | 2148 | ||
2149 | pcie_capability_read_dword(dev, PCI_EXP_DEVCAP2, &cap); | 2149 | pcie_capability_read_dword(dev, PCI_EXP_DEVCAP2, &cap); |
2150 | if (!(cap & PCI_EXP_OBFF_MASK)) | 2150 | if (!(cap & PCI_EXP_DEVCAP2_OBFF_MASK)) |
2151 | return -ENOTSUPP; /* no OBFF support at all */ | 2151 | return -ENOTSUPP; /* no OBFF support at all */ |
2152 | 2152 | ||
2153 | /* Make sure the topology supports OBFF as well */ | 2153 | /* Make sure the topology supports OBFF as well */ |
@@ -2158,17 +2158,17 @@ int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type type) | |||
2158 | } | 2158 | } |
2159 | 2159 | ||
2160 | pcie_capability_read_word(dev, PCI_EXP_DEVCTL2, &ctrl); | 2160 | pcie_capability_read_word(dev, PCI_EXP_DEVCTL2, &ctrl); |
2161 | if (cap & PCI_EXP_OBFF_WAKE) | 2161 | if (cap & PCI_EXP_DEVCAP2_OBFF_WAKE) |
2162 | ctrl |= PCI_EXP_OBFF_WAKE_EN; | 2162 | ctrl |= PCI_EXP_DEVCTL2_OBFF_WAKE_EN; |
2163 | else { | 2163 | else { |
2164 | switch (type) { | 2164 | switch (type) { |
2165 | case PCI_EXP_OBFF_SIGNAL_L0: | 2165 | case PCI_EXP_OBFF_SIGNAL_L0: |
2166 | if (!(ctrl & PCI_EXP_OBFF_WAKE_EN)) | 2166 | if (!(ctrl & PCI_EXP_DEVCTL2_OBFF_WAKE_EN)) |
2167 | ctrl |= PCI_EXP_OBFF_MSGA_EN; | 2167 | ctrl |= PCI_EXP_DEVCTL2_OBFF_MSGA_EN; |
2168 | break; | 2168 | break; |
2169 | case PCI_EXP_OBFF_SIGNAL_ALWAYS: | 2169 | case PCI_EXP_OBFF_SIGNAL_ALWAYS: |
2170 | ctrl &= ~PCI_EXP_OBFF_WAKE_EN; | 2170 | ctrl &= ~PCI_EXP_DEVCTL2_OBFF_WAKE_EN; |
2171 | ctrl |= PCI_EXP_OBFF_MSGB_EN; | 2171 | ctrl |= PCI_EXP_DEVCTL2_OBFF_MSGB_EN; |
2172 | break; | 2172 | break; |
2173 | default: | 2173 | default: |
2174 | WARN(1, "bad OBFF signal type\n"); | 2174 | WARN(1, "bad OBFF signal type\n"); |
@@ -2189,7 +2189,8 @@ EXPORT_SYMBOL(pci_enable_obff); | |||
2189 | */ | 2189 | */ |
2190 | void pci_disable_obff(struct pci_dev *dev) | 2190 | void pci_disable_obff(struct pci_dev *dev) |
2191 | { | 2191 | { |
2192 | pcie_capability_clear_word(dev, PCI_EXP_DEVCTL2, PCI_EXP_OBFF_WAKE_EN); | 2192 | pcie_capability_clear_word(dev, PCI_EXP_DEVCTL2, |
2193 | PCI_EXP_DEVCTL2_OBFF_WAKE_EN); | ||
2193 | } | 2194 | } |
2194 | EXPORT_SYMBOL(pci_disable_obff); | 2195 | EXPORT_SYMBOL(pci_disable_obff); |
2195 | 2196 | ||
@@ -2237,7 +2238,8 @@ int pci_enable_ltr(struct pci_dev *dev) | |||
2237 | return ret; | 2238 | return ret; |
2238 | } | 2239 | } |
2239 | 2240 | ||
2240 | return pcie_capability_set_word(dev, PCI_EXP_DEVCTL2, PCI_EXP_LTR_EN); | 2241 | return pcie_capability_set_word(dev, PCI_EXP_DEVCTL2, |
2242 | PCI_EXP_DEVCTL2_LTR_EN); | ||
2241 | } | 2243 | } |
2242 | EXPORT_SYMBOL(pci_enable_ltr); | 2244 | EXPORT_SYMBOL(pci_enable_ltr); |
2243 | 2245 | ||
@@ -2254,7 +2256,8 @@ void pci_disable_ltr(struct pci_dev *dev) | |||
2254 | if (!pci_ltr_supported(dev)) | 2256 | if (!pci_ltr_supported(dev)) |
2255 | return; | 2257 | return; |
2256 | 2258 | ||
2257 | pcie_capability_clear_word(dev, PCI_EXP_DEVCTL2, PCI_EXP_LTR_EN); | 2259 | pcie_capability_clear_word(dev, PCI_EXP_DEVCTL2, |
2260 | PCI_EXP_DEVCTL2_LTR_EN); | ||
2258 | } | 2261 | } |
2259 | EXPORT_SYMBOL(pci_disable_ltr); | 2262 | EXPORT_SYMBOL(pci_disable_ltr); |
2260 | 2263 | ||
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h index c3cc01d474b0..4b8f2e3bad58 100644 --- a/include/uapi/linux/pci_regs.h +++ b/include/uapi/linux/pci_regs.h | |||
@@ -550,19 +550,19 @@ | |||
550 | * to use these fields safely. | 550 | * to use these fields safely. |
551 | */ | 551 | */ |
552 | #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ | 552 | #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ |
553 | #define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ | 553 | #define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ |
554 | #define PCI_EXP_DEVCAP2_LTR 0x800 /* Latency tolerance reporting */ | 554 | #define PCI_EXP_DEVCAP2_LTR 0x800 /* Latency tolerance reporting */ |
555 | #define PCI_EXP_OBFF_MASK 0xc0000 /* OBFF support mechanism */ | 555 | #define PCI_EXP_DEVCAP2_OBFF_MASK 0xc0000 /* OBFF support mechanism */ |
556 | #define PCI_EXP_OBFF_MSG 0x40000 /* New message signaling */ | 556 | #define PCI_EXP_DEVCAP2_OBFF_MSG 0x40000 /* New message signaling */ |
557 | #define PCI_EXP_OBFF_WAKE 0x80000 /* Re-use WAKE# for OBFF */ | 557 | #define PCI_EXP_DEVCAP2_OBFF_WAKE 0x80000 /* Re-use WAKE# for OBFF */ |
558 | #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ | 558 | #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ |
559 | #define PCI_EXP_DEVCTL2_ARI 0x20 /* Alternative Routing-ID */ | 559 | #define PCI_EXP_DEVCTL2_ARI 0x20 /* Alternative Routing-ID */ |
560 | #define PCI_EXP_IDO_REQ_EN 0x100 /* ID-based ordering request enable */ | 560 | #define PCI_EXP_DEVCTL2_IDO_REQ_EN 0x100 /* ID-based ordering request enable */ |
561 | #define PCI_EXP_IDO_CMP_EN 0x200 /* ID-based ordering completion enable */ | 561 | #define PCI_EXP_DEVCTL2_IDO_CMP_EN 0x200 /* ID-based ordering completion enable */ |
562 | #define PCI_EXP_LTR_EN 0x400 /* Latency tolerance reporting */ | 562 | #define PCI_EXP_DEVCTL2_LTR_EN 0x400 /* Latency tolerance reporting */ |
563 | #define PCI_EXP_OBFF_MSGA_EN 0x2000 /* OBFF enable with Message type A */ | 563 | #define PCI_EXP_DEVCTL2_OBFF_MSGA_EN 0x2000 /* OBFF enable with Message type A */ |
564 | #define PCI_EXP_OBFF_MSGB_EN 0x4000 /* OBFF enable with Message type B */ | 564 | #define PCI_EXP_DEVCTL2_OBFF_MSGB_EN 0x4000 /* OBFF enable with Message type B */ |
565 | #define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */ | 565 | #define PCI_EXP_DEVCTL2_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */ |
566 | #define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints end here */ | 566 | #define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints end here */ |
567 | #define PCI_EXP_LNKCAP2 44 /* Link Capability 2 */ | 567 | #define PCI_EXP_LNKCAP2 44 /* Link Capability 2 */ |
568 | #define PCI_EXP_LNKCAP2_SLS_2_5GB 0x02 /* Supported Link Speed 2.5GT/s */ | 568 | #define PCI_EXP_LNKCAP2_SLS_2_5GB 0x02 /* Supported Link Speed 2.5GT/s */ |