can: ems_pci: Initialize CAN controller base addresses

Add CAN controller base registers

Signed-off-by: Gerhard Uttenthaler <uttenthaler@ems-wuensche.com>
Link: https://lore.kernel.org/all/20230120112616.6071-6-uttenthaler@ems-wuensche.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
Gerhard Uttenthaler 2023-01-20 12:26:13 +01:00 committed by Marc Kleine-Budde
parent bb89159ce3
commit 79ca81e700
1 changed files with 7 additions and 2 deletions

View File

@ -342,20 +342,25 @@ static int ems_pci_add_card(struct pci_dev *pdev,
priv->irq_flags = IRQF_SHARED;
dev->irq = pdev->irq;
priv->reg_base = card->base_addr + EMS_PCI_CAN_BASE_OFFSET
+ (i * EMS_PCI_CAN_CTRL_SIZE);
if (card->version == 1) {
priv->read_reg = ems_pci_v1_read_reg;
priv->write_reg = ems_pci_v1_write_reg;
priv->post_irq = ems_pci_v1_post_irq;
priv->reg_base = card->base_addr + EMS_PCI_V1_CAN_BASE_OFFSET
+ (i * EMS_PCI_V1_CAN_CTRL_SIZE);
} else if (card->version == 2) {
priv->read_reg = ems_pci_v2_read_reg;
priv->write_reg = ems_pci_v2_write_reg;
priv->post_irq = ems_pci_v2_post_irq;
priv->reg_base = card->base_addr + EMS_PCI_V2_CAN_BASE_OFFSET
+ (i * EMS_PCI_V2_CAN_CTRL_SIZE);
} else {
priv->read_reg = ems_pci_v3_read_reg;
priv->write_reg = ems_pci_v3_write_reg;
priv->post_irq = ems_pci_v3_post_irq;
priv->reg_base = card->base_addr + EMS_PCI_V3_CAN_BASE_OFFSET
+ (i * EMS_PCI_V3_CAN_CTRL_SIZE);
}
/* Check if channel is present */