lkml.org 
[lkml]   [2023]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH V5] can: usb: f81604: add Fintek F81604 support
On Tue. 20 Apr. 2023 at 21:02, Vincent MAILHOL
<mailhol.vincent@wanadoo.fr> wrote:
> Hi Peter,
>
> Here are my comments. Now, it is mostly nitpicks. I guess that this is
> the final round.
>
> On Thu. 20 avr. 2023 at 11:44, Ji-Ze Hong (Peter Hong)
> <peter_hong@fintek.com.tw> wrote:
> >
> > This patch adds support for Fintek USB to 2CAN controller.
> >
> > Signed-off-by: Ji-Ze Hong (Peter Hong) <peter_hong@fintek.com.tw>
> > ---
(...)
> > diff --git a/drivers/net/can/usb/f81604.c b/drivers/net/can/usb/f81604.c
> > new file mode 100644
> > index 000000000000..ea0ff08ca186
> > --- /dev/null
> > +++ b/drivers/net/can/usb/f81604.c
> > @@ -0,0 +1,1205 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/* Fintek F81604 USB-to-2CAN controller driver.
> > + *
> > + * Copyright (C) 2023 Ji-Ze Hong (Peter Hong) <peter_hong@fintek.com.tw>
> > + */
> > +#include <linux/bitfield.h>
> > +#include <linux/netdevice.h>
> > +#include <linux/units.h>
> > +#include <linux/usb.h>
> > +
> > +#include <linux/can.h>
> > +#include <linux/can/dev.h>
> > +#include <linux/can/error.h>
> > +#include <linux/can/platform/sja1000.h>
> > +
> > +#include <asm-generic/unaligned.h>
> > +
> > +/* vendor and product id */
> > +#define F81604_VENDOR_ID 0x2c42
> > +#define F81604_PRODUCT_ID 0x1709
> > +#define F81604_CAN_CLOCK (12 * MEGA)
> > +#define F81604_MAX_DEV 2
> > +#define F81604_SET_DEVICE_RETRY 10
> > +
> > +#define F81604_USB_TIMEOUT 2000
> > +#define F81604_SET_GET_REGISTER 0xA0
> > +#define F81604_PORT_OFFSET 0x1000
> > +
> > +#define F81604_DATA_SIZE 14
> > +#define F81604_MAX_RX_URBS 4
> > +
> > +#define F81604_CMD_DATA 0x00
> > +
> > +#define F81604_DLC_LEN_MASK 0x0f

For consistency with the other definitions also use GENMASK here.

\
 
 \ /
  Last update: 2023-04-20 14:19    [W:0.204 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site