linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] i2c: i2c-tiny-usb: Remove RobotFuzz USB vendor:product ID
@ 2013-11-15 10:08 Andrew Lunn
       [not found] ` <1384510094-9664-1-git-send-email-andrew-g2DYL2Zd6BY@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Lunn @ 2013-11-15 10:08 UTC (permalink / raw)
  To: wsa-z923LK4zBo2bacvFa/9K2g
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Andrew Lunn, Emmanuel Deloget,
	Barry Carter

The RobotFuzz device is not compatible with i2c-tiny-usb. Remove its
entry from the USB table so that the new correct driver can be used.

Signed-off-by: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
CC: Emmanuel Deloget <logout-GANU6spQydw@public.gmane.org>
CC: Barry Carter <barry.carter-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---

FYI: I'm away from the net for the next two weeks. So please take your time
with reviewing.

 drivers/i2c/busses/i2c-tiny-usb.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-tiny-usb.c b/drivers/i2c/busses/i2c-tiny-usb.c
index e7d3b755af3b..0ed77eeff31e 100644
--- a/drivers/i2c/busses/i2c-tiny-usb.c
+++ b/drivers/i2c/busses/i2c-tiny-usb.c
@@ -162,7 +162,6 @@ static const struct i2c_algorithm usb_algorithm = {
 static const struct usb_device_id i2c_tiny_usb_table[] = {
 	{ USB_DEVICE(0x0403, 0xc631) },   /* FTDI */
 	{ USB_DEVICE(0x1c40, 0x0534) },   /* EZPrototypes */
-	{ USB_DEVICE(0x1964, 0x0001) },   /* Robofuzz OSIF */
 	{ }                               /* Terminating entry */
 };
 
-- 
1.8.4.rc3

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* Re: [RESEND PATCH v1 2/2] i2c: Add bus driver for for OSIF USB i2c device.
@ 2014-01-04 22:28 Wolfram Sang
  2014-01-06  3:55 ` [PATCH 1/2] i2c: i2c-tiny-usb: Remove RobotFuzz USB vendor:product ID Andrew Lunn
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfram Sang @ 2014-01-04 22:28 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Emmanuel Deloget, Barry Carter

[-- Attachment #1: Type: text/plain, Size: 2918 bytes --]

Hi, thanks for the submission...


> +#define DRIVER_AUTHOR  "Barry Carter <barry.carter-hIwygO75nSHCXR85Y8Hu3Q@public.gmane.org>,"	\
> +	"Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>"
> +#define DRIVER_DESC    "OSIF driver"

No defines, use directly.

> +static int usb_read(struct i2c_adapter *adapter, int cmd,
> +		    int value, int index, void *data, int len);
> +
> +static int usb_write(struct i2c_adapter *adapter, int cmd,
> +		     int value, int index, void *data, int len);

With a bit of reshuffling, these can be skipped.

> +	dev_dbg(&adapter->dev, "master xfer %d messages:\n", num);

Skip. This info is available with I2C core debug messages.

> +	pstatus = kmalloc(sizeof(*pstatus), GFP_KERNEL);
> +	if (!pstatus)
> +		return -ENOMEM;

Does it really make sense to allocate this every time?

> +		dev_dbg(&adapter->dev,
> +			"  %d: %s (flags %d) %d bytes to 0x%02x\n",
> +			i, pmsg->flags & I2C_M_RD ? "read" : "write",
> +			pmsg->flags, pmsg->len, pmsg->addr);

This is also available with i2c core debug messages.

> +/* Structure to hold all of our device specific stuff */
> +struct priv {
> +	struct usb_device *usb_dev; /* the usb device for this device */
> +	struct usb_interface *interface; /* the interface for this device */
> +	struct i2c_adapter adapter; /* i2c related things */
> +};

Remove comments, too obvious IMO.

> +static int usb_read(struct i2c_adapter *adapter, int cmd,
> +		    int value, int index, void *data, int len)
> +{
> +	struct priv *priv = (struct priv *)adapter->algo_data;
> +
> +	/* do control transfer */

ditto.

> +	return usb_control_msg(priv->usb_dev, usb_rcvctrlpipe(priv->usb_dev, 0),
> +			       cmd, USB_TYPE_VENDOR | USB_RECIP_INTERFACE |
> +			       USB_DIR_IN, value, index, data, len, 2000);
> +}
> +
> +static int usb_write(struct i2c_adapter *adapter, int cmd,
> +		    int value, int index, void *data, int len)
> +{
> +
> +	struct priv *priv = (struct priv *)adapter->algo_data;
> +
> +	/* do control transfer */

ditto.

> +	return usb_control_msg(priv->usb_dev, usb_sndctrlpipe(priv->usb_dev, 0),
> +			       cmd, USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
> +			       value, index, data, len, 2000);
> +}
> +
> +static void osif_free(struct priv *priv)
> +{
> +	usb_put_dev(priv->usb_dev);
> +}

Not sure if this is worth a seperate function, but well...

> +static int osif_probe(struct usb_interface *interface,
> +			     const struct usb_device_id *id)
> +{
> +	struct priv *priv = NULL;

Unneeded assignment.

> +	int retval = -ENOMEM;
> +	u16 version;
> +
> +	dev_dbg(&interface->dev, "probing usb device");

This is available via driver core debug messages.

> +	/* inform user about successful attachment to i2c layer */
> +	dev_info(&priv->adapter.dev, "connected OSIF device\n");

I think this message should be merged with the "version xx found"
message above.

> +MODULE_LICENSE("GPL");

"GPL v2" according to header.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-01-10 19:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-15 10:08 [PATCH 1/2] i2c: i2c-tiny-usb: Remove RobotFuzz USB vendor:product ID Andrew Lunn
     [not found] ` <1384510094-9664-1-git-send-email-andrew-g2DYL2Zd6BY@public.gmane.org>
2013-11-15 10:08   ` [PATCH 2/2] i2c: Add bus driver for for OSIF USB i2c device Andrew Lunn
  -- strict thread matches above, loose matches on Subject: below --
2014-01-04 22:28 [RESEND PATCH v1 " Wolfram Sang
2014-01-06  3:55 ` [PATCH 1/2] i2c: i2c-tiny-usb: Remove RobotFuzz USB vendor:product ID Andrew Lunn
     [not found]   ` <1388980536-7588-1-git-send-email-andrew-g2DYL2Zd6BY@public.gmane.org>
2014-01-06  3:55     ` [PATCH 2/2] i2c: Add bus driver for for OSIF USB i2c device Andrew Lunn
     [not found]       ` <1388980536-7588-2-git-send-email-andrew-g2DYL2Zd6BY@public.gmane.org>
2014-01-09 21:49         ` Wolfram Sang
2014-01-10 18:01           ` Andrew Lunn
     [not found]             ` <20140110180154.GK9681-g2DYL2Zd6BY@public.gmane.org>
2014-01-10 18:16               ` Wolfram Sang
2014-01-10 19:21                 ` Andrew Lunn
     [not found]                   ` <20140110192148.GN9681-g2DYL2Zd6BY@public.gmane.org>
2014-01-10 19:25                     ` Wolfram Sang

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).