RE: [PATCH v7 00/11] usb: musb: adding multi instance support

2012-08-03 Thread Ajay Gupta
Hi, On 03.08.2012 02:54, B, Ravi wrote: On 02.08.2012 14:12, Ravi Babu wrote: This series of patches adds, a) Multi instances support in musb driver b) DT support for musb_dsps glue layer c) DT support for NOP transceiver AM33xx and TI81xx has dual musb controller and has two usb

XHCI: URB not cancelled during disconnect of a MSC device

2012-09-12 Thread Ajay Gupta
Hi, I am using v3.5 kernel and running a test where I disconnect a SS MSC device while a big file is being written to it. I am also watching the lsusb output in parallel. Expectation is that SS MSC device should immediately disappear from lsusb output but sometime I see that SS MSC is listed for

Re: XHCI: URB not cancelled during disconnect of a MSC device

2012-09-12 Thread Ajay Gupta
Hi, I am using v3.5 kernel and running a test where I disconnect a SS MSC device while a big file is being written to it. I am also watching the lsusb output in parallel. Expectation is that SS MSC device should immediately disappear from lsusb output but sometime I see that SS MSC is listed

Re: XHCI: URB not cancelled during disconnect of a MSC device

2012-09-13 Thread Ajay Gupta
Hi I am using v3.5 kernel and running a test where I disconnect a SS MSC device while a big file is being written to it. I am also watching the lsusb output in parallel. Expectation is that SS MSC device should immediately disappear from lsusb output but sometime I see that SS MSC is

RE: XHCI: URB not cancelled during disconnect of a MSC device

2012-09-24 Thread Ajay Gupta
Hi, Ajay, which host controller are you seeing the disconnect lags on? Can you send me the output of `sudo lspci -vvv -n`? I was on leave last week so will get the data at earliest. Ajay Sarah Sharp -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a

[PATCH] usb: xhci: increase CRS timeout value

2018-06-07 Thread Ajay Gupta
Some controllers take almost 55ms to complete controller restore state (CRS). There is no timeout limit mentioned in xhci specification so fix the issue by increasing the timeout limit to 55ms Signed-off-by: Ajay Gupta Signed-off-by: Nagaraj Annaiah --- drivers/usb/host/xhci.c | 2 +- 1 file

[PATCH v2] usb: xhci: increase CRS timeout value

2018-06-11 Thread Ajay Gupta
Some controllers take almost 55ms to complete controller restore state (CRS). There is no timeout limit mentioned in xhci specification so fixing the issue by increasing the timeout limit to 55ms Signed-off-by: Ajay Gupta Signed-off-by: Nagaraj Annaiah --- drivers/usb/host/xhci.c | 7

[PATCH v3] usb: xhci: increase CRS timeout value

2018-06-11 Thread Ajay Gupta
Some controllers take almost 55ms to complete controller restore state (CRS). There is no timeout limit mentioned in xhci specification so fixing the issue by increasing the timeout limit to 100ms Signed-off-by: Ajay Gupta Signed-off-by: Nagaraj Annaiah --- Changes from v2->v3 Updated com

Re: [PATCH v6] USB: serial: ftdi_sio: Add MTP NVM support

2018-06-29 Thread Ajay Gupta
Reviewed-by: Andy Shevchenko > Signed-off-by: Loic Poulain Reviewed-by: Ajay Gupta > --- > v2: Use ifdef instead of IS_ENABLED > error message in case of nvmem registering failure > Fix space/tab in Kconfig > v3: Make nvmem a child of the usb dev instead of the serial

Re: [PATCH v2] USB: serial: ftdi_sio: Add MTP NVM support

2018-06-21 Thread Ajay Gupta
Hi Loic On 6/21/18, Loic Poulain wrote: > Most of FTDI's devices have an EEPROM which records FTDI devices > configuration setting (e.g. the VID, PID, I/O config...) and user > data. FT230R chip integrates a 128-byte eeprom, FT230X a 2048-byte > eeprom... > > This patch adds support for FTDI

