Contributors: 10
Author |
Tokens |
Token Proportion |
Commits |
Commit Proportion |
Russell King |
129 |
61.43% |
4 |
28.57% |
Kumaravel Thiagarajan |
31 |
14.76% |
1 |
7.14% |
Alan Cox |
21 |
10.00% |
1 |
7.14% |
Andy Shevchenko |
12 |
5.71% |
1 |
7.14% |
Linus Torvalds |
5 |
2.38% |
1 |
7.14% |
Shawn Bohrer |
4 |
1.90% |
1 |
7.14% |
Greg Kroah-Hartman |
3 |
1.43% |
2 |
14.29% |
Aaron Sierra |
2 |
0.95% |
1 |
7.14% |
Alex Williamson |
2 |
0.95% |
1 |
7.14% |
Denis Efremov |
1 |
0.48% |
1 |
7.14% |
Total |
210 |
|
14 |
|
// SPDX-License-Identifier: GPL-2.0
/*
* 8250 PCI library.
*
* Copyright (C) 2001 Russell King, All Rights Reserved.
*/
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/types.h>
#include "8250.h"
#include "8250_pcilib.h"
int serial8250_pci_setup_port(struct pci_dev *dev, struct uart_8250_port *port,
u8 bar, unsigned int offset, int regshift)
{
if (bar >= PCI_STD_NUM_BARS)
return -EINVAL;
if (pci_resource_flags(dev, bar) & IORESOURCE_MEM) {
if (!pcim_iomap(dev, bar, 0) && !pcim_iomap_table(dev))
return -ENOMEM;
port->port.iotype = UPIO_MEM;
port->port.iobase = 0;
port->port.mapbase = pci_resource_start(dev, bar) + offset;
port->port.membase = pcim_iomap_table(dev)[bar] + offset;
port->port.regshift = regshift;
} else {
port->port.iotype = UPIO_PORT;
port->port.iobase = pci_resource_start(dev, bar) + offset;
port->port.mapbase = 0;
port->port.membase = NULL;
port->port.regshift = 0;
}
return 0;
}
EXPORT_SYMBOL_NS_GPL(serial8250_pci_setup_port, SERIAL_8250_PCI);
MODULE_LICENSE("GPL");