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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux