Skip to content

Commit 018c49e

Browse files
oohalmpe
authored andcommitted
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 <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a839bd8 commit 018c49e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

drivers/pci/hotplug/pnv_php.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,21 @@ static int pnv_php_get_attention_state(struct hotplug_slot *slot, u8 *state)
419419
static int pnv_php_set_attention_state(struct hotplug_slot *slot, u8 state)
420420
{
421421
struct pnv_php_slot *php_slot = to_pnv_php_slot(slot);
422+
struct pci_dev *bridge = php_slot->pdev;
423+
u16 new, mask;
422424

423-
/* FIXME: Make it real once firmware supports it */
424425
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);
425437

426438
return 0;
427439
}

0 commit comments

Comments
 (0)