Re: [PATCH V2] i2c-designware: Add Intel Baytrail PMIC I2C bus support

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

 



On Tue, Sep 23, 2014 at 11:40:26AM -0700, David E. Box wrote:
> +void baytrail_evaluate_sem(struct dw_i2c_dev *dev)
> +{
> +	acpi_status status;
> +	unsigned long long shared_host = 0;
> +	acpi_handle handle;
> +
> +	if (!dev || !dev->dev) {
> +		pr_err("%s:%d: device is NULL\n", __func__, __LINE__);

Not sure if it is useful to print things like above.

> +		return;
> +	}
> +
> +	handle = ACPI_HANDLE(dev->dev);
> +	if (!handle)
> +		return;
> +
> +	status = acpi_evaluate_integer(handle, "_SEM", NULL, &shared_host);

Maybe it is better to check first if the operation succeeded before
touching shared_host?

	if (ACPI_SUCCESS(status) && shared_host) {
	}

Otherwise ACPI parts look good to me.

> +
> +	if (shared_host) {
> +		dev_info(dev->dev, "I2C bus managed by PUNIT\n");
> +		dev->has_hw_lock = true;
> +		dev->pm_runtime_disabled = true;
> +	}
> +}
> +EXPORT_SYMBOL(baytrail_evaluate_sem);
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux