[Galaxy 3 Android Development] cdesai:
Difference in drivers/i2c

diff -crB linux/drivers/i2c/busses/i2c-s3c2410.c g3/drivers/i2c/busses/i2c-s3c2410.c
*** linux/drivers/i2c/busses/i2c-s3c2410.c	2010-02-23 07:38:51.000000000 -0800
--- g3/drivers/i2c/busses/i2c-s3c2410.c	2011-02-26 04:41:39.000000000 -0800
***************
*** 253,259 ****
* process an interrupt and work out what to do
*/

! static int i2s_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)
{
unsigned long tmp;
unsigned char byte;
--- 253,259 ----
* process an interrupt and work out what to do
*/

! static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)
{
unsigned long tmp;
unsigned char byte;
***************
*** 444,450 ****
/* pretty much this leaves us with the fact that we've
* transmitted or received whatever byte we last sent */

!	i2s_s3c_irq_nextbyte(i2c, status);

out:
return IRQ_HANDLED;
--- 444,450 ----
/* pretty much this leaves us with the fact that we've
* transmitted or received whatever byte we last sent */

!	i2c_s3c_irq_nextbyte(i2c, status);

out:
return IRQ_HANDLED;
***************
*** 470,475 ****
--- 470,479 ----
msleep(1);
}

+	writel(iicstat & ~S3C2410_IICSTAT_TXRXEN, i2c->regs + S3C2410_IICSTAT);
+	if(!(readl(i2c->regs + S3C2410_IICSTAT) & S3C2410_IICSTAT_BUSBUSY))
+	return 0;
+
return -ETIMEDOUT;
}

***************
*** 520,526 ****

/* ensure the stop has been through the bus */

!	msleep(1);

out:
return ret;
--- 524,530 ----

/* ensure the stop has been through the bus */

!	udelay(10);

out:
return ret;
***************
*** 642,664 ****

writel(iiccon, i2c->regs + S3C2410_IICCON);

-	if (s3c24xx_i2c_is2440(i2c)) {
-	unsigned long sda_delay;
-
-	if (pdata->sda_delay) {
-	sda_delay = (freq / 1000) * pdata->sda_delay;
-	sda_delay /= 1000000;
-	sda_delay = DIV_ROUND_UP(sda_delay, 5);
-	if (sda_delay > 3)
-	sda_delay = 3;
-	sda_delay |= S3C2410_IICLC_FILTER_ON;
-	} else
-	sda_delay = 0;
-
-	dev_dbg(i2c->dev, "IICLC=%08lx\n", sda_delay);
-	writel(sda_delay, i2c->regs + S3C2440_IICLC);
-	}
-
return 0;
}

--- 646,651 ----
***************
*** 746,752 ****

writeb(pdata->slave_addr, i2c->regs + S3C2410_IICADD);

!	dev_info(i2c->dev, "slave address 0x%02x\n", pdata->slave_addr);

writel(iicon, i2c->regs + S3C2410_IICCON);

--- 733,739 ----

writeb(pdata->slave_addr, i2c->regs + S3C2410_IICADD);

!	dev_dbg(i2c->dev, "slave address 0x%02x\n", pdata->slave_addr);

writel(iicon, i2c->regs + S3C2410_IICCON);

***************
*** 760,768 ****

/* todo - check that the i2c lines aren't being dragged anywhere */

!	dev_info(i2c->dev, "bus frequency set to %d KHz\n", freq);
dev_dbg(i2c->dev, "S3C2410_IICCON=0x%02lx\n", iicon);

return 0;
}

--- 747,758 ----

/* todo - check that the i2c lines aren't being dragged anywhere */

!	dev_dbg(i2c->dev, "bus frequency set to %d KHz\n", freq);
dev_dbg(i2c->dev, "S3C2410_IICCON=0x%02lx\n", iicon);

+	dev_dbg(i2c->dev, "S3C2440_IICLC=%08x\n", pdata->sda_delay);
+	writel(pdata->sda_delay, i2c->regs + S3C2440_IICLC);
+
return 0;
}

diff -crB linux/drivers/i2c/busses/Kconfig g3/drivers/i2c/busses/Kconfig
*** linux/drivers/i2c/busses/Kconfig	2010-02-23 07:38:51.000000000 -0800
--- g3/drivers/i2c/busses/Kconfig	2011-02-26 04:41:39.000000000 -0800
***************
*** 493,503 ****
I2C bus.

config I2C_S3C2410
!	tristate "S3C2410 I2C Driver"
!	depends on ARCH_S3C2410 || ARCH_S3C64XX
help
Say Y here to include support for I2C controller in the
!	Samsung S3C2410 based System-on-Chip devices.

config I2C_S6000
tristate "S6000 I2C support"
--- 493,503 ----
I2C bus.

config I2C_S3C2410
!	tristate "Samsung SoC I2C Driver (S3C24XX and S3C64XX series and S5P64XX)"
!	depends on ARCH_S3C2410 || ARCH_S5P64XX
help
Say Y here to include support for I2C controller in the
!	Samsung SoC devices such as the S3C2410, S5P6442.

config I2C_S6000
tristate "S6000 I2C support"
diff -crB linux/drivers/i2c/chips/Kconfig g3/drivers/i2c/chips/Kconfig
*** linux/drivers/i2c/chips/Kconfig	2010-02-23 07:38:51.000000000 -0800
--- g3/drivers/i2c/chips/Kconfig	2011-02-26 04:41:39.000000000 -0800
***************
*** 26,29 ****
--- 26,49 ----
This driver can also be built as a module. If so, the module
will be called tsl2550.

+ config SENSORS_PCA963X
+	tristate "Philips PCA963X 4-bit I2C-bus LED"
+	depends on I2C && EXPERIMENTAL
+	help
+	If you say yes here you get support for the Philips PCA963X
+	4-bit I2C-bus LED.
+
+	This driver can also be built as a module. If so, the module
+	will be called pca963X.
+
+ config PMIC_MAX8998
+ tristate "Maxim MAX8998 Power Management chip"
+ depends on I2C
+ help
+ If you say yes here you get support fot the Maxim MAX8998
+ Power Management chip.
+
+ This provides Applocations Processor Power Management,
+ ADC/TSC, RTC, and Audio Subsystem for Mobile Applications.
+
endmenu
diff -crB linux/drivers/i2c/chips/Makefile g3/drivers/i2c/chips/Makefile
*** linux/drivers/i2c/chips/Makefile	2010-02-23 07:38:51.000000000 -0800
--- g3/drivers/i2c/chips/Makefile	2011-02-26 04:41:39.000000000 -0800
***************
*** 11,18 ****
#

obj-$(CONFIG_DS1682)	+= ds1682.o
obj-$(CONFIG_SENSORS_TSL2550)	+= tsl2550.o
!
ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
EXTRA_CFLAGS += -DDEBUG
endif
--- 11,19 ----
#

obj-$(CONFIG_DS1682)	+= ds1682.o
+ obj-$(CONFIG_SENSORS_PCA963X)	+= pca963x.o
obj-$(CONFIG_SENSORS_TSL2550)	+= tsl2550.o
! obj-$(CONFIG_PMIC_MAX8998) += max8998.o
ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
EXTRA_CFLAGS += -DDEBUG
endif
Only in g3/drivers/i2c/chips: max8998.c
Only in g3/drivers/i2c/chips: pca963x.c