From patchwork Wed Apr 2 10:20:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 14035745 X-Patchwork-Delegate: geert@linux-m68k.org Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B96C23496B; Wed, 2 Apr 2025 10:21:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743589287; cv=none; b=d/yezWzeIW6lx7QXN7AofDZ+ab1jSEFlSQSWBK8+3ounBBj3CUz0gGaSEbfdpEuNZk9Kaq5tl+q8vG5cSV7YtFP94IVrBIGQ6ZWFkomRvv29go/Slg4qwiJb6FYouPsfQlhay2uB84x4ipYdqVcVu1PgEqByCZZk/fZwrGugFK8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743589287; c=relaxed/simple; bh=+UZlOw47u+6+638D99dC1yO5TdFlW+yeBCc0XEkiBdc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZGYD27JSZ0MUQx7gMvGBF01YLrEuctCSSse+wd/1oCt0ONFBYh3+YgHwsNul4CqGoQW+PDP74iG2q1oE/PyJh+S0Nlq8nTB/yeGTw6TRkqlBGyXccosrj4Ph1c9nDbFTnNYx6YoHAThJM36GCse1WFNAdvX4Accl2uHfwLL206c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com; spf=pass smtp.mailfrom=bp.renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bp.renesas.com X-CSE-ConnectionGUID: 2TmkaY3lRaGdTLNrff+XVg== X-CSE-MsgGUID: +EmOoeQSRG2uhwQNC4zIeQ== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 02 Apr 2025 19:21:25 +0900 Received: from localhost.localdomain (unknown [10.226.93.220]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 330C5401C759; Wed, 2 Apr 2025 19:21:21 +0900 (JST) From: Biju Das To: Marc Kleine-Budde , Vincent Mailhol Cc: Biju Das , Wolfram Sang , Geert Uytterhoeven , =?utf-8?q?Uwe_Kleine-K=C3=B6n?= =?utf-8?q?ig?= , linux-can@vger.kernel.org, Prabhakar Mahadev Lad , Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v8 08/19] can: rcar_canfd: Update RCANFD_GAFLCFG macro Date: Wed, 2 Apr 2025 11:20:28 +0100 Message-ID: <20250402102047.27943-9-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250402102047.27943-1-biju.das.jz@bp.renesas.com> References: <20250402102047.27943-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Update RCANFD_GAFLCFG macro by replacing the parameter ch->w, where w is the GAFLCFG index used in the hardware manual. Signed-off-by: Biju Das --- v8: * New patch. --- drivers/net/can/rcar/rcar_canfd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c index 98532f4031b1..b2b87291dcf1 100644 --- a/drivers/net/can/rcar/rcar_canfd.c +++ b/drivers/net/can/rcar/rcar_canfd.c @@ -289,7 +289,7 @@ /* RSCFDnCFDGAFLECTR / RSCFDnGAFLECTR */ #define RCANFD_GAFLECTR (0x0098) /* RSCFDnCFDGAFLCFG / RSCFDnGAFLCFG */ -#define RCANFD_GAFLCFG(ch) (0x009c + (0x04 * ((ch) / 2))) +#define RCANFD_GAFLCFG(w) (0x009c + (0x04 * (w))) /* RSCFDnCFDRMNB / RSCFDnRMNB */ #define RCANFD_RMNB (0x00a4) /* RSCFDnCFDRMND / RSCFDnRMND */ @@ -677,8 +677,9 @@ static void rcar_canfd_setrnc(struct rcar_canfd_global *gpriv, unsigned int ch, { unsigned int shift = reg_gen4(gpriv, 16, 24) - (ch & 1) * reg_gen4(gpriv, 16, 8); u32 rnc = num_rules << shift; + unsigned int w = ch / 2; - rcar_canfd_set_bit(gpriv->base, RCANFD_GAFLCFG(ch), rnc); + rcar_canfd_set_bit(gpriv->base, RCANFD_GAFLCFG(w), rnc); } static void rcar_canfd_set_mode(struct rcar_canfd_global *gpriv)