diff options
-rw-r--r-- | drivers/i2c/busses/i2c-s3c2410.c | 13 | ||||
-rw-r--r-- | include/asm-arm/plat-s3c/iic.h | 1 |
2 files changed, 13 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 007390ad9810..eef35d3f6073 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c | |||
@@ -752,9 +752,12 @@ static int s3c24xx_i2c_init(struct s3c24xx_i2c *i2c) | |||
752 | static int s3c24xx_i2c_probe(struct platform_device *pdev) | 752 | static int s3c24xx_i2c_probe(struct platform_device *pdev) |
753 | { | 753 | { |
754 | struct s3c24xx_i2c *i2c = &s3c24xx_i2c; | 754 | struct s3c24xx_i2c *i2c = &s3c24xx_i2c; |
755 | struct s3c2410_platform_i2c *pdata; | ||
755 | struct resource *res; | 756 | struct resource *res; |
756 | int ret; | 757 | int ret; |
757 | 758 | ||
759 | pdata = s3c24xx_i2c_get_platformdata(&pdev->dev); | ||
760 | |||
758 | /* find the clock and enable it */ | 761 | /* find the clock and enable it */ |
759 | 762 | ||
760 | i2c->dev = &pdev->dev; | 763 | i2c->dev = &pdev->dev; |
@@ -832,7 +835,15 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) | |||
832 | dev_dbg(&pdev->dev, "irq resource %p (%lu)\n", res, | 835 | dev_dbg(&pdev->dev, "irq resource %p (%lu)\n", res, |
833 | (unsigned long)res->start); | 836 | (unsigned long)res->start); |
834 | 837 | ||
835 | ret = i2c_add_adapter(&i2c->adap); | 838 | /* Note, previous versions of the driver used i2c_add_adapter() |
839 | * to add the bus at any number. We now pass the bus number via | ||
840 | * the platform data, so if unset it will now default to always | ||
841 | * being bus 0. | ||
842 | */ | ||
843 | |||
844 | i2c->adap.nr = pdata->bus_num; | ||
845 | |||
846 | ret = i2c_add_numbered_adapter(&i2c->adap); | ||
836 | if (ret < 0) { | 847 | if (ret < 0) { |
837 | dev_err(&pdev->dev, "failed to add bus to i2c core\n"); | 848 | dev_err(&pdev->dev, "failed to add bus to i2c core\n"); |
838 | goto err_irq; | 849 | goto err_irq; |
diff --git a/include/asm-arm/plat-s3c/iic.h b/include/asm-arm/plat-s3c/iic.h index 71211c8b5384..d08a1f2863e4 100644 --- a/include/asm-arm/plat-s3c/iic.h +++ b/include/asm-arm/plat-s3c/iic.h | |||
@@ -21,6 +21,7 @@ | |||
21 | */ | 21 | */ |
22 | 22 | ||
23 | struct s3c2410_platform_i2c { | 23 | struct s3c2410_platform_i2c { |
24 | int bus_num; /* bus number to use */ | ||
24 | unsigned int flags; | 25 | unsigned int flags; |
25 | unsigned int slave_addr; /* slave address for controller */ | 26 | unsigned int slave_addr; /* slave address for controller */ |
26 | unsigned long bus_freq; /* standard bus frequency */ | 27 | unsigned long bus_freq; /* standard bus frequency */ |