Re: [PATCH v4 2/3] i2c: add support for Cypress CYUSBS234 USB-I2C adapter

2014-12-13 Thread Wolfram Sang

> For repeated start (Sr) scenario, the STOP bit will not be set. For
> dummy write scenario (writing EEPROM address from I2C EEPROM slave),
> the STOP bit should not be set. But, for normal I2C write, the STOP
> bit should be set. We provide control to user to control when to
> STOP/NAK to handle different scenarios.

No, your driver needs to do all of that.

> The reset is an additional provision given to user to reset the I2C
> read or write engines. It does not require unloading I2C kernel
> module. The status indicates the information about the last i2c
> read/write operation.

I don't see the need for the user to do this. Better skip it,
there should be a real need for userspace API.

> In this version of the driver, we handle only single i2c message. In
> future iterations, we will add support for multiple i2c messages.

Then please resubmit when all this is done. It is OK to add features
incrementally, but hey, the essential things should be there right from
the beginning. Also, it would be nice if you told me your plans about
incrementally working on it right from the beginning. That would have
saved me a bit of reviewing time, a resource which is too scarce
already.



signature.asc
Description: Digital signature


RE: [PATCH v4 2/3] i2c: add support for Cypress CYUSBS234 USB-I2C adapter

2014-12-12 Thread Muthu Mani
Hi,

Thanks for reviewing the code.

> > +/*
> > + * It exposes sysfs entries under the i2c adapter for getting the i2c
> > +transfer
> > + * status, reset i2c read/write module, get/set nak and stop bits.
> > + */
>
> Yes, I see that. Yet, I don't know why they are needed? The driver should
> know when to send NAK/STOP. Why expose that to the user? And why do
> we need a reset? Are there stability problems? What about unloading the
> module? And what is the use case for reading the status?

For repeated start (Sr) scenario, the STOP bit will not be set.
For dummy write scenario (writing EEPROM address from I2C EEPROM slave), the 
STOP bit should not be set. But, for normal I2C write, the STOP bit should be 
set.
We provide control to user to control when to STOP/NAK to handle different 
scenarios.

The reset is an additional provision given to user to reset the I2C read or 
write engines. It does not require unloading I2C kernel module.
The status indicates the information about the last i2c read/write operation.

>
> > +   if (num > 1) {
> > +   dev_err(&adapter->dev, "i2c_msg number is > 1\n");
> > +   return -EIO;
> > +   }
>
> Ouch! Don't you have any repeated start option somewhere?

In this version of the driver, we handle only single i2c message. In future 
iterations, we will add support for multiple i2c messages.

Thanks,
Muthu

This message and any attachments may contain Cypress (or its subsidiaries) 
confidential information. If it has been received in error, please advise the 
sender and immediately delete this message.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 2/3] i2c: add support for Cypress CYUSBS234 USB-I2C adapter

2014-12-03 Thread Wolfram Sang
Hi,

thanks for this submission. Looks like an interesting device. However,
some very high level questions first:

> +/*
> + * It exposes sysfs entries under the i2c adapter for getting the i2c 
> transfer
> + * status, reset i2c read/write module, get/set nak and stop bits.
> + */

Yes, I see that. Yet, I don't know why they are needed? The driver
should know when to send NAK/STOP. Why expose that to the user? And why
do we need a reset? Are there stability problems? What about unloading
the module? And what is the use case for reading the status?

> +   if (num > 1) {
> +   dev_err(&adapter->dev, "i2c_msg number is > 1\n");
> +   return -EIO;
> +   }

Ouch! Don't you have any repeated start option somewhere?

Thanks,

   Wolfram



signature.asc
Description: Digital signature