RE: [PATCH v13 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-26 Thread Ajay Gupta
Hi Peter and Andy, > Shouldn't you return -ETIMEDOUT if count == 0? > >>> Yes. Good catch. Does the below fix looks ok? > >>> > >>> do { > >>> status = ccg_write(uc, CCGX_RAB_INTR_REG, &data, > sizeof(data)); > >>> if (status < 0) > >>>

Re: [PATCH v13 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-26 Thread Heikki Krogerus
On Thu, Oct 25, 2018 at 09:55:47PM +, Ajay Gupta wrote: > Hi Heikki and Andy > [...] > > > > Shouldn't you return -ETIMEDOUT if count == 0? > > > Yes. Good catch. Does the below fix looks ok? > > > > > > do { > > > status = ccg_write(uc, CCGX_RAB_INTR_REG, &data, > > >

Re: [PATCH v13 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-25 Thread Peter Rosin
On 2018-10-25 23:55, Ajay Gupta wrote: > Hi Heikki and Andy > [...] Shouldn't you return -ETIMEDOUT if count == 0? >>> Yes. Good catch. Does the below fix looks ok? >>> >>> do { >>> status = ccg_write(uc, CCGX_RAB_INTR_REG, &data, >>> sizeof(data)); >>>

RE: [PATCH v13 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-25 Thread Ajay Gupta
Hi Heikki and Andy [...] > > > Shouldn't you return -ETIMEDOUT if count == 0? > > Yes. Good catch. Does the below fix looks ok? > > > > do { > > status = ccg_write(uc, CCGX_RAB_INTR_REG, &data, > > sizeof(data)); > > if (status < 0) > >

RE: [PATCH v13 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-25 Thread Ajay Gupta
Hi Heikki, > > > I still didn't understand why can't this just be taken care of in > > > your I2C host driver? Why can't you just read 4 bytes at a time in > > > your master_xfer hook until you have received as much as the message > > > is asking, and only after that return? > > > > The I2C host ha

RE: [PATCH v13 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-25 Thread Ajay Gupta
Hi Andy, > > > > > > Latest NVIDIA GPU cards have a Cypress CCGx Type-C controller > > > > > > over I2C interface. > > > > > > > > > > > > This UCSI I2C driver uses I2C bus driver interface for > > > > > > communicating with Type-C controller. > > > > > > > > > + /* > > > > > > +* Flush CCGx

Re: [PATCH v13 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-25 Thread Andy Shevchenko
On Wed, Oct 24, 2018 at 05:43:27PM +, Ajay Gupta wrote: > Hi Andy > > > > > > Latest NVIDIA GPU cards have a Cypress CCGx Type-C controller over > > > > > I2C interface. > > > > > > > > > > This UCSI I2C driver uses I2C bus driver interface for > > > > > communicating with Type-C controller. >

Re: [PATCH v13 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-25 Thread Heikki Krogerus
Hi Peter, > > I still didn't understand why can't this just be taken care of in your > > I2C host driver? Why can't you just read 4 bytes at a time in your > > master_xfer hook until you have received as much as the message is > > asking, and only after that return? > > The I2C host hardware *can

Re: [PATCH v13 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-25 Thread Peter Rosin
On 2018-10-25 10:17, Heikki Krogerus wrote: > Hi, > > On Tue, Oct 23, 2018 at 06:56:59PM +, Ajay Gupta wrote: + /* i2c adapter (ccgx-ucsi) can read 4 byte max */ >>> >>> By "i2c adapter" do you mean this Cypress CCGx controller, or the NVIDIA I2C >>> host adapter? >> It mean NVIDIA I2C h

Re: [PATCH v13 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-25 Thread Heikki Krogerus
Hi, On Tue, Oct 23, 2018 at 06:56:59PM +, Ajay Gupta wrote: > > > + /* i2c adapter (ccgx-ucsi) can read 4 byte max */ > > > > By "i2c adapter" do you mean this Cypress CCGx controller, or the NVIDIA I2C > > host adapter? > It mean NVIDIA I2C host adapter with name "ccgx-ucsi" > > > > + whil

RE: [PATCH v13 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-24 Thread Ajay Gupta
Hi Andy > > > > Latest NVIDIA GPU cards have a Cypress CCGx Type-C controller over > > > > I2C interface. > > > > > > > > This UCSI I2C driver uses I2C bus driver interface for > > > > communicating with Type-C controller. > > > > > + /* > > > > +* Flush CCGx RESPONSE queue by ackin

Re: [PATCH v13 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-24 Thread Andy Shevchenko
On Tue, Oct 23, 2018 at 06:56:59PM +, Ajay Gupta wrote: > > On Wed, Oct 03, 2018 at 11:27:28AM -0700, Ajay Gupta wrote: > > > Latest NVIDIA GPU cards have a Cypress CCGx Type-C controller over I2C > > > interface. > > > > > > This UCSI I2C driver uses I2C bus driver interface for communicating

RE: [PATCH v13 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-23 Thread Ajay Gupta
Hi Heikki, > I still have a few more comments below.. Thanks for reviewing. > On Wed, Oct 03, 2018 at 11:27:28AM -0700, Ajay Gupta wrote: > > Latest NVIDIA GPU cards have a Cypress CCGx Type-C controller over I2C > > interface. > > > > This UCSI I2C driver uses I2C bus driver interface for comm

Re: [PATCH v13 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-23 Thread Heikki Krogerus
Hi Ajay, I still have a few more comments below.. On Wed, Oct 03, 2018 at 11:27:28AM -0700, Ajay Gupta wrote: > Latest NVIDIA GPU cards have a Cypress CCGx Type-C controller > over I2C interface. > > This UCSI I2C driver uses I2C bus driver interface for communicating > with Type-C controller. >

[PATCH v13 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-03 Thread Ajay Gupta
Latest NVIDIA GPU cards have a Cypress CCGx Type-C controller over I2C interface. This UCSI I2C driver uses I2C bus driver interface for communicating with Type-C controller. Signed-off-by: Ajay Gupta Reviewed-by: Andy Shevchenko Acked-by: Heikki Krogerus --- Changes from v1 -> v2 Fixe