Skip to content

Commit

Permalink
pci-hotplug/pnv_php: Add attention indicator support
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Oliver O'Halloran authored and Michael Ellerman committed Sep 5, 2019
1 parent a839bd8 commit 018c49e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion drivers/pci/hotplug/pnv_php.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,21 @@ static int pnv_php_get_attention_state(struct hotplug_slot *slot, u8 *state)
static int pnv_php_set_attention_state(struct hotplug_slot *slot, u8 state)
{
struct pnv_php_slot *php_slot = to_pnv_php_slot(slot);
struct pci_dev *bridge = php_slot->pdev;
u16 new, mask;

/* FIXME: Make it real once firmware supports it */
php_slot->attention_state = state;
if (!bridge)
return 0;

mask = PCI_EXP_SLTCTL_AIC;

if (state)
new = PCI_EXP_SLTCTL_ATTN_IND_ON;
else
new = PCI_EXP_SLTCTL_ATTN_IND_OFF;

pcie_capability_clear_and_set_word(bridge, PCI_EXP_SLTCTL, mask, new);

return 0;
}
Expand Down

0 comments on commit 018c49e

Please sign in to comment.