diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2019-09-03 06:16:01 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2019-09-05 00:22:39 -0400 |
commit | 018c49e999ac4680e59de236a4a8cde209e8cc98 (patch) | |
tree | a84ec67a601918e7486fb449078a2cec91cc3b2c /drivers/pci/hotplug | |
parent | a839bd87a250068521393ca3804f4a5274e103ff (diff) |
pci-hotplug/pnv_php: Add attention indicator support
pnv_php is generally used with PCIe bridges which provide a native
interface for setting the attention and power indicator LEDs. Wire up
those interfaces even if firmware does not have support for them (yet...)
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190903101605.2890-11-oohall@gmail.com
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r-- | drivers/pci/hotplug/pnv_php.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 6fdf8b74cb0a..d7b2b47bc33e 100644 --- a/drivers/pci/hotplug/pnv_php.c +++ b/drivers/pci/hotplug/pnv_php.c | |||
@@ -419,9 +419,21 @@ static int pnv_php_get_attention_state(struct hotplug_slot *slot, u8 *state) | |||
419 | static int pnv_php_set_attention_state(struct hotplug_slot *slot, u8 state) | 419 | static int pnv_php_set_attention_state(struct hotplug_slot *slot, u8 state) |
420 | { | 420 | { |
421 | struct pnv_php_slot *php_slot = to_pnv_php_slot(slot); | 421 | struct pnv_php_slot *php_slot = to_pnv_php_slot(slot); |
422 | struct pci_dev *bridge = php_slot->pdev; | ||
423 | u16 new, mask; | ||
422 | 424 | ||
423 | /* FIXME: Make it real once firmware supports it */ | ||
424 | php_slot->attention_state = state; | 425 | php_slot->attention_state = state; |
426 | if (!bridge) | ||
427 | return 0; | ||
428 | |||
429 | mask = PCI_EXP_SLTCTL_AIC; | ||
430 | |||
431 | if (state) | ||
432 | new = PCI_EXP_SLTCTL_ATTN_IND_ON; | ||
433 | else | ||
434 | new = PCI_EXP_SLTCTL_ATTN_IND_OFF; | ||
435 | |||
436 | pcie_capability_clear_and_set_word(bridge, PCI_EXP_SLTCTL, mask, new); | ||
425 | 437 | ||
426 | return 0; | 438 | return 0; |
427 | } | 439 | } |