[PATCH 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-08-24 Thread Ajay Gupta
Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C controller which can be accessed over I2C. This driver add I2C bus driver to communicate with Type-C controller. I2C client driver will be part of USB Type-C UCSI driver. Signed-off-by: Ajay Gupta --- Documentation/i2c/busses

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

2018-08-24 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 --- drivers/usb/typec/ucsi/Kconfig| 10 + drivers/usb/typec/ucsi/Makefile

[PATCH v2 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-08-24 Thread Ajay Gupta
Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C controller which can be accessed over I2C. This driver add I2C bus driver to communicate with Type-C controller. I2C client driver will be part of USB Type-C UCSI driver. Signed-off-by: Ajay Gupta --- Changes from v1 -> v2: N

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

2018-08-24 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 --- Changes from v1 -> v2: Fixed identation in drivers/usb/typec/ucsi/Kconfig drivers/

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

2018-08-30 Thread Ajay Gupta
struct ucsi_ccg *uc = data; > > + > > + ucsi_notify(uc->ucsi); > > + > > + return IRQ_HANDLED; > > +} > > + > > > +static int ucsi_ccg_probe(struct i2c_client *client, > > + const struct i2c_device_id *id

[PATCH v4 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-08-30 Thread Ajay Gupta
Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C controller which can be accessed over I2C. This driver adds I2C bus driver to communicate with Type-C controller. I2C client driver will be part of USB Type-C UCSI driver. Signed-off-by: Ajay Gupta --- Changes from v1 ->

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

2018-08-30 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 --- Changes from v1 -> v2 Fixed identation in drivers/usb/typec/ucsi/Kconfig Chan

RE: [PATCH v3 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-08-30 Thread Ajay Gupta
. > > > > Some small comments below, after addressing them > > Reviewed-by: Andy Shevchenko > > > Signed-off-by: Ajay Gupta > > --- > > Changes from v1 -> v2 > > None > > Changes from v2 -> v3 > >

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

2018-08-31 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. > > > Changes from v3 -> v4 > > Fixed comments from Andy > > Unfortunatelly not all

RE: [PATCH v4 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-08-31 Thread Ajay Gupta
Hi Andy, > > Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C > > controller which can be accessed over I2C. > > > > This driver adds I2C bus driver to communicate with Type-C controller. > > I2C client driver will be part of USB Type-C UCSI driver. > > Thanks for an update, my

[PATCH v5 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-08-31 Thread Ajay Gupta
Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C controller which can be accessed over I2C. This driver adds I2C bus driver to communicate with Type-C controller. I2C client driver will be part of USB Type-C UCSI driver. Signed-off-by: Ajay Gupta --- Changes from v1 ->

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

2018-08-31 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 --- Changes from v1 -> v2 Fixed identation in drivers/usb/typec/ucsi/Kconfig Chan

RE: [PATCH v4 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-08-31 Thread Ajay Gupta
Hi Andy > > > Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C > > > controller which can be accessed over I2C. > > > + val &= ~(I2C_MST_CNTL_GEN_START | I2C_MST_CNTL_GEN_STOP > > > + | I2C_MST_CNTL_GEN_RAB); > > > > "|" should be on previous line to follow

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

2018-09-05 Thread Ajay Gupta
Hi Greg, > On Fri, Aug 31, 2018 at 01:22:21PM -0700, Ajay Gupta wrote: > > + dev_info(dev, "Silicon id %2ph", data + > CCGX_I2C_RAB_READ_SILICON_ID); > > + dev_info(dev, "FW1 version %8ph\n", data + > CCGX_I2C_RAB_FW1_VERSION); > &g

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

2018-09-05 Thread Ajay Gupta
Hi Greg, > > +static int ccg_read(struct ucsi_ccg *uc, u16 rab, u8 *data, u32 len) > > +{ > > + struct device *dev = uc->dev; > > + struct i2c_client *client = uc->client; > > + unsigned char buf[2]; > > + struct i2c_msg msgs[] = { > > + { > > + .addr =

[PATCH v6 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-05 Thread Ajay Gupta
Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C controller which can be accessed over I2C. This driver adds I2C bus driver to communicate with Type-C controller. I2C client driver will be part of USB Type-C UCSI driver. Signed-off-by: Ajay Gupta --- Changes from v1 ->

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

2018-09-05 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 --- Changes from v1 -> v2 Fixed identation in drivers/usb/typec/ucsi/Kconfig Chan

RE: [PATCH v9 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-07 Thread Ajay Gupta
Hi Peter, > > Signed-off-by: Ajay Gupta > > Reviewed-by: Andy Shevchenko > > Reviewed-by: Heikki Krogerus > > --- > > Changes from v1 -> v2 > > None > > Changes from v2 -> v3 > > Fixed review comments from Andy and Thierry > >

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

2018-09-07 Thread Ajay Gupta
Hi Peter, > -Original Message- > From: Peter Rosin > Sent: Friday, September 7, 2018 2:13 AM > To: Ajay Gupta ; w...@the-dreams.de; > heikki.kroge...@linux.intel.com > Cc: linux-usb@vger.kernel.org; linux-...@vger.kernel.org > Subject: Re: [PATCH v9 2/2] usb: typ

RE: [PATCH v6 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-06 Thread Ajay Gupta
+ return status; > > + } > > + > > + i2cd->do_start = true; > > + mutex_init(>mutex); > > + enable_i2c_bus(i2cd); > > + > > + i2c_set_adapdata(>adapter, i2cd); > > + i2cd->adapter.owner = THIS_MODULE; > > + strlcpy(i2cd->adapter.name, "NVIDIA GPU I2C adapter", > > + sizeof(i2cd->adapter.name)); > > + i2cd->adapter.algo = _i2c_algorithm; > > + i2cd->adapter.dev.parent = >dev; > > + status = i2c_add_adapter(>adapter); > > + if (status < 0) { > > + dev_err(>dev, "i2c_add_adapter failed %d\n", status); > > + goto free_irq_vectors; > > + } > > + > > + status = gpu_populate_client(i2cd, pdev->irq); > > + if (status < 0) { > > + dev_err(>dev, "gpu_populate_client failed %d\n", > status); > > + goto del_adapter; > > + } > > + > > + return 0; > > + > > +del_adapter: > > + i2c_del_adapter(>adapter); > > +free_irq_vectors: > > + pci_free_irq_vectors(pdev); > > + return status; > > +} > > + > > +static void gpu_i2c_remove(struct pci_dev *pdev) { > > + struct gpu_i2c_dev *i2cd = dev_get_drvdata(>dev); > > + > > + i2c_del_adapter(>adapter); > > + pci_free_irq_vectors(pdev); > > +} > > + > > +static int gpu_i2c_resume(struct device *dev) { > > + struct gpu_i2c_dev *i2cd = dev_get_drvdata(dev); > > + > > + enable_i2c_bus(i2cd); > > + return 0; > > +} > > + > > +static int gpu_i2c_idle(struct device *dev) { > > + struct gpu_i2c_dev *i2cd = dev_get_drvdata(dev); > > + > > + if (!mutex_trylock(>mutex)) { > > + dev_info(dev, "-EBUSY\n"); > > + return -EBUSY; > > + } > > + mutex_unlock(>mutex); > > + > > + return 0; > > +} > > + > > +UNIVERSAL_DEV_PM_OPS(gpu_i2c_driver_pm, NULL, gpu_i2c_resume, > > +gpu_i2c_idle); > > + > > +static struct pci_driver gpu_i2c_driver = { > > + .name = "nvidia-gpu", > > + .id_table = gpu_i2c_ids, > > + .probe = gpu_i2c_probe, > > + .remove = gpu_i2c_remove, > > + .driver = { > > + .pm = _i2c_driver_pm, > > + }, > > +}; > > + > > +module_pci_driver(gpu_i2c_driver); > > + > > +MODULE_AUTHOR("Ajay Gupta "); > > +MODULE_DESCRIPTION("Nvidia GPU I2C controller Driver"); > > +MODULE_LICENSE("GPL v2"); > >

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

2018-09-06 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 --- Changes from v1 -> v2 Fixed identation in drivers/usb/typec/ucsi/Kconfig Chan

[PATCH v8 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-06 Thread Ajay Gupta
Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C controller which can be accessed over I2C. This driver adds I2C bus driver to communicate with Type-C controller. I2C client driver will be part of USB Type-C UCSI driver. Signed-off-by: Ajay Gupta Reviewed-by: Andy Shevchenko

[PATCH v7 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-06 Thread Ajay Gupta
Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C controller which can be accessed over I2C. This driver adds I2C bus driver to communicate with Type-C controller. I2C client driver will be part of USB Type-C UCSI driver. Signed-off-by: Ajay Gupta Reviewed-by: Andy Shevchenko

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

2018-09-06 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 ->

RE: [PATCH v6 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-06 Thread Ajay Gupta
gt;regs) { > >>> + dev_err(>dev, "pcim_iomap failed\n"); > >>> + return -ENOMEM; > >>> + } > >>> + > >>> + status = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI); > >>> + if (status < 0) { > >>

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

2018-09-06 Thread Ajay Gupta
c(dev, sizeof(*uc), GFP_KERNEL); > > + if (!uc) > > + return -ENOMEM; > > + > > + uc->ppm.data = devm_kzalloc(dev, sizeof(struct ucsi_data), > GFP_KERNEL); > > + if (!uc->ppm.data) > > + return -ENOMEM; > > + > > + uc->ppm.cmd = ucsi_ccg_cmd; > > + uc->ppm.sync = ucsi_ccg_sync; > > + uc->dev = dev; > > + uc->client = client; > > + > > + /* reset ccg device and initialize ucsi */ > > + status = ucsi_ccg_init(uc); > > + if (status < 0) { > > + dev_err(uc->dev, "ucsi_ccg_init failed - %d\n", status); > > + return status; > > + } > > + > > + uc->irq = client->irq; > > + > > + status = devm_request_threaded_irq(dev, uc->irq, NULL, > ccg_irq_handler, > > + IRQF_ONESHOT | > IRQF_TRIGGER_HIGH, > > + dev_name(dev), uc); > > + if (status < 0) { > > + dev_err(uc->dev, "request_threaded_irq failed - %d\n", > status); > > + return status; > > + } > > + > > + uc->ucsi = ucsi_register_ppm(dev, >ppm); > > + if (IS_ERR(uc->ucsi)) { > > + dev_err(uc->dev, "ucsi_register_ppm failed\n"); > > + return PTR_ERR(uc->ucsi); > > + } > > + > > + i2c_set_clientdata(client, uc); > > + return 0; > > +} > > + > > +static int ucsi_ccg_remove(struct i2c_client *client) { > > + struct ucsi_ccg *uc = i2c_get_clientdata(client); > > + > > + ucsi_unregister_ppm(uc->ucsi); > > + > > + return 0; > > +} > > + > > +static const struct i2c_device_id ucsi_ccg_device_id[] = { > > + {"ccgx-ucsi", 0}, > > + {} > > +}; > > +MODULE_DEVICE_TABLE(i2c, ucsi_ccg_device_id); > > + > > +static struct i2c_driver ucsi_ccg_driver = { > > + .driver = { > > + .name = "ucsi_ccg", > > + }, > > + .probe = ucsi_ccg_probe, > > + .remove = ucsi_ccg_remove, > > + .id_table = ucsi_ccg_device_id, > > +}; > > + > > +module_i2c_driver(ucsi_ccg_driver); > > + > > +MODULE_AUTHOR("Ajay Gupta "); > > +MODULE_DESCRIPTION("UCSI driver for Cypress CCGx Type-C controller"); > > +MODULE_LICENSE("GPL v2"); > >

[PATCH v9 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-06 Thread Ajay Gupta
Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C controller which can be accessed over I2C. This driver adds I2C bus driver to communicate with Type-C controller. I2C client driver will be part of USB Type-C UCSI driver. Signed-off-by: Ajay Gupta Reviewed-by: Andy Shevchenko

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

2018-09-06 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 ->

RE: [PATCH v8 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-06 Thread Ajay Gupta
> create mode 100644 Documentation/i2c/busses/i2c-nvidia-gpu > > create mode 100644 drivers/i2c/busses/i2c-nvidia-gpu.c > > > > diff --git a/Documentation/i2c/busses/i2c-nvidia-gpu > > b/Documentation/i2c/busses/i2c-nvidia-gpu > > new file mode 1006

RE: [PATCH v10 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-10 Thread Ajay Gupta
Hi Peter, > >> + > >> + if (msgs[i].flags & I2C_M_RD) { > >> + /* gpu_i2c_read has implicit start and stop */ > >> + status = gpu_i2c_read(i2cd, msgs[i].buf, msgs[i].len); > >> + if (status < 0) > >> + return

RE: [PATCH v10 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-10 Thread Ajay Gupta
Hi Peter, > > + > > + if (msgs[i].flags & I2C_M_RD) { > > + /* gpu_i2c_read has implicit start and stop */ > > + status = gpu_i2c_read(i2cd, msgs[i].buf, > > msgs[i].len); > > + if (status <

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

2018-09-10 Thread Ajay Gupta
Hi Peter, > > 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 > > Re

RE: [PATCH v10 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-10 Thread Ajay Gupta
Hi Peter, > >>> + if (msgs[i].flags & I2C_M_RD) { > >>> + /* gpu_i2c_read has implicit start and stop */ > >>> + status = gpu_i2c_read(i2cd, msgs[i].buf, > msgs[i].len); > >>> + if (status < 0) > >>> +

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

2018-09-10 Thread Ajay Gupta
t means that all the new offsets and sizes > >> defined in v10 are available with > >> offsetof() and sizeof() which would be much neater than a bunch of defines. > >> Sorry for not catching this earlier! > >> > >> See below for an example. > > Sure. > >> > >>> + > >>> + uc->ppm.cmd = ucsi_ccg_cmd; > >>> + uc->ppm.sync = ucsi_ccg_sync; > >>> + uc->dev = dev; > >>> + uc->client = client; > >>> + > >>> + /* reset ccg device and initialize ucsi */ > >>> + status = ucsi_ccg_init(uc); > >>> + if (status < 0) { > >>> + dev_err(uc->dev, "ucsi_ccg_init failed - %d\n", status); > >>> + return status; > >>> + } > >>> + > >>> + uc->irq = client->irq; > >>> + > >>> + status = devm_request_threaded_irq(dev, uc->irq, NULL, > >> ccg_irq_handler, > >>> +IRQF_ONESHOT | > >> IRQF_TRIGGER_HIGH, > >>> +dev_name(dev), uc); > >>> + if (status < 0) { > >>> + dev_err(uc->dev, "request_threaded_irq failed - %d\n", > >> status); > >>> + return status; > >>> + } > >>> + > >>> + uc->ucsi = ucsi_register_ppm(dev, >ppm); > >>> + if (IS_ERR(uc->ucsi)) { > >>> + dev_err(uc->dev, "ucsi_register_ppm failed\n"); > >>> + return PTR_ERR(uc->ucsi); > >>> + } > >>> + > >>> + rab = CCGX_I2C_RAB_UCSI_DATA_BLOCK(USBC_VERSION_OFFSET); > >>> + status = ccg_read(uc, rab, (u8 *)(uc->ppm.data) + > >> USBC_VERSION_OFFSET, > >>> + USBC_VERSION_SIZE); > >> > >> E.g. > >>rab = CCGX_I2C_RAB_UCSI_DATA_BLOCK(offsetof(struct ucsi_data, > >> version)); > >>status = ccg_read(uc, rab, (u8 *)>ppm.data->version, > >> sizeof(uc->ppm.data->version)); > >> > >> Hmm, but this highlights that you are not doing any endian conversion > >> of the fields in that struct as you read/write it. > > > >> Do you need to in case you have an endian mismatch? > > Looks like don't need it. I have tested it and it works as is. > > Yeah, but have you tested the driver on a machine with the other byte-sex? No, I think better to convert to desired endian. Thanks Ajay -- nvpublic -- > Cheers, > Peter > > > Thanks > > Ajay > > > > -- > > nvpublic > > -- > >> > >> Cheers, > >> Peter > >> > >>> + if (status < 0) { > >>> + ucsi_unregister_ppm(uc->ucsi); > >>> + return status; > >>> + } > >>> + > >>> + i2c_set_clientdata(client, uc); > >>> + return 0; > >>> +} > >>> + > >>> +static int ucsi_ccg_remove(struct i2c_client *client) { > >>> + struct ucsi_ccg *uc = i2c_get_clientdata(client); > >>> + > >>> + ucsi_unregister_ppm(uc->ucsi); > >>> + > >>> + return 0; > >>> +} > >>> + > >>> +static const struct i2c_device_id ucsi_ccg_device_id[] = { > >>> + {"ccgx-ucsi", 0}, > >>> + {} > >>> +}; > >>> +MODULE_DEVICE_TABLE(i2c, ucsi_ccg_device_id); > >>> + > >>> +static struct i2c_driver ucsi_ccg_driver = { > >>> + .driver = { > >>> + .name = "ucsi_ccg", > >>> + }, > >>> + .probe = ucsi_ccg_probe, > >>> + .remove = ucsi_ccg_remove, > >>> + .id_table = ucsi_ccg_device_id, > >>> +}; > >>> + > >>> +module_i2c_driver(ucsi_ccg_driver); > >>> + > >>> +MODULE_AUTHOR("Ajay Gupta "); > >>> +MODULE_DESCRIPTION("UCSI driver for Cypress CCGx Type-C > >>> +controller"); MODULE_LICENSE("GPL v2"); > >>> > >

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

2018-09-10 Thread Ajay Gupta
Hi Peter > > +static int ucsi_ccg_send_data(struct ucsi_ccg *uc) { > > + unsigned char buf1[USBC_MSG_OUT_SIZE]; > > + unsigned char buf2[USBC_CONTROL_SIZE]; > > + int status; > > + u16 rab; > > + > > + memcpy(buf1, (u8 *)(uc->ppm.data) +

RE: [PATCH v10 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-10 Thread Ajay Gupta
Hi Peter > > + if (msgs[i].flags & I2C_M_RD) { > > + /* gpu_i2c_read has implicit start and stop */ > > + status = gpu_i2c_read(i2cd, msgs[i].buf, > >> msgs[i].len); > > + if (status < 0) > > +

[PATCH v11 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-10 Thread Ajay Gupta
Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C controller which can be accessed over I2C. This driver adds I2C bus driver to communicate with Type-C controller. I2C client driver will be part of USB Type-C UCSI driver. Signed-off-by: Ajay Gupta Reviewed-by: Andy Shevchenko

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

2018-09-10 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 ->

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

2018-09-10 Thread Ajay Gupta
Hi Peter > > > +static int ucsi_ccg_send_data(struct ucsi_ccg *uc) { > > > + unsigned char buf1[USBC_MSG_OUT_SIZE]; > > > + unsigned char buf2[USBC_CONTROL_SIZE]; > > > + int status; > > > + u16 rab; > > > + > > > + memcpy(buf1, (u8 *)(uc->ppm.data)

RE: [PATCH v11 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-10 Thread Ajay Gupta
sses/i2c-nvidia-gpu > > create mode 100644 drivers/i2c/busses/i2c-nvidia-gpu.c > > > > diff --git a/Documentation/i2c/busses/i2c-nvidia-gpu > > b/Documentation/i2c/busses/i2c-nvidia-gpu > > new file mode 100644 > > index 000..31884d2 > > --- /dev/null >

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

2018-09-10 Thread Ajay Gupta
Hi Peter, > +static int ucsi_ccg_send_data(struct ucsi_ccg *uc) { > +unsigned char buf1[USBC_MSG_OUT_SIZE]; > +unsigned char buf2[USBC_CONTROL_SIZE]; > +int status; > +u16 rab; > + > +memcpy(buf1, (u8

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

2018-08-29 Thread Ajay Gupta
Hi Heikki, > On Fri, Aug 24, 2018 at 02:33:36PM -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 contr

RE: [PATCH v9 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-07 Thread Ajay Gupta
= { > >>> + I2C_BOARD_INFO("ccgx-ucsi", 0x8), > >>> + }; > >>> + > >>> + gpu_ccgx_ucsi.irq = irq; > >>> + i2cd->client = i2c_new_device(>adapter, _ccgx_ucsi); > >>> + if (!i2cd->client) { > >>> +

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

2018-09-07 Thread Ajay Gupta
Hi Peter, > >>> + memcpy(buf1, ((const void *)uc->ppm.data) + 0x20, sizeof(buf1)); > >>> + memcpy(buf2, ((const void *)uc->ppm.data) + 0x8, sizeof(buf2)); > >>> + > >>> + status = ccg_write(uc, *(u16 *)buf, buf1, sizeof(buf1)); > >> > >> This seems to be endian-dependent. May I suggest that you

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

2018-09-07 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 ->

[PATCH v10 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-07 Thread Ajay Gupta
Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C controller which can be accessed over I2C. This driver adds I2C bus driver to communicate with Type-C controller. I2C client driver will be part of USB Type-C UCSI driver. Signed-off-by: Ajay Gupta Reviewed-by: Andy Shevchenko

Re: [PATCH v9 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-08 Thread Ajay Gupta
Hi Peter, . >SMBUS has nothing to do with the >problem, that was just an example. An I2C >>client driver can issue such I2C xfers all by >itself without going through >emulation, so >just dropping the _EMUL flag is not the >answer. And I'd be >surprised if the >hardware doesn't support

RE: [PATCH v12 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-11 Thread Ajay Gupta
gt; drivers/i2c/busses/i2c-nvidia-gpu.c | 368 > > > 5 files changed, 403 insertions(+) > > create mode 100644 Documentation/i2c/busses/i2c-nvidia-gpu > > create mode 100644 drivers/i2c/busses/i2c-nvidia-gpu.c > > >

RE: [PATCH v13 0/2] Add support for USB Type-C interface on latest NVIDIA GPU

2018-10-12 Thread Ajay Gupta
Heikki Krogerus. > Peter Rosin also helped review the patches and provided valuable comments. > Thanks to all reviewers. > > Thanks > Ajay > > Ajay Gupta (2): > i2c: buses: add i2c bus driver for NVIDIA GPU > usb: typec: ucsi: add support for Cypress CCGx > >

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

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

RE: [PATCH v12 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-10-24 Thread Ajay Gupta
Hi Wolfram, > > I don't think SMBus is an option in this case since the intended > > client (Cypress something in patch 2/2) does xfers that would need > > 16-bit commands and I think they are always 8-bit in SMBus, no? > > Yes. Command is 8 bit, data can be 16. Thanks for the heads up! Please

[PATCH v15 0/2] Add support for USB Type-C interface on latest NVIDIA GPU

2018-10-26 Thread Ajay Gupta
now have added logic to check i2c adapter quirks and issues i2c read transfer based on max_read_len quirk settings. This will make sure the read limitation is not affecting I2C host which do not have such limitation. I think the patches should through usb tree because the main functionality is

[PATCH v15 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-10-26 Thread Ajay Gupta
Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C controller which can be accessed over I2C. This driver adds I2C bus driver to communicate with Type-C controller. I2C client driver will be part of USB Type-C UCSI driver. Signed-off-by: Ajay Gupta --- Changes from v1 ->

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

2018-10-26 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 --- Changes from v1 -> v2 Fixed identation in drivers/usb/typec/ucsi/Kconfig Chan

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, , > 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

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

2018-10-25 Thread Ajay Gupta
; > > > + dev_name(dev), uc); > > > > + if (status < 0) { > > > > + dev_err(uc->dev, "request_threaded_irq failed - %d\n", > > > status); > > > > + return s

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

RE: [PATCH v15 0/2] Add support for USB Type-C interface on latest NVIDIA GPU

2018-11-05 Thread Ajay Gupta
Hi Wolfram, Do you have any comments on these patches? Thanks Ajay > nvpublic > -Original Message- > From: Andy Shevchenko > Sent: Monday, October 29, 2018 5:43 AM > To: Ajay Gupta > Cc: w...@the-dreams.de; heikki.kroge...@linux.intel.com; p...@axentia.se; > linu

RE: [PATCH v15 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-11-09 Thread Ajay Gupta
Hi Wolfram, > > @@ -140,5 +140,6 @@ obj-$(CONFIG_I2C_SIBYTE)+= i2c-sibyte.o > > obj-$(CONFIG_I2C_XGENE_SLIMPRO) += i2c-xgene-slimpro.o > > obj-$(CONFIG_SCx200_ACB) += scx200_acb.o > > obj-$(CONFIG_I2C_FSI) += i2c-fsi.o > > +obj-$(CONFIG_I2C_NVIDIA_GPU) +=

RE: [PATCH v15 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-11-09 Thread Ajay Gupta
Hi Wolfram, > > Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C > > controller which can be accessed over I2C. > > > > This driver adds I2C bus driver to communicate with Type-C controller. > > I2C client driver will be part of USB Type-C UCSI drive

RE: [PATCH v15 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-11-09 Thread Ajay Gupta
Hi Wolfram, > > It will be good if both of them can go together either through I2C or > > USB subsystem. Since USB part is reviewed and has Acked-by Heikki so > > please take that also. > > Hmmm, technicallly, there is no need to let them go together. There is no > strict dependency. Agree. >

[PATCH v13 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-10-03 Thread Ajay Gupta
Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C controller which can be accessed over I2C. This driver adds I2C bus driver to communicate with Type-C controller. I2C client driver will be part of USB Type-C UCSI driver. Signed-off-by: Ajay Gupta Reviewed-by: Andy Shevchenko

[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 ->

[PATCH v13 0/2] Add support for USB Type-C interface on latest NVIDIA GPU

2018-10-03 Thread Ajay Gupta
hould through usb tree because the main functionality is usb Type-C. The changes have been reviewed by Andy Shevchenko and Heikki Krogerus. Peter Rosin also helped review the patches and provided valuable comments. Thanks to all reviewers. Thanks Ajay Ajay Gupta (2): i2c: buses: add i2c bus driver for

RE: [PATCH v12 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-10-02 Thread Ajay Gupta
Hi Wolfram, > > > > We got confirmation from HW team about 4 byte read limitation. > > > > There has to be a STOP after every single read cycle. One read > > > > cycle supports maximum of > > > > 4 byte burst. I will update the patches with a comment on this. > > > > > > Could it be that this is

RE: [PATCH v12 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-10-01 Thread Ajay Gupta
Hi Wolfram, > > > > > > Can we get the working set in while the issues is being debugged? > > > > > > > > > > I'm not the one making the decision, and I don't even know if > > > > > this is going through the i2c or the usb tree? If it's going > > > > > through the i2c tree you need a tag from the

RE: [PATCH v12 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-10-01 Thread Ajay Gupta
Hi Heikki and Peter, > > > > Can we get the working set in while the issues is being debugged? > > > > > > I'm not the one making the decision, and I don't even know if this > > > is going through the i2c or the usb tree? If it's going through the > > > i2c tree you need a tag from the usb people

RE: [PATCH v12 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-10-01 Thread Ajay Gupta
Hi Peter, > I'm not the one making the decision, and I don't even know if this > is going through the i2c or the usb tree? If it's going through the > i2c tree you need a tag from the usb people (Greg?) on patch 2/2, > and if it's going through the usb tree, you need a tag

RE: [PATCH v12 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-12 Thread Ajay Gupta
Hi Peter, > > This driver adds I2C bus driver to communicate with Type-C controller. > > I2C client driver will be part of USB Type-C UCSI driver. > > > > Signed-off-by: Ajay Gupta > > Reviewed-by: Andy Shevchenko > > Reviewed-by: Heikki Krogerus > >

RE: [PATCH v12 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-12 Thread Ajay Gupta
Hi Peter, > >>> This driver adds I2C bus driver to communicate with Type-C controller. > >>> I2C client driver will be part of USB Type-C UCSI driver. > >>> > >>> Signed-off-by: Ajay Gupta > >>> Reviewed-by: Andy Shevchenko > &g

RE: [PATCH v11 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-11 Thread Ajay Gupta
Hi Peter, > -Original Message- > From: linux-i2c-ow...@vger.kernel.org > On Behalf Of Peter Rosin > Sent: Tuesday, September 11, 2018 1:55 AM > To: Ajay Gupta ; w...@the-dreams.de; > heikki.kroge...@linux.intel.com > Cc: linux-usb@vger.kernel.org; linux-...@vger.ker

RE: [PATCH v12 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-13 Thread Ajay Gupta
Hi Heikki and Peter, > > > Can we get the working set in while the issues is being debugged? > > > > I'm not the one making the decision, and I don't even know if this is > > going through the i2c or the usb tree? If it's going through the i2c > > tree you need a tag from the usb people (Greg?)

[PATCH v12 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-11 Thread Ajay Gupta
Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C controller which can be accessed over I2C. This driver adds I2C bus driver to communicate with Type-C controller. I2C client driver will be part of USB Type-C UCSI driver. Signed-off-by: Ajay Gupta Reviewed-by: Andy Shevchenko

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

2018-09-11 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 ->