Skip to content

Commit

Permalink
can: rcar_canfd: Add shared_global_irqs to struct rcar_canfd_hw_info
Browse files Browse the repository at this point in the history
RZ/G2L has separate IRQ lines for receive FIFO and global error interrupt
whereas R-Car has shared IRQ line.

Add shared_global_irqs to struct rcar_canfd_hw_info to select the driver to
choose between shared and separate irq registration for global
interrupts.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/all/20221027082158.95895-4-biju.das.jz@bp.renesas.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Biju Das authored and Marc Kleine-Budde committed Dec 10, 2022
1 parent 34f9e98 commit 841645c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/net/can/rcar/rcar_canfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,8 @@ struct rcar_canfd_global;
struct rcar_canfd_hw_info {
enum rcanfd_chip_id chip_id;
u8 max_channels;
/* hardware features */
unsigned shared_global_irqs:1; /* Has shared global irqs */
};

/* Channel priv data */
Expand Down Expand Up @@ -597,6 +599,7 @@ static const struct can_bittiming_const rcar_canfd_bittiming_const = {
static const struct rcar_canfd_hw_info rcar_gen3_hw_info = {
.chip_id = RENESAS_RCAR_GEN3,
.max_channels = 2,
.shared_global_irqs = 1,
};

static const struct rcar_canfd_hw_info rzg2l_hw_info = {
Expand All @@ -607,6 +610,7 @@ static const struct rcar_canfd_hw_info rzg2l_hw_info = {
static const struct rcar_canfd_hw_info r8a779a0_hw_info = {
.chip_id = RENESAS_R8A779A0,
.max_channels = 8,
.shared_global_irqs = 1,
};

/* Helper functions */
Expand Down Expand Up @@ -1863,7 +1867,7 @@ static int rcar_canfd_probe(struct platform_device *pdev)
of_node_put(of_child);
}

if (info->chip_id != RENESAS_RZG2L) {
if (info->shared_global_irqs) {
ch_irq = platform_get_irq_byname_optional(pdev, "ch_int");
if (ch_irq < 0) {
/* For backward compatibility get irq by index */
Expand Down Expand Up @@ -1946,7 +1950,7 @@ static int rcar_canfd_probe(struct platform_device *pdev)
gpriv->base = addr;

/* Request IRQ that's common for both channels */
if (info->chip_id != RENESAS_RZG2L) {
if (info->shared_global_irqs) {
err = devm_request_irq(&pdev->dev, ch_irq,
rcar_canfd_channel_interrupt, 0,
"canfd.ch_int", gpriv);
Expand Down

0 comments on commit 841645c

Please sign in to comment.