Re: [PATCH 5/9] i2c-designware: move i2c functionality bit field to be adapter specific

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

 



On 1/15/2011 4:27 AM, dirk.brandewie@xxxxxxxxx wrote:
> From: Dirk Brandewie <dirk.brandewie@xxxxxxxxx>
> 
> The functionality of the adapter depends on the configuration of the
> IP block at silicon compile time and is adapter specific.

Good point.

> diff --git a/drivers/i2c/busses/i2c-designware-pci.c b/drivers/i2c/busses/i2c-designware-pci.c
> index 00717df..5d131ce 100644
> --- a/drivers/i2c/busses/i2c-designware-pci.c
> +++ b/drivers/i2c/busses/i2c-designware-pci.c
> @@ -199,6 +199,12 @@ const struct pci_device_id *id)
>  	dev->clk_khz = controller->clk_khz;
>  	dev->base = base;
>  	dev->dev = get_device(&pdev->dev);
> +	dev->functionality = I2C_FUNC_I2C |
> +		I2C_FUNC_SMBUS_BYTE |
> +		I2C_FUNC_SMBUS_BYTE_DATA |
> +		I2C_FUNC_SMBUS_WORD_DATA |
> +		I2C_FUNC_SMBUS_I2C_BLOCK;
> +
>  	pci_set_drvdata(pdev, dev);
>  
>  	dev->tx_fifo_depth = controller->tx_fifo_depth;

I'd prefer to have them aligned.

> diff --git a/drivers/i2c/busses/i2c-designware-plat.c b/drivers/i2c/busses/i2c-designware-plat.c
> index b8e5aa4..cf157a4 100644
> --- a/drivers/i2c/busses/i2c-designware-plat.c
> +++ b/drivers/i2c/busses/i2c-designware-plat.c
> @@ -91,6 +91,13 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev)
>  	}
>  	clk_enable(dev->clk);
>  
> +	dev->functionality = I2C_FUNC_I2C |
> +		I2C_FUNC_10BIT_ADDR |
> +		I2C_FUNC_SMBUS_BYTE |
> +		I2C_FUNC_SMBUS_BYTE_DATA |
> +		I2C_FUNC_SMBUS_WORD_DATA |
> +		I2C_FUNC_SMBUS_I2C_BLOCK;
> +
>  	dev->base = ioremap(mem->start, resource_size(mem));
>  	if (dev->base == NULL) {
>  		dev_err(&pdev->dev, "failure mapping io resources\n");

Ditto.
-- 
Shinya Kuribayashi
Renesas Electronics
--
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