All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: ajayg@nvidia.com
Cc: wsa@the-dreams.de, heikki.krogerus@linux.intel.com,
	peda@axentia.se, linux-usb@vger.kernel.org,
	linux-i2c@vger.kernel.org
Subject: [v14,2/2] usb: typec: ucsi: add support for Cypress CCGx
Date: Fri, 26 Oct 2018 15:18:51 +0300	[thread overview]
Message-ID: <20181026121851.GF10650@smile.fi.intel.com> (raw)

On Thu, Oct 25, 2018 at 03:33:53PM -0700, ajayg@nvidia.com 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.

> +	/*
> +	 * Flush CCGx RESPONSE queue by acking interrupts. Above ucsi control
> +	 * register write will push response which must be cleared.
> +	 */
> +	do {
> +		status = ccg_read(uc, CCGX_RAB_INTR_REG, &data, sizeof(data));
> +		if (status < 0)
> +			return status;
> +
> +		if (!data)
> +			return 0;
> +
> +		status = ccg_write(uc, CCGX_RAB_INTR_REG, &data, sizeof(data));
> +		if (status < 0)
> +			return status;
> +
> +		usleep_range(10000, 11000);
> +	} while (data && --count);

I don't see any point to check data here. How can it be different from the
check above?

> +	return -ETIMEDOUT;

             reply	other threads:[~2018-10-26 12:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-26 12:18 Andy Shevchenko [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-10-25 22:33 [v14,2/2] usb: typec: ucsi: add support for Cypress CCGx Ajay Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181026121851.GF10650@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=ajayg@nvidia.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peda@axentia.se \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.