mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
Add bindings to obtain a PCI device's resource start address, bus/ device function, revision ID and subsystem device and vendor IDs. These will be used by the nova-core GPU driver which is currently in development. Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Cc: Danilo Krummrich <dakr@kernel.org> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Krzysztof Wilczyński <kwilczynski@kernel.org> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Alex Gaynor <alex.gaynor@gmail.com> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Gary Guo <gary@garyguo.net> Cc: Björn Roy Baron <bjorn3_gh@protonmail.com> Cc: Benno Lossin <lossin@kernel.org> Cc: Andreas Hindborg <a.hindborg@kernel.org> Cc: Alice Ryhl <aliceryhl@google.com> Cc: Trevor Gross <tmgross@umich.edu> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Rafael J. Wysocki <rafael@kernel.org> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Alexandre Courbot <acourbot@nvidia.com> Cc: linux-pci@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Alistair Popple <apopple@nvidia.com> Link: https://lore.kernel.org/r/20250730013417.640593-2-apopple@nvidia.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
32 lines
630 B
C
32 lines
630 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#include <linux/pci.h>
|
|
|
|
u16 rust_helper_pci_dev_id(struct pci_dev *dev)
|
|
{
|
|
return PCI_DEVID(dev->bus->number, dev->devfn);
|
|
}
|
|
|
|
resource_size_t rust_helper_pci_resource_start(struct pci_dev *pdev, int bar)
|
|
{
|
|
return pci_resource_start(pdev, bar);
|
|
}
|
|
|
|
resource_size_t rust_helper_pci_resource_len(struct pci_dev *pdev, int bar)
|
|
{
|
|
return pci_resource_len(pdev, bar);
|
|
}
|
|
|
|
bool rust_helper_dev_is_pci(const struct device *dev)
|
|
{
|
|
return dev_is_pci(dev);
|
|
}
|
|
|
|
#ifndef CONFIG_PCI_MSI
|
|
int rust_helper_pci_irq_vector(struct pci_dev *pdev, unsigned int nvec)
|
|
{
|
|
return pci_irq_vector(pdev, nvec);
|
|
}
|
|
|
|
#endif
|