[i2c] [PATCH] AT91 I2C driver update
Jean Delvare
khali at linux-fr.org
Fri Dec 8 17:39:13 CET 2006
Hi Andrew,
On 08 Dec 2006 14:10:46 +0200, Andrew Victor wrote:
> This patch updates the AT91 I2C driver for the recently-merged core AT91
> changes.
>
> Some of the header files have been changed/renamed.
> Replace the CPU identification with the cpu_is_XXX() macro.
Thanks for the update. I'm about to send the driver to Linus. What
would happen without the changes below, compilation failure?
> Signed-off-by: Andrew Victor <andrew at sanpeople.com>
>
>
> diff -urN -x CVS linux-2.6.19-final/drivers/i2c/busses/i2c-at91.c linux-2.6.19/drivers/i2c/busses/i2c-at91.c
> --- linux-2.6.19-final/drivers/i2c/busses/i2c-at91.c Mon Dec 4 11:32:47 2006
> +++ linux-2.6.19/drivers/i2c/busses/i2c-at91.c Fri Nov 10 09:18:41 2006
> @@ -27,9 +27,9 @@
>
> #include <asm/io.h>
>
> -#include <asm/arch/at91rm9200_twi.h>
> +#include <asm/arch/at91_twi.h>
> #include <asm/arch/board.h>
> -#include <asm/arch/system.h>
> +#include <asm/arch/cpu.h>
>
> #define TWI_CLOCK 100000 /* Hz. max 400 Kbits/sec */
>
> @@ -61,7 +61,7 @@
> cdiv = cdiv >> 1;
> }
>
> - if (arch_identify() == ARCH_ID_AT91RM9200) { /* AT91RM9200 Errata #22 */
> + if (cpu_is_at91rm9200()) { /* AT91RM9200 Errata #22 */
> if (ckdiv > 5) {
> printk(KERN_ERR "AT91 I2C: Invalid TWI_CLOCK value!\n");
> ckdiv = 5;
> @@ -244,9 +244,9 @@
> return 0;
>
> fail3:
> - clk_disable(twi_clk);
> platform_set_drvdata(pdev, NULL);
> kfree(adapter);
> + clk_disable(twi_clk);
> fail2:
> clk_put(twi_clk);
> fail1:
What is this change for? Does it actually fix a bug, or...?
Thanks,
--
Jean Delvare
More information about the i2c
mailing list