Commit 033a23d1 authored by Chandra shekhar's avatar Chandra shekhar Committed by Tony Lindgren

I2C and TWL4030 suport on 34xx

Resubmitting the I2C patch for 3430, after Jarkko's I2C registration helper changes.
Signed-off-by: default avatarchandra shekhar <x0044955@ti.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent d1842a45
......@@ -601,7 +601,10 @@ CONFIG_HW_RANDOM=y
# CONFIG_R3964 is not set
# CONFIG_RAW_DRIVER is not set
# CONFIG_TCG_TPM is not set
# CONFIG_I2C is not set
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_OMAP=y
#
# SPI support
......
......@@ -167,6 +167,13 @@ static struct omap_uart_config sdp3430_uart_config __initdata = {
static struct omap_board_config_kernel sdp3430_config[] = {
{ OMAP_TAG_UART, &sdp3430_uart_config },
};
static int __init omap3430_i2c_init(void)
{
omap_register_i2c_bus(1, 2600, NULL, 0);
omap_register_i2c_bus(2, 400, NULL, 0);
omap_register_i2c_bus(3, 400, NULL, 0);
return 0;
}
static void __init omap_3430sdp_init(void)
{
......@@ -180,6 +187,7 @@ static void __init omap_3430sdp_map_io(void)
{
omap2_map_common_io();
}
arch_initcall(omap3430_i2c_init);
MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
/* Maintainer: Syed Khasim - Texas Instruments Inc */
......
......@@ -88,7 +88,7 @@ static void omap_i2c_mux_pins(int bus_id)
if (cpu_class_is_omap1()) {
omap_cfg_reg(I2C_SCL);
omap_cfg_reg(I2C_SDA);
} else if (cpu_class_is_omap2()) {
} else if (cpu_is_omap24xx()) {
omap_cfg_reg(M19_24XX_I2C1_SCL);
omap_cfg_reg(L15_24XX_I2C1_SDA);
}
......
......@@ -160,7 +160,7 @@ static inline u16 omap_i2c_read_reg(struct omap_i2c_dev *i2c_dev, int reg)
static int omap_i2c_get_clocks(struct omap_i2c_dev *dev)
{
if (cpu_is_omap16xx() || cpu_is_omap24xx()) {
if (cpu_is_omap16xx() || cpu_class_is_omap2()) {
dev->iclk = clk_get(dev->dev, "i2c_ick");
if (IS_ERR(dev->iclk)) {
dev->iclk = NULL;
......@@ -265,7 +265,7 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
psc = fclk_rate / 12000000;
}
if (cpu_is_omap2430()) {
if (cpu_is_omap2430() || cpu_is_omap34xx()) {
/* HSI2C controller internal clk rate should be 19.2 Mhz */
internal_clk = 19200;
......@@ -603,10 +603,9 @@ omap_i2c_isr(int this_irq, void *dev_id)
if (dev->buf_len) {
*dev->buf++ = w;
dev->buf_len--;
/*
* Data reg in 2430 is 8 bit wide,
*/
if (!cpu_is_omap2430()) {
/* Data reg from 2430 is 8 bit wide */
if (!cpu_is_omap2430() &&
!cpu_is_omap34xx()) {
if (dev->buf_len) {
*dev->buf++ = w >> 8;
dev->buf_len--;
......@@ -637,10 +636,9 @@ omap_i2c_isr(int this_irq, void *dev_id)
if (dev->buf_len) {
w = *dev->buf++;
dev->buf_len--;
/*
* Data reg in 2430 is 8 bit wide,
*/
if (!cpu_is_omap2430()) {
/* Data reg from 2430 is 8 bit wide */
if (!cpu_is_omap2430() &&
!cpu_is_omap34xx()) {
if (dev->buf_len) {
w |= *dev->buf++ << 8;
dev->buf_len--;
......@@ -740,7 +738,7 @@ omap_i2c_probe(struct platform_device *pdev)
if (cpu_is_omap15xx())
dev->rev1 = omap_i2c_read_reg(dev, OMAP_I2C_REV_REG) < 0x20;
if (cpu_is_omap2430()) {
if (cpu_is_omap2430() || cpu_is_omap34xx()) {
/* Set up the fifo size - Get total size */
dev->fifo_size = 0x8 <<
((omap_i2c_read_reg(dev, OMAP_I2C_BUFSTAT_REG) >> 14) & 0x3);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment