diff options
author | Chandra shekhar <x0044955@ti.com> | 2008-11-21 16:39:46 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2008-11-21 16:39:46 -0500 |
commit | 3d522fb41ead214d9d9236ec184271633e1cfc2f (patch) | |
tree | 755125726d136eeb5ee2a574b6ebcbd97bdffafb /drivers/i2c/busses/i2c-omap.c | |
parent | b6ee52c39999b2f3bcd9e26f0edf1f07599cf40e (diff) |
i2c-omap: Add support for omap34xx
Add support for omap34xx
Signed-off-by: chandra shekhar <x0044955@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/i2c/busses/i2c-omap.c')
-rw-r--r-- | drivers/i2c/busses/i2c-omap.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 9ae4b74f3d1a..3f7726a43125 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c | |||
@@ -156,7 +156,7 @@ static inline u16 omap_i2c_read_reg(struct omap_i2c_dev *i2c_dev, int reg) | |||
156 | 156 | ||
157 | static int omap_i2c_get_clocks(struct omap_i2c_dev *dev) | 157 | static int omap_i2c_get_clocks(struct omap_i2c_dev *dev) |
158 | { | 158 | { |
159 | if (cpu_is_omap16xx() || cpu_is_omap24xx()) { | 159 | if (cpu_is_omap16xx() || cpu_class_is_omap2()) { |
160 | dev->iclk = clk_get(dev->dev, "i2c_ick"); | 160 | dev->iclk = clk_get(dev->dev, "i2c_ick"); |
161 | if (IS_ERR(dev->iclk)) { | 161 | if (IS_ERR(dev->iclk)) { |
162 | dev->iclk = NULL; | 162 | dev->iclk = NULL; |
@@ -266,7 +266,7 @@ static int omap_i2c_init(struct omap_i2c_dev *dev) | |||
266 | psc = fclk_rate / 12000000; | 266 | psc = fclk_rate / 12000000; |
267 | } | 267 | } |
268 | 268 | ||
269 | if (cpu_is_omap2430()) { | 269 | if (cpu_is_omap2430() || cpu_is_omap34xx()) { |
270 | 270 | ||
271 | /* HSI2C controller internal clk rate should be 19.2 Mhz */ | 271 | /* HSI2C controller internal clk rate should be 19.2 Mhz */ |
272 | internal_clk = 19200; | 272 | internal_clk = 19200; |
@@ -608,7 +608,8 @@ omap_i2c_isr(int this_irq, void *dev_id) | |||
608 | *dev->buf++ = w; | 608 | *dev->buf++ = w; |
609 | dev->buf_len--; | 609 | dev->buf_len--; |
610 | /* Data reg from 2430 is 8 bit wide */ | 610 | /* Data reg from 2430 is 8 bit wide */ |
611 | if (!cpu_is_omap2430()) { | 611 | if (!cpu_is_omap2430() && |
612 | !cpu_is_omap34xx()) { | ||
612 | if (dev->buf_len) { | 613 | if (dev->buf_len) { |
613 | *dev->buf++ = w >> 8; | 614 | *dev->buf++ = w >> 8; |
614 | dev->buf_len--; | 615 | dev->buf_len--; |
@@ -646,7 +647,8 @@ omap_i2c_isr(int this_irq, void *dev_id) | |||
646 | w = *dev->buf++; | 647 | w = *dev->buf++; |
647 | dev->buf_len--; | 648 | dev->buf_len--; |
648 | /* Data reg from 2430 is 8 bit wide */ | 649 | /* Data reg from 2430 is 8 bit wide */ |
649 | if (!cpu_is_omap2430()) { | 650 | if (!cpu_is_omap2430() && |
651 | !cpu_is_omap34xx()) { | ||
650 | if (dev->buf_len) { | 652 | if (dev->buf_len) { |
651 | w |= *dev->buf++ << 8; | 653 | w |= *dev->buf++ << 8; |
652 | dev->buf_len--; | 654 | dev->buf_len--; |
@@ -694,7 +696,7 @@ omap_i2c_probe(struct platform_device *pdev) | |||
694 | struct i2c_adapter *adap; | 696 | struct i2c_adapter *adap; |
695 | struct resource *mem, *irq, *ioarea; | 697 | struct resource *mem, *irq, *ioarea; |
696 | int r; | 698 | int r; |
697 | u32 *speed = NULL; | 699 | u32 speed = 0; |
698 | 700 | ||
699 | /* NOTE: driver uses the static register mapping */ | 701 | /* NOTE: driver uses the static register mapping */ |
700 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 702 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
@@ -722,11 +724,11 @@ omap_i2c_probe(struct platform_device *pdev) | |||
722 | } | 724 | } |
723 | 725 | ||
724 | if (pdev->dev.platform_data != NULL) | 726 | if (pdev->dev.platform_data != NULL) |
725 | speed = (u32 *) pdev->dev.platform_data; | 727 | speed = *(u32 *)pdev->dev.platform_data; |
726 | else | 728 | else |
727 | *speed = 100; /* Defualt speed */ | 729 | speed = 100; /* Defualt speed */ |
728 | 730 | ||
729 | dev->speed = *speed; | 731 | dev->speed = speed; |
730 | dev->dev = &pdev->dev; | 732 | dev->dev = &pdev->dev; |
731 | dev->irq = irq->start; | 733 | dev->irq = irq->start; |
732 | dev->base = ioremap(mem->start, mem->end - mem->start + 1); | 734 | dev->base = ioremap(mem->start, mem->end - mem->start + 1); |
@@ -745,7 +747,7 @@ omap_i2c_probe(struct platform_device *pdev) | |||
745 | if (cpu_is_omap15xx()) | 747 | if (cpu_is_omap15xx()) |
746 | dev->rev1 = omap_i2c_read_reg(dev, OMAP_I2C_REV_REG) < 0x20; | 748 | dev->rev1 = omap_i2c_read_reg(dev, OMAP_I2C_REV_REG) < 0x20; |
747 | 749 | ||
748 | if (cpu_is_omap2430()) { | 750 | if (cpu_is_omap2430() || cpu_is_omap34xx()) { |
749 | u16 s; | 751 | u16 s; |
750 | 752 | ||
751 | /* Set up the fifo size - Get total size */ | 753 | /* Set up the fifo size - Get total size */ |