aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2013-06-19 19:51:18 -0400
committerArnd Bergmann <arnd@arndb.de>2013-06-19 19:51:18 -0400
commitc3b693d1d63444afe4fbf809d8a311b63741e503 (patch)
tree5c0c264203967f1524ac28645f0b5cea57b624bc /drivers/i2c
parent596fd95ea606548adaa8310a7c05a6dcfec46f16 (diff)
parent7fca1f20c0f3e9d7a3b23ee1fc9e832f520f3f1a (diff)
Merge tag 'u300-multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson into next/soc
From Linus Walleij: Device Tree and Multiplatform support for U300: - Add devicetree support to timer, pinctrl (probe), I2C block, watchdog, DMA controller and clocks. - Piecewise add a device tree containing all peripherals. - Delete the ATAG boot path. - Delete redundant platform data and board files. - Convert to multiplatform. * tag 'u300-multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson: (40 commits) ARM: u300: switch to using syscon regmap for board ARM: u300: Update MMC configs for u300 defconfig spi: pl022: use DMA by default when probing from DT pinctrl: get rid of all platform data for coh901 ARM: u300: convert MMC/SD clock to device tree ARM: u300: move the gated system controller clocks to DT i2c: stu300: do not request a specific clock name clk: move the U300 fixed and fixed-factor to DT ARM: u300: remove register definition file ARM: u300: add syscon node ARM: u300 use module_spi_driver to register driver ARM: u300: delete remnant machine headers ARM: u300: convert to multiplatform ARM: u300: localize <mach/u300-regs.h> ARM: u300: delete <mach/irqs.h> ARM: u300: delete <mach/hardware.h> ARM: u300: push down syscon registers ARM: u300: remove deps from debug macro ARM: u300: move debugmacro to debug includes ARM: u300: delete all static board data ... Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-stu300.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
index 0a6f941133f6..d1a6b204af00 100644
--- a/drivers/i2c/busses/i2c-stu300.c
+++ b/drivers/i2c/busses/i2c-stu300.c
@@ -17,6 +17,7 @@
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/of_i2c.h>
20 21
21/* the name of this kernel module */ 22/* the name of this kernel module */
22#define NAME "stu300" 23#define NAME "stu300"
@@ -867,7 +868,6 @@ stu300_probe(struct platform_device *pdev)
867 struct resource *res; 868 struct resource *res;
868 int bus_nr; 869 int bus_nr;
869 int ret = 0; 870 int ret = 0;
870 char clk_name[] = "I2C0";
871 871
872 dev = devm_kzalloc(&pdev->dev, sizeof(struct stu300_dev), GFP_KERNEL); 872 dev = devm_kzalloc(&pdev->dev, sizeof(struct stu300_dev), GFP_KERNEL);
873 if (!dev) { 873 if (!dev) {
@@ -876,8 +876,7 @@ stu300_probe(struct platform_device *pdev)
876 } 876 }
877 877
878 bus_nr = pdev->id; 878 bus_nr = pdev->id;
879 clk_name[3] += (char)bus_nr; 879 dev->clk = devm_clk_get(&pdev->dev, NULL);
880 dev->clk = devm_clk_get(&pdev->dev, clk_name);
881 if (IS_ERR(dev->clk)) { 880 if (IS_ERR(dev->clk)) {
882 dev_err(&pdev->dev, "could not retrieve i2c bus clock\n"); 881 dev_err(&pdev->dev, "could not retrieve i2c bus clock\n");
883 return PTR_ERR(dev->clk); 882 return PTR_ERR(dev->clk);
@@ -923,6 +922,7 @@ stu300_probe(struct platform_device *pdev)
923 adap->nr = bus_nr; 922 adap->nr = bus_nr;
924 adap->algo = &stu300_algo; 923 adap->algo = &stu300_algo;
925 adap->dev.parent = &pdev->dev; 924 adap->dev.parent = &pdev->dev;
925 adap->dev.of_node = pdev->dev.of_node;
926 i2c_set_adapdata(adap, dev); 926 i2c_set_adapdata(adap, dev);
927 927
928 /* i2c device drivers may be active on return from add_adapter() */ 928 /* i2c device drivers may be active on return from add_adapter() */
@@ -934,6 +934,10 @@ stu300_probe(struct platform_device *pdev)
934 } 934 }
935 935
936 platform_set_drvdata(pdev, dev); 936 platform_set_drvdata(pdev, dev);
937 dev_info(&pdev->dev, "ST DDC I2C @ %p, irq %d\n",
938 dev->virtbase, dev->irq);
939 of_i2c_register_devices(adap);
940
937 return 0; 941 return 0;
938} 942}
939 943
@@ -978,11 +982,17 @@ stu300_remove(struct platform_device *pdev)
978 return 0; 982 return 0;
979} 983}
980 984
985static const struct of_device_id stu300_dt_match[] = {
986 { .compatible = "st,ddci2c" },
987 {},
988};
989
981static struct platform_driver stu300_i2c_driver = { 990static struct platform_driver stu300_i2c_driver = {
982 .driver = { 991 .driver = {
983 .name = NAME, 992 .name = NAME,
984 .owner = THIS_MODULE, 993 .owner = THIS_MODULE,
985 .pm = STU300_I2C_PM, 994 .pm = STU300_I2C_PM,
995 .of_match_table = stu300_dt_match,
986 }, 996 },
987 .remove = __exit_p(stu300_remove), 997 .remove = __exit_p(stu300_remove),
988 998