All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerhard Uttenthaler <uttenthaler@ems-wuensche.com>
To: linux-can@vger.kernel.org, mkl@pengutronix.de
Cc: vincent.mailhol@gmail.com, wg@grandegger.com,
	Gerhard Uttenthaler <uttenthaler@ems-wuensche.com>
Subject: [PATCH v2 5/8] can: ems_pci: Initialize CAN controller base addresses
Date: Fri, 20 Jan 2023 12:26:13 +0100	[thread overview]
Message-ID: <20230120112616.6071-6-uttenthaler@ems-wuensche.com> (raw)
In-Reply-To: <20230120112616.6071-1-uttenthaler@ems-wuensche.com>

Add CAN controller base registers

Signed-off-by: Gerhard Uttenthaler <uttenthaler@ems-wuensche.com>
---
 drivers/net/can/sja1000/ems_pci.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/sja1000/ems_pci.c b/drivers/net/can/sja1000/ems_pci.c
index e9d2406d2338..1d7314ea42f3 100644
--- a/drivers/net/can/sja1000/ems_pci.c
+++ b/drivers/net/can/sja1000/ems_pci.c
@@ -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 */
-- 
2.35.3

--
EMS Dr. Thomas Wuensche e.K.
Sonnenhang 3
85304 Ilmmuenster
HR Ingolstadt, HRA 170106

Phone: +49-8441-490260
Fax  : +49-8441-81860
http://www.ems-wuensche.com

  parent reply	other threads:[~2023-01-20 11:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20 11:26 [PATCH v2 0/8] can: ems_pci: Add support for CPC-PCIe v3 Gerhard Uttenthaler
2023-01-20 11:26 ` [PATCH v2 1/8] can: ems_pci: Fix code style, copyright and email address Gerhard Uttenthaler
2023-01-20 11:26 ` [PATCH v2 2/8] can: ems_pci: Add Asix AX99100 definitions Gerhard Uttenthaler
2023-01-20 11:26 ` [PATCH v2 3/8] can: ems_pci: Initialize BAR registers Gerhard Uttenthaler
2023-01-20 11:26 ` [PATCH v2 4/8] can: ems_pci: Add read/write register and post irq functions Gerhard Uttenthaler
2023-01-20 11:26 ` Gerhard Uttenthaler [this message]
2023-01-20 11:26 ` [PATCH v2 6/8] can: ems_pci: Add IRQ enable Gerhard Uttenthaler
2023-01-20 11:26 ` [PATCH v2 7/8] can: ems_pci: Deassert hardware reset Gerhard Uttenthaler
2023-01-20 11:26 ` [PATCH v2 8/8] can: ems_pci: Add myself as module author Gerhard Uttenthaler
2023-07-20  9:29   ` Marc Kleine-Budde
2023-02-02 15:30 ` [PATCH v2 0/8] can: ems_pci: Add support for CPC-PCIe v3 Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230120112616.6071-6-uttenthaler@ems-wuensche.com \
    --to=uttenthaler@ems-wuensche.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=vincent.mailhol@gmail.com \
    --cc=wg@grandegger.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.