* [PATCH v2] can: mcp251x: not correct register address
@ 2015-05-30 9:42 Tomas Krcka
2015-06-09 7:18 ` Marc Kleine-Budde
0 siblings, 1 reply; 2+ messages in thread
From: Tomas Krcka @ 2015-05-30 9:42 UTC (permalink / raw)
To: linux-can; +Cc: moorray3, mkl, himangi774, netdev
v2: fix of corrupted patch
This patch corrects addresses of acceptance filters.
These registers are not in use, but values should be correct.
Tested with MCP2515 and am3352 and also checked datasheets for MCP2515
and MCP2510.
Signed-off-by: Tomas Krcka <tomas.krcka@nkgroup.cz>
---
drivers/net/can/spi/mcp251x.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c
index bf63fee..c1a95a3 100644
--- a/drivers/net/can/spi/mcp251x.c
+++ b/drivers/net/can/spi/mcp251x.c
@@ -190,10 +190,11 @@
#define RXBEID0_OFF 4
#define RXBDLC_OFF 5
#define RXBDAT_OFF 6
-#define RXFSIDH(n) ((n) * 4)
-#define RXFSIDL(n) ((n) * 4 + 1)
-#define RXFEID8(n) ((n) * 4 + 2)
-#define RXFEID0(n) ((n) * 4 + 3)
+#define RXFSID(n) ((n < 3) ? 0 : 4)
+#define RXFSIDH(n) ((n) * 4 + RXFSID(n))
+#define RXFSIDL(n) ((n) * 4 + 1 + RXFSID(n))
+#define RXFEID8(n) ((n) * 4 + 2 + RXFSID(n))
+#define RXFEID0(n) ((n) * 4 + 3 + RXFSID(n))
#define RXMSIDH(n) ((n) * 4 + 0x20)
#define RXMSIDL(n) ((n) * 4 + 0x21)
#define RXMEID8(n) ((n) * 4 + 0x22)
--
1.7.5.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] can: mcp251x: not correct register address
2015-05-30 9:42 [PATCH v2] can: mcp251x: not correct register address Tomas Krcka
@ 2015-06-09 7:18 ` Marc Kleine-Budde
0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2015-06-09 7:18 UTC (permalink / raw)
To: Tomas Krcka, linux-can; +Cc: moorray3, himangi774, netdev
[-- Attachment #1: Type: text/plain, Size: 667 bytes --]
On 05/30/2015 11:42 AM, Tomas Krcka wrote:
> v2: fix of corrupted patch
>
> This patch corrects addresses of acceptance filters.
> These registers are not in use, but values should be correct.
> Tested with MCP2515 and am3352 and also checked datasheets for MCP2515
> and MCP2510.
>
> Signed-off-by: Tomas Krcka <tomas.krcka@nkgroup.cz>
Applied to can-next.
Thanks,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-09 7:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-30 9:42 [PATCH v2] can: mcp251x: not correct register address Tomas Krcka
2015-06-09 7:18 ` Marc Kleine-Budde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).