<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.linux.drivers.i2c">
    <title>gmane.linux.drivers.i2c</title>
    <link>http://blog.gmane.org/gmane.linux.drivers.i2c</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15268"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15267"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15266"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15263"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15257"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15252"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15251"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15246"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15242"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15240"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15231"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15200"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15175"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15174"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15169"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15164"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15157"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15156"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15155"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.drivers.i2c/15153"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15268">
    <title>[PATCH RFC v3 1/3] i2c: i2c-bfin-twi: convert to devm_* API</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15268</link>
    <description>&lt;pre&gt;peripheral_request_list has got free if any one faild, so no need to free again in err case.
aovid this, convert them to devm_* API

Signed-off-by: Libo Chen &amp;lt;libo.chen-hv44wF8Li93QT0dZR+AlfA&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 drivers/i2c/busses/i2c-bfin-twi.c |   38 +++++++++---------------------------
 1 files changed, 10 insertions(+), 28 deletions(-)

diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c
index 05080c4..2b99c48 100644
--- a/drivers/i2c/busses/i2c-bfin-twi.c
+++ b/drivers/i2c/busses/i2c-bfin-twi.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -621,35 +621,27 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int i2c_bfin_twi_probe(struct platform_device *pdev)
 int rc;
 unsigned int clkhilow;
 
-iface = kzalloc(sizeof(struct bfin_twi_iface), GFP_KERNEL);
+iface = devm_kzalloc(&amp;amp;pdev-&amp;gt;dev, sizeof(struct bfin_twi_iface),
+GFP_KERNEL);
 if (!iface) {
 dev_err(&amp;amp;pdev-&amp;gt;dev, "Cannot allocate memory\n");
-rc = -ENOMEM;
-goto out_error_nomem;
+return -ENOMEM;
 }
 
 spin_lock_init(&amp;amp;(iface-&amp;gt;lock));
 
 /* Find and map our resources */
 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-if (res == NULL) {
-dev_err(&amp;amp;pdev-&amp;gt;dev, "Cannot get IORESOURCE_MEM\n");
-rc = -ENOENT;
-goto out_error_get_res;
-}
-
-iface-&amp;gt;regs_base = ioremap(res-&amp;gt;start, resource_size(res));
-if (iface-&amp;gt;regs_base == NULL) {
+iface-&amp;gt;regs_base = devm_ioremap_resource(&amp;amp;pdev-&amp;gt;dev, res);
+if (IS_ERR(iface-&amp;gt;regs_base)) {
 dev_err(&amp;amp;pdev-&amp;gt;dev, "Cannot map IO\n");
-rc = -ENXIO;
-goto out_error_ioremap;
+return -ENXIO;
 }
 
 iface-&amp;gt;irq = platform_get_irq(pdev, 0);
 if (iface-&amp;gt;irq &amp;lt; 0) {
 dev_err(&amp;amp;pdev-&amp;gt;dev, "No IRQ specified\n");
-rc = -ENOENT;
-goto out_error_no_irq;
+return -ENOENT;
 }
 
 p_adap = &amp;amp;iface-&amp;gt;adap;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -666,10 +658,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int i2c_bfin_twi_probe(struct platform_device *pdev)
 "i2c-bfin-twi");
 if (rc) {
 dev_err(&amp;amp;pdev-&amp;gt;dev, "Can't setup pin mux!\n");
-goto out_error_pin_mux;
+return rc;
 }
 
-rc = request_irq(iface-&amp;gt;irq, bfin_twi_interrupt_entry,
+rc = devm_request_irq(&amp;amp;pdev-&amp;gt;dev, iface-&amp;gt;irq, bfin_twi_interrupt_entry,
 0, pdev-&amp;gt;name, iface);
 if (rc) {
 dev_err(&amp;amp;pdev-&amp;gt;dev, "Can't get IRQ %d !\n", iface-&amp;gt;irq);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -707,16 +699,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int i2c_bfin_twi_probe(struct platform_device *pdev)
 return 0;
 
 out_error_add_adapter:
-free_irq(iface-&amp;gt;irq, iface);
 out_error_req_irq:
-out_error_no_irq:
 peripheral_free_list((unsigned short *)pdev-&amp;gt;dev.platform_data);
-out_error_pin_mux:
-iounmap(iface-&amp;gt;regs_base);
-out_error_ioremap:
-out_error_get_res:
-kfree(iface);
-out_error_nomem:
+
 return rc;
 }
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -725,10 +710,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int i2c_bfin_twi_remove(struct platform_device *pdev)
 struct bfin_twi_iface *iface = platform_get_drvdata(pdev);
 
 i2c_del_adapter(&amp;amp;(iface-&amp;gt;adap));
-free_irq(iface-&amp;gt;irq, iface);
 peripheral_free_list((unsigned short *)pdev-&amp;gt;dev.platform_data);
-iounmap(iface-&amp;gt;regs_base);
-kfree(iface);
 
 return 0;
 }
&lt;/pre&gt;</description>
    <dc:creator>Libo Chen</dc:creator>
    <dc:date>2013-05-23T12:00:05</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15267">
    <title>[PATCH RFC v3 3/3] i2c: pxa: use module_platform_driver() replace init/exit</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15267</link>
    <description>&lt;pre&gt;use module_platform_driver() macro to replace the module init/exit

Signed-off-by: Libo Chen &amp;lt;libo.chen-hv44wF8Li93QT0dZR+AlfA&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 drivers/i2c/busses/i2c-pxa.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 7b10102..e9c3524 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1242,15 +1242,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static struct platform_driver i2c_pxa_driver = {
 .id_table= i2c_pxa_id_table,
 };
 
-static int __init i2c_adap_pxa_init(void)
-{
-return platform_driver_register(&amp;amp;i2c_pxa_driver);
-}
-
-static void __exit i2c_adap_pxa_exit(void)
-{
-platform_driver_unregister(&amp;amp;i2c_pxa_driver);
-}
+module_platform_driver(i2c_pxa_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:pxa2xx-i2c");
&lt;/pre&gt;</description>
    <dc:creator>Libo Chen</dc:creator>
    <dc:date>2013-05-23T12:00:11</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15266">
    <title>[PATCH] i2c: use platform_{get,set}_drvdata()</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15266</link>
    <description>&lt;pre&gt;Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &amp;amp;pdev-&amp;gt;dev,
so we can directly pass a struct platform_device.

Signed-off-by: Jingoo Han &amp;lt;jg1.han-Sze3O3UU22JBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 drivers/i2c/busses/i2c-cpm.c     |    4 ++--
 drivers/i2c/busses/i2c-ibm_iic.c |    4 ++--
 drivers/i2c/busses/i2c-mpc.c     |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
index 3823623..eccf5c2 100644
--- a/drivers/i2c/busses/i2c-cpm.c
+++ b/drivers/i2c/busses/i2c-cpm.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -646,7 +646,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int cpm_i2c_probe(struct platform_device *ofdev)
 
 cpm-&amp;gt;ofdev = ofdev;
 
-dev_set_drvdata(&amp;amp;ofdev-&amp;gt;dev, cpm);
+platform_set_drvdata(ofdev, cpm);
 
 cpm-&amp;gt;adap = cpm_ops;
 i2c_set_adapdata(&amp;amp;cpm-&amp;gt;adap, cpm);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -689,7 +689,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; out_free:
 
 static int cpm_i2c_remove(struct platform_device *ofdev)
 {
-struct cpm_i2c *cpm = dev_get_drvdata(&amp;amp;ofdev-&amp;gt;dev);
+struct cpm_i2c *cpm = platform_get_drvdata(ofdev);
 
 i2c_del_adapter(&amp;amp;cpm-&amp;gt;adap);
 
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index 405a2e2..973f516 100644
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ b/drivers/i2c/busses/i2c-ibm_iic.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -705,7 +705,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int iic_probe(struct platform_device *ofdev)
 return -ENOMEM;
 }
 
-dev_set_drvdata(&amp;amp;ofdev-&amp;gt;dev, dev);
+platform_set_drvdata(ofdev, dev);
 
 dev-&amp;gt;vaddr = of_iomap(np, 0);
 if (dev-&amp;gt;vaddr == NULL) {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -782,7 +782,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; error_cleanup:
  */
 static int iic_remove(struct platform_device *ofdev)
 {
-struct ibm_iic_private *dev = dev_get_drvdata(&amp;amp;ofdev-&amp;gt;dev);
+struct ibm_iic_private *dev = platform_get_drvdata(ofdev);
 
 i2c_del_adapter(&amp;amp;dev-&amp;gt;adap);
 
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index 5e705ee..7607dc0 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -679,7 +679,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int fsl_i2c_probe(struct platform_device *op)
 }
 dev_info(i2c-&amp;gt;dev, "timeout %u us\n", mpc_ops.timeout * 1000000 / HZ);
 
-dev_set_drvdata(&amp;amp;op-&amp;gt;dev, i2c);
+platform_set_drvdata(op, i2c);
 
 i2c-&amp;gt;adap = mpc_ops;
 i2c_set_adapdata(&amp;amp;i2c-&amp;gt;adap, i2c);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -707,7 +707,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int fsl_i2c_probe(struct platform_device *op)
 
 static int fsl_i2c_remove(struct platform_device *op)
 {
-struct mpc_i2c *i2c = dev_get_drvdata(&amp;amp;op-&amp;gt;dev);
+struct mpc_i2c *i2c = platform_get_drvdata(op);
 
 i2c_del_adapter(&amp;amp;i2c-&amp;gt;adap);
 
&lt;/pre&gt;</description>
    <dc:creator>Jingoo Han</dc:creator>
    <dc:date>2013-05-23T10:22:40</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15263">
    <title>i2cget with 16-bit address, 16-bit data</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15263</link>
    <description>&lt;pre&gt;I'm trying to read data from a SGTL5000 audio CODEC, which has 16-bit addresses and 16-bit wide data registers.

Unless I'm missing something, it looks impossible to read these registers using i2cget, because it only supports 8-bit addresses. Is there any other similar tool, or should I patch i2cget to support 16-bit addresses?

Regards,
Craig McQueen

&lt;/pre&gt;</description>
    <dc:creator>Craig McQueen</dc:creator>
    <dc:date>2013-05-23T04:27:20</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15257">
    <title>[PATCH] i2c: designware: prevent signals from aborting I2C transfers</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15257</link>
    <description>&lt;pre&gt;If a process receives signal while it is waiting for I2C transfer to
complete, an error is returned to the caller and the transfer is aborted.
This can cause the driver to fail subsequent transfers. Also according to
commit d295a86eab2 (i2c: mv64xxx: work around signals causing I2C
transactions to be aborted) I2C drivers aren't supposed to abort
transactions on signals.

To prevent this switch to use wait_for_completion_timeout() instead of
wait_for_completion_interruptible_timeout() in the designware I2C driver.

Signed-off-by: Mika Westerberg &amp;lt;mika.westerberg-VuQAYsv1563Yd54FQh9/CA&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 drivers/i2c/busses/i2c-designware-core.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index c41ca63..db20a28 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -580,14 +580,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
 i2c_dw_xfer_init(dev);
 
 /* wait for tx to complete */
-ret = wait_for_completion_interruptible_timeout(&amp;amp;dev-&amp;gt;cmd_complete, HZ);
+ret = wait_for_completion_timeout(&amp;amp;dev-&amp;gt;cmd_complete, HZ);
 if (ret == 0) {
 dev_err(dev-&amp;gt;dev, "controller timed out\n");
 i2c_dw_init(dev);
 ret = -ETIMEDOUT;
 goto done;
-} else if (ret &amp;lt; 0)
-goto done;
+}
 
 if (dev-&amp;gt;msg_err) {
 ret = dev-&amp;gt;msg_err;
&lt;/pre&gt;</description>
    <dc:creator>Mika Westerberg</dc:creator>
    <dc:date>2013-05-22T10:03:11</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15252">
    <title>[PATCH 1/2] drivers/macintosh: Remove obsolete cleanup for clientdata</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15252</link>
    <description>&lt;pre&gt;A few new i2c-drivers came into the kernel which clear the clientdata-pointer
on exit or error. This is obsolete meanwhile, the core will do it.

Signed-off-by: Wolfram Sang &amp;lt;wsa-z923LK4zBo2bacvFa/9K2g&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 drivers/macintosh/windfarm_smu_sat.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c
index d87f5ee..ad6223e 100644
--- a/drivers/macintosh/windfarm_smu_sat.c
+++ b/drivers/macintosh/windfarm_smu_sat.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -343,7 +343,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int wf_sat_remove(struct i2c_client *client)
 wf_unregister_sensor(&amp;amp;sens-&amp;gt;sens);
 }
 sat-&amp;gt;i2c = NULL;
-i2c_set_clientdata(client, NULL);
 kref_put(&amp;amp;sat-&amp;gt;ref, wf_sat_release);
 
 return 0;
&lt;/pre&gt;</description>
    <dc:creator>Wolfram Sang</dc:creator>
    <dc:date>2013-05-21T18:45:40</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15251">
    <title>[PULL REQUEST] i2c for 3.10</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15251</link>
    <description>&lt;pre&gt;Linus,

please pull the bugfixes for the i2c subsystem. Those should have been
in rc1 but I missed it due to working on devm longer than expected.
There is one ID addition, since we are touching the driver anyhow. And
the feature bit documentation is one outcome of a debug session and will
make it easier for users to work around problems. The rest is typical
driver bugfixes.

Please pull.

Thanks,

   Wolfram


The following changes since commit f722406faae2d073cc1d01063d1123c35425939e:

  Linux 3.10-rc1 (2013-05-11 17:14:08 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-current

for you to fetch changes up to e9b526fe704812364bca07edd15eadeba163ebfb:

  i2c: suppress lockdep warning on delete_device (2013-05-17 22:49:45 +0200)

----------------------------------------------------------------
Alexander Sverdlin (1):
      i2c: suppress lockdep warning on delete_device

Jean Delvare (1):
      i2c: i801: Document feature bits in modinfo

Josef Ahmad (1):
      i2c: designware: fix RX FIFO overrun

Mika Westerberg (2):
      i2c: designware: always clear interrupts before enabling them
      i2c: designware: add Intel BayTrail ACPI ID

Russell King (1):
      i2c: mv64xxx: work around signals causing I2C transactions to be aborted

 drivers/i2c/busses/i2c-designware-core.c    |   14 ++++++++++++--
 drivers/i2c/busses/i2c-designware-core.h    |    2 ++
 drivers/i2c/busses/i2c-designware-platdrv.c |    1 +
 drivers/i2c/busses/i2c-i801.c               |    6 +++++-
 drivers/i2c/busses/i2c-mv64xxx.c            |    8 ++++----
 drivers/i2c/i2c-core.c                      |    3 ++-
 6 files changed, 26 insertions(+), 8 deletions(-)
&lt;/pre&gt;</description>
    <dc:creator>Wolfram Sang</dc:creator>
    <dc:date>2013-05-21T18:11:20</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15246">
    <title>[PATCH] i2c: i2c-designware: Fix compilation warning</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15246</link>
    <description>&lt;pre&gt;
Fix the following compilation warning when CONFIG_PM_RUNTIME is not enabled:

drivers/i2c/busses/i2c-designware-pcidrv.c:188: warning: 'i2c_dw_pci_runtime_idle' defined but not used

Signed-off-by: EunBong Song &amp;lt;eunb.song&amp;lt; at &amp;gt;samsung.com&amp;gt;
---
 drivers/i2c/busses/i2c-designware-pcidrv.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
index f6ed06c..2b5d3a6 100644
--- a/drivers/i2c/busses/i2c-designware-pcidrv.c
+++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -185,6 +185,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int i2c_dw_pci_resume(struct device *dev)
 return 0;
 }
 
+#ifdef CONFIG_PM_RUNTIME
 static int i2c_dw_pci_runtime_idle(struct device *dev)
 {
 int err = pm_schedule_suspend(dev, 500);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -194,6 +195,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int i2c_dw_pci_runtime_idle(struct device *dev)
 return 0;
 return -EBUSY;
 }
+#endif
 
 static const struct dev_pm_ops i2c_dw_pm_ops = {
 .resume         = i2c_dw_pci_resume,
&lt;/pre&gt;</description>
    <dc:creator>EUNBONG SONG</dc:creator>
    <dc:date>2013-05-20T23:55:50</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15242">
    <title>Скрытые материалы</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15242</link>
    <description>&lt;pre&gt;  Убыстренное обучение. постичь британский язык сегодня понятно любому . Проделать свою практику поразнообразнее, вспыхнуть достойным делом. Купить можно здесь: http://goo.gl/5GUPp . 
 
&lt;/pre&gt;</description>
    <dc:creator>лидуля</dc:creator>
    <dc:date>2013-05-20T05:05:24</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15240">
    <title>[PATCH] i2c-piix4 - Add support for secondary SMBus on AMD SB800 and AMD FCH chipsets</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15240</link>
    <description>&lt;pre&gt;Hello all,

Attached patch adds support for secondary SMBus of AMD SB800 and new AMD FCH 
chipsets. The base address of secondary SMBus is different from SB700 and it is 
stored on similar place as SB800 primary SMBus.

More verbose info:

Probing function was just modified to read the SMBus base from address 0x28 or 
from original 0x2c. The secondary bus does not provide IRQ information.

I think the SB700 has same secondary controller, so revision/IRQ information 
should not be printed too. This can be fixed in some other patch.

Chipset datasheet can be found here: 
http://support.amd.com/us/Embedded_TechDocs/45482.pdf

Tested on SB800 and FCH boards.

Tested-by: Paul Menzel &amp;lt;paulepanter-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
ASRock E350M1 with SB800

Signed-off-by: Rudolf Marek &amp;lt;r.marek-/xGekIyIa4Ap1Coe8Ar9gA&amp;lt; at &amp;gt;public.gmane.org&amp;gt;

Thanks
Rudolf
&lt;/pre&gt;</description>
    <dc:creator>Rudolf Marek</dc:creator>
    <dc:date>2013-05-17T22:46:05</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15231">
    <title>[PATCH] i2c: suppress lockdep warning on delete_device</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15231</link>
    <description>&lt;pre&gt;i2c: suppress lockdep warning on delete_device

Since commit 846f99749ab68bbc7f75c74fec305de675b1a1bf the following lockdep
warning is thrown in case i2c device is removed (via delete_device sysfs
attribute) which contains subdevices (e.g. i2c multiplexer):

=============================================
[ INFO: possible recursive locking detected ]
3.8.7-0-sampleversion-fct #8 Tainted: G           O
---------------------------------------------
bash/3743 is trying to acquire lock:
  (s_active#110){++++.+}, at: [&amp;lt;ffffffff802b3048&amp;gt;] sysfs_hash_and_remove+0x58/0xc8

but task is already holding lock:
  (s_active#110){++++.+}, at: [&amp;lt;ffffffff802b3cb8&amp;gt;] sysfs_write_file+0xc8/0x208

other info that might help us debug this:
  Possible unsafe locking scenario:

        CPU0
        ----
   lock(s_active#110);
   lock(s_active#110);

  *** DEADLOCK ***

  May be due to missing lock nesting notation

4 locks held by bash/3743:
  #0:  (&amp;amp;buffer-&amp;gt;mutex){+.+.+.}, at: [&amp;lt;ffffffff802b3c3c&amp;gt;] sysfs_write_file+0x4c/0x208
  #1:  (s_active#110){++++.+}, at: [&amp;lt;ffffffff802b3cb8&amp;gt;] sysfs_write_file+0xc8/0x208
  #2:  (&amp;amp;adap-&amp;gt;userspace_clients_lock/1){+.+.+.}, at: [&amp;lt;ffffffff80454a18&amp;gt;] i2c_sysfs_delete_device+0x90/0x238
  #3:  (&amp;amp;__lockdep_no_validate__){......}, at: [&amp;lt;ffffffff803dcc24&amp;gt;] device_release_driver+0x24/0x48

stack backtrace:
Call Trace:
[&amp;lt;ffffffff80575cc8&amp;gt;] dump_stack+0x8/0x34
[&amp;lt;ffffffff801b50fc&amp;gt;] __lock_acquire+0x161c/0x2110
[&amp;lt;ffffffff801b5c3c&amp;gt;] lock_acquire+0x4c/0x70
[&amp;lt;ffffffff802b60cc&amp;gt;] sysfs_addrm_finish+0x19c/0x1e0
[&amp;lt;ffffffff802b3048&amp;gt;] sysfs_hash_and_remove+0x58/0xc8
[&amp;lt;ffffffff802b7d8c&amp;gt;] sysfs_remove_group+0x64/0x148
[&amp;lt;ffffffff803d990c&amp;gt;] device_remove_attrs+0x9c/0x1a8
[&amp;lt;ffffffff803d9b1c&amp;gt;] device_del+0x104/0x1d8
[&amp;lt;ffffffff803d9c18&amp;gt;] device_unregister+0x28/0x70
[&amp;lt;ffffffff8045505c&amp;gt;] i2c_del_adapter+0x1cc/0x328
[&amp;lt;ffffffff8045802c&amp;gt;] i2c_del_mux_adapter+0x14/0x38
[&amp;lt;ffffffffc025c108&amp;gt;] pca954x_remove+0x90/0xe0 [pca954x]
[&amp;lt;ffffffff804542f8&amp;gt;] i2c_device_remove+0x80/0xe8
[&amp;lt;ffffffff803dca9c&amp;gt;] __device_release_driver+0x74/0xf8
[&amp;lt;ffffffff803dcc2c&amp;gt;] device_release_driver+0x2c/0x48
[&amp;lt;ffffffff803dbc14&amp;gt;] bus_remove_device+0x13c/0x1d8
[&amp;lt;ffffffff803d9b24&amp;gt;] device_del+0x10c/0x1d8
[&amp;lt;ffffffff803d9c18&amp;gt;] device_unregister+0x28/0x70
[&amp;lt;ffffffff80454b08&amp;gt;] i2c_sysfs_delete_device+0x180/0x238
[&amp;lt;ffffffff802b3cd4&amp;gt;] sysfs_write_file+0xe4/0x208
[&amp;lt;ffffffff8023ddc4&amp;gt;] vfs_write+0xbc/0x160
[&amp;lt;ffffffff8023df6c&amp;gt;] SyS_write+0x54/0xd8
[&amp;lt;ffffffff8013d424&amp;gt;] handle_sys64+0x44/0x64

The problem is already known for USB and PCI subsystems. The reason is that
delete_device attribute is defined statically in i2c-core.c and used for all
devices in i2c subsystem.

Discussion of original USB problem:
http://lkml.indiana.edu/hypermail/linux/kernel/1204.3/01160.html

Commit 356c05d58af05d582e634b54b40050c73609617b introduced new macro to suppress
lockdep warnings for this special case and included workaround for USB code.

LKML discussion of the workaround:
http://lkml.indiana.edu/hypermail/linux/kernel/1205.1/03634.html

As i2c case is in principle the same, the same workaround could be used here.

Signed-off-by: Alexander Sverdlin &amp;lt;alexander.sverdlin-OYasijW0DpE&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Cc: Eric W. Biederman &amp;lt;ebiederm-aS9lmoZGLiVWk0Htik3J/w&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Cc: Tejun Heo &amp;lt;tj-DgEjT+Ai2ygdnm+yROfE0A&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Cc: Alan Stern &amp;lt;stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Cc: Peter Zijlstra &amp;lt;peterz-wEGCiKHe2LqWVfeAwA7xHQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Cc: Greg Kroah-Hartman &amp;lt;gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---

--- linux-next.orig/drivers/i2c/i2c-core.c
+++ linux-next/drivers/i2c/i2c-core.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -892,7 +892,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; i2c_sysfs_delete_device(struct device *d
  }

  static DEVICE_ATTR(new_device, S_IWUSR, NULL, i2c_sysfs_new_device);
-static DEVICE_ATTR(delete_device, S_IWUSR, NULL, i2c_sysfs_delete_device);
+static DEVICE_ATTR_IGNORE_LOCKDEP(delete_device, S_IWUSR, NULL,
+                                  i2c_sysfs_delete_device);

  static struct attribute *i2c_adapter_attrs[] = {
  &amp;amp;dev_attr_name.attr,
&lt;/pre&gt;</description>
    <dc:creator>Alexander Sverdlin</dc:creator>
    <dc:date>2013-05-17T12:56:35</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15200">
    <title>i2c beginner question</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15200</link>
    <description>&lt;pre&gt;Hallo,

I have to collect data from multiple external i2c devices.
My question is, what is the correct way?

1: Open i2-device-file, set slave address, read data, close i2c device 
file and go on with the next one
2: keep the i2c device file open all the time, and change slave address 
before every access to device
3: ???

greets
Dirk
&lt;/pre&gt;</description>
    <dc:creator>Dirk Reske</dc:creator>
    <dc:date>2013-05-16T21:13:39</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15175">
    <title>[PATCH] I2C-mv64xxx.c: work around signals causing I2C transactions to be aborted</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15175</link>
    <description>&lt;pre&gt;Do not use interruptible waits in an I2C driver; if a process uses
signals (eg, Xorg uses SIGALRM and SIGPIPE) then these signals can
cause the I2C driver to abort a transaction in progress by another
driver, which can cause that driver to fail.  I2C drivers are not
expected to abort transactions on signals.

Cc: &amp;lt;stable-u79uwXL29TY76Z2rM5mHXA&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Signed-off-by: Russell King &amp;lt;rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Tested-by: Russell King &amp;lt;rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
Mark Greer seems to be unreachable now; the address in this driver no
longer works, and there is no maintainer entry.  This patch has been
run on my Cubox (Marvell Dove) for quite a number of months without
ill effect.

 drivers/i2c/busses/i2c-mv64xxx.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 2e9d567..44d8045 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -252,7 +252,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; mv64xxx_i2c_do_action(struct mv64xxx_i2c_data *drv_data)
 writel(drv_data-&amp;gt;cntl_bits,
 drv_data-&amp;gt;reg_base + MV64XXX_I2C_REG_CONTROL);
 drv_data-&amp;gt;block = 0;
-wake_up_interruptible(&amp;amp;drv_data-&amp;gt;waitq);
+wake_up(&amp;amp;drv_data-&amp;gt;waitq);
 break;
 
 case MV64XXX_I2C_ACTION_CONTINUE:
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -300,7 +300,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; mv64xxx_i2c_do_action(struct mv64xxx_i2c_data *drv_data)
 writel(drv_data-&amp;gt;cntl_bits | MV64XXX_I2C_REG_CONTROL_STOP,
 drv_data-&amp;gt;reg_base + MV64XXX_I2C_REG_CONTROL);
 drv_data-&amp;gt;block = 0;
-wake_up_interruptible(&amp;amp;drv_data-&amp;gt;waitq);
+wake_up(&amp;amp;drv_data-&amp;gt;waitq);
 break;
 
 case MV64XXX_I2C_ACTION_INVALID:
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -315,7 +315,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; mv64xxx_i2c_do_action(struct mv64xxx_i2c_data *drv_data)
 writel(drv_data-&amp;gt;cntl_bits | MV64XXX_I2C_REG_CONTROL_STOP,
 drv_data-&amp;gt;reg_base + MV64XXX_I2C_REG_CONTROL);
 drv_data-&amp;gt;block = 0;
-wake_up_interruptible(&amp;amp;drv_data-&amp;gt;waitq);
+wake_up(&amp;amp;drv_data-&amp;gt;waitq);
 break;
 }
 }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -381,7 +381,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; mv64xxx_i2c_wait_for_completion(struct mv64xxx_i2c_data *drv_data)
 unsigned longflags;
 charabort = 0;
 
-time_left = wait_event_interruptible_timeout(drv_data-&amp;gt;waitq,
+time_left = wait_event_timeout(drv_data-&amp;gt;waitq,
 !drv_data-&amp;gt;block, drv_data-&amp;gt;adapter.timeout);
 
 spin_lock_irqsave(&amp;amp;drv_data-&amp;gt;lock, flags);
&lt;/pre&gt;</description>
    <dc:creator>Russell King</dc:creator>
    <dc:date>2013-05-15T14:33:10</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15174">
    <title>[PATCH] i2c-i801: Document feature bits in modinfo</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15174</link>
    <description>&lt;pre&gt;Duplicate the feature bits documentation in modinfo, as not every user
will read the driver's source code or documentation file.

Signed-off-by: Jean Delvare &amp;lt;khali-PUYAD+kWke1g9hUCZPvPmw&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 drivers/i2c/busses/i2c-i801.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- linux-3.10-rc1.orig/drivers/i2c/busses/i2c-i801.c2013-04-29 02:36:01.000000000 +0200
+++ linux-3.10-rc1/drivers/i2c/busses/i2c-i801.c2013-05-15 12:42:11.573297161 +0200
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -231,7 +231,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static const char *i801_feature_names[]
 
 static unsigned int disable_features;
 module_param(disable_features, uint, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(disable_features, "Disable selected driver features");
+MODULE_PARM_DESC(disable_features, "Disable selected driver features:\n"
+"\t\t  0x01  disable SMBus PEC\n"
+"\t\t  0x02  disable the block buffer\n"
+"\t\t  0x08  disable the I2C block read functionality\n"
+"\t\t  0x10  don't use interrupts ");
 
 /* Make sure the SMBus host is ready to start transmitting.
    Return 0 if it is, -EBUSY if it is not. */


&lt;/pre&gt;</description>
    <dc:creator>Jean Delvare</dc:creator>
    <dc:date>2013-05-15T12:44:10</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15169">
    <title>[PATCH v2] i2c: core: make it possible to match a pure device tree driver</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15169</link>
    <description>&lt;pre&gt;This tries to address an issue found when writing an MFD driver
for the Nomadik STw481x PMICs: as the platform is using device
tree exclusively I want to specify the driver matching like
this:

static const struct of_device_id stw481x_match[] = {
{ .compatible = "st,stw4810", },
{ .compatible = "st,stw4811", },
{},
};

static struct i2c_driver stw481x_driver = {
.driver = {
.name= "stw481x",
.of_match_table = stw481x_match,
},
.probe= stw481x_probe,
.remove= stw481x_remove,
};

However that turns out not to be possible: the I2C probe code
is written so that the probe() call is always passed a match
from i2c_match_id() using non-devicetree matches.

This is probably why most devices using device tree for I2C
clients currently will pass no .of_match_table *at all* but
instead just use .id_table from struct i2c_driver to match
the device. As you realize that means that the whole idea with
compatible strings is discarded, and that is why we find strange
device tree I2C device compatible strings like "product" instead
of "vendor,product" as you could expect.

Let's figure out how to fix this before the mess spreads. This
patch will allow probeing devices with only an of_match_table
as per above, and will pass NULL as the second argument to the
probe() function. If the driver wants to deduce secondary info
from the struct of_device_id .data field, it has to call
of_match_device() on its own match table in the probe function
device tree probe path.

If drivers define both an .of_match_table *AND* a i2c_driver
.id_table, the .of_match_table will take precedence, just
as is done in the i2c_device_match() function in i2c-core.c.

I2C devices probed from device tree should subsequently be
fixed to handle the case where of_match_table() is
used (I think none of them do that today), and platforms should
fix their device trees to use compatible strings for I2C devices
instead of setting the name to Linux device driver names as is
done in multiple cases today.

Cc: Rob Herring &amp;lt;rob.herring-bsGFqQB8/DxBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Cc: Grant Likely &amp;lt;grant.likely-QSEj5FYQhm4dnm+yROfE0A&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Signed-off-by: Linus Walleij &amp;lt;linus.walleij-QSEj5FYQhm4dnm+yROfE0A&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
ChangeLog v1-&amp;gt;v2:
- Use of_match_device() to determine if there is a DT match in
  the probe code. If there is a match we pass NULL for the
  id_table match parameter.
---
 drivers/i2c/i2c-core.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 6b63cc7..17cd22a 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -240,7 +240,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int i2c_device_probe(struct device *dev)
 return 0;
 
 driver = to_i2c_driver(dev-&amp;gt;driver);
-if (!driver-&amp;gt;probe || !driver-&amp;gt;id_table)
+if (!driver-&amp;gt;probe || (!driver-&amp;gt;id_table &amp;amp;&amp;amp; !dev-&amp;gt;driver-&amp;gt;of_match_table))
 return -ENODEV;
 client-&amp;gt;driver = driver;
 if (!device_can_wakeup(&amp;amp;client-&amp;gt;dev))
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -248,7 +248,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int i2c_device_probe(struct device *dev)
 client-&amp;gt;flags &amp;amp; I2C_CLIENT_WAKE);
 dev_dbg(dev, "probe\n");
 
-status = driver-&amp;gt;probe(client, i2c_match_id(driver-&amp;gt;id_table, client));
+if (of_match_device(dev-&amp;gt;driver-&amp;gt;of_match_table, dev))
+/* Device tree matching */
+status = driver-&amp;gt;probe(client, NULL);
+else
+/* Fall back to matching the id_table */
+status = driver-&amp;gt;probe(client, i2c_match_id(driver-&amp;gt;id_table, client));
 if (status) {
 client-&amp;gt;driver = NULL;
 i2c_set_clientdata(client, NULL);
&lt;/pre&gt;</description>
    <dc:creator>Linus Walleij</dc:creator>
    <dc:date>2013-05-13T20:18:21</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15164">
    <title>[PATCH 1/2] i2c-designware: always clear interrupts before enabling them</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15164</link>
    <description>&lt;pre&gt;If the I2C bus is put to a low power state by an ACPI method it might pull
the SDA line low (as its power is removed). Once the bus is put to full
power state again, the SDA line is pulled back to high. This transition
looks like a STOP condition from the controller point-of-view which sets
STOP detected bit in its status register causing the driver to fail
subsequent transfers.

Fix this by always clearing all interrupts before we start a transfer.

Signed-off-by: Mika Westerberg &amp;lt;mika.westerberg-VuQAYsv1563Yd54FQh9/CA&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 drivers/i2c/busses/i2c-designware-core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 21fbb34..7a89ca5 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -383,7 +383,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void i2c_dw_xfer_init(struct dw_i2c_dev *dev)
 /* Enable the adapter */
 __i2c_dw_enable(dev, true);
 
-/* Enable interrupts */
+/* Clear and enable interrupts */
+i2c_dw_clear_int(dev);
 dw_writel(dev, DW_IC_INTR_DEFAULT_MASK, DW_IC_INTR_MASK);
 }
 
&lt;/pre&gt;</description>
    <dc:creator>Mika Westerberg</dc:creator>
    <dc:date>2013-05-13T10:54:30</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15157">
    <title>[PATCH] i2c: core: make it possible to match a pure device tree driver</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15157</link>
    <description>&lt;pre&gt;This tries to address an issue found when writing an MFD driver
for the Nomadik STw481x PMICs: as the platform is using device
tree exclusively I want to specify the driver matching like
this:

static const struct of_device_id stw481x_match[] = {
{ .compatible = "st,stw4810", },
{ .compatible = "st,stw4811", },
{},
};

static struct i2c_driver stw481x_driver = {
.driver = {
.name= "stw481x",
.of_match_table = stw481x_match,
},
.probe= stw481x_probe,
.remove= stw481x_remove,
};

However that turns out not to be possible: the I2C probe code
is written so that the probe() call is always passed a match
from i2c_match_id() using non-devicetree matches.

This is probably why most devices using device tree for I2C
clients currently will pass no .of_match_table *at all* but
instead just use .id_table from struct i2c_driver to match
the device. As you realize that means that the whole idea with
compatible strings is discarded, and that is why we find strange
device tree I2C device compatible strings like "product" instead
of "vendor,product" as you could expect.

Let's figure out how to fix this before the mess spreads. This
patch will allow probeing devices with only an of_match_table
as per above, and will pass NULL as the second argument to the
probe() function. If the driver wants to deduce secondary info
from the struct of_device_id .data field, it has to call
of_match_device() on its own match table in the probe function
device tree probe path.

If drivers define both an .of_match_table *AND* a i2c_driver
.id_table, the .of_match_table will take precedence, just
as is done in the i2c_device_match() function in i2c-core.c.

I2C devices probed from device tree should subsequently be
fixed to handle the case where of_match_table() is
used (I think none of them do that today), and platforms should
fix their device trees to use compatible strings for I2C devices
instead of setting the name to Linux device driver names as is
done in multiple cases today.

Cc: Rob Herring &amp;lt;rob.herring-bsGFqQB8/DxBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Cc: Grant Likely &amp;lt;grant.likely-QSEj5FYQhm4dnm+yROfE0A&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Signed-off-by: Linus Walleij &amp;lt;linus.walleij-QSEj5FYQhm4dnm+yROfE0A&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
I would need some device tree core people to confirm that I am
on the right track with this. I was soooo confused when I found
that .of_match_table could not be used with I2C devices...
---
 drivers/i2c/i2c-core.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 6b63cc7..30b5bb2 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -240,7 +240,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int i2c_device_probe(struct device *dev)
 return 0;
 
 driver = to_i2c_driver(dev-&amp;gt;driver);
-if (!driver-&amp;gt;probe || !driver-&amp;gt;id_table)
+if (!driver-&amp;gt;probe || (!driver-&amp;gt;id_table &amp;amp;&amp;amp; !dev-&amp;gt;driver-&amp;gt;of_match_table))
 return -ENODEV;
 client-&amp;gt;driver = driver;
 if (!device_can_wakeup(&amp;amp;client-&amp;gt;dev))
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -248,7 +248,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int i2c_device_probe(struct device *dev)
 client-&amp;gt;flags &amp;amp; I2C_CLIENT_WAKE);
 dev_dbg(dev, "probe\n");
 
-status = driver-&amp;gt;probe(client, i2c_match_id(driver-&amp;gt;id_table, client));
+if (dev-&amp;gt;driver-&amp;gt;of_match_table)
+/* Device tree matching */
+status = driver-&amp;gt;probe(client, NULL);
+else
+/* Fall back to matching the id_table */
+status = driver-&amp;gt;probe(client, i2c_match_id(driver-&amp;gt;id_table, client));
 if (status) {
 client-&amp;gt;driver = NULL;
 i2c_set_clientdata(client, NULL);
&lt;/pre&gt;</description>
    <dc:creator>Linus Walleij</dc:creator>
    <dc:date>2013-05-12T22:26:23</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15156">
    <title>[PATCH] i2c: vt8500: Add support for I2C bus on Wondermedia SoCs</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15156</link>
    <description>&lt;pre&gt;This patch adds support for the I2C bus controllers found on Wondermedia
8xxx-series SoCs. Only master-mode is supported.

Signed-off-by: Tony Prisk &amp;lt;linux-ci5G2KO2hbZ+pU9mqzGVBQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 .../devicetree/bindings/i2c/i2c-vt8500.txt         |   24 +
 MAINTAINERS                                        |    1 +
 drivers/i2c/busses/Kconfig                         |   10 +
 drivers/i2c/busses/Makefile                        |    1 +
 drivers/i2c/busses/i2c-wmt.c                       |  488 ++++++++++++++++++++
 5 files changed, 524 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-vt8500.txt
 create mode 100644 drivers/i2c/busses/i2c-wmt.c

diff --git a/Documentation/devicetree/bindings/i2c/i2c-vt8500.txt b/Documentation/devicetree/bindings/i2c/i2c-vt8500.txt
new file mode 100644
index 0000000..94a425e
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-vt8500.txt
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,24 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+* Wondermedia I2C Controller
+
+Required properties :
+
+ - compatible : should be "wm,wm8505-i2c"
+ - reg : Offset and length of the register set for the device
+ - interrupts : &amp;lt;IRQ&amp;gt; where IRQ is the interrupt number
+ - clocks : phandle to the I2C clock source
+
+Optional properties :
+
+ - clock-frequency : desired I2C bus clock frequency in Hz.
+Valid values are 100000 and 400000.
+Default to 100000 if not specified, or invalid value.
+
+Example :
+
+i2c_0: i2c&amp;lt; at &amp;gt;d8280000 {
+compatible = "wm,wm8505-i2c";
+reg = &amp;lt;0xd8280000 0x1000&amp;gt;;
+interrupts = &amp;lt;19&amp;gt;;
+clocks = &amp;lt;&amp;amp;clki2c0&amp;gt;;
+clock-frequency = &amp;lt;400000&amp;gt;;
+};
diff --git a/MAINTAINERS b/MAINTAINERS
index 3d7782b..44ea994 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1285,6 +1285,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; S:Maintained
 F:arch/arm/mach-vt8500/
 F:drivers/clocksource/vt8500_timer.c
 F:drivers/gpio/gpio-vt8500.c
+F:drivers/i2c/busses/i2c-wmt.c
 F:drivers/mmc/host/wmt-sdmmc.c
 F:drivers/pwm/pwm-vt8500.c
 F:drivers/rtc/rtc-vt8500.c
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 631736e..89e7ec2 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -724,6 +724,16 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; config I2C_VERSATILE
   This driver can also be built as a module.  If so, the module
   will be called i2c-versatile.
 
+config I2C_WMT
+tristate "Wondermedia WM8xxx SoC I2C bus support"
+depends on ARCH_VT8500
+help
+  Say yes if you want to support the I2C bus on Wondermedia 8xxx-series
+  SoCs.
+
+  This driver can also be built as a module. If so, the module will be
+  called i2c-wmt.
+
 config I2C_OCTEON
 tristate "Cavium OCTEON I2C bus support"
 depends on CPU_CAVIUM_OCTEON
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
index 8f4fc23..3ba94a9 100644
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -71,6 +71,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; obj-$(CONFIG_I2C_SIRF)+= i2c-sirf.o
 obj-$(CONFIG_I2C_STU300)+= i2c-stu300.o
 obj-$(CONFIG_I2C_TEGRA)+= i2c-tegra.o
 obj-$(CONFIG_I2C_VERSATILE)+= i2c-versatile.o
+obj-$(CONFIG_I2C_WMT)+= i2c-wmt.o
 obj-$(CONFIG_I2C_OCTEON)+= i2c-octeon.o
 obj-$(CONFIG_I2C_XILINX)+= i2c-xiic.o
 obj-$(CONFIG_I2C_XLR)+= i2c-xlr.o
diff --git a/drivers/i2c/busses/i2c-wmt.c b/drivers/i2c/busses/i2c-wmt.c
new file mode 100644
index 0000000..5cebb29
--- /dev/null
+++ b/drivers/i2c/busses/i2c-wmt.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,488 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+/*
+ *  Wondermedia I2C Master Mode Driver
+ *
+ *  Copyright (C) 2012 Tony Prisk &amp;lt;linux-ci5G2KO2hbZ+pU9mqzGVBQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
+ *
+ *  Derived from GPLv2+ licensed source:
+ *  - Copyright (C) 2008 WonderMedia Technologies, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2, or
+ *  (at your option) any later version. as published by the Free Software
+ *  Foundation
+ */
+
+#include &amp;lt;linux/clk.h&amp;gt;
+#include &amp;lt;linux/delay.h&amp;gt;
+#include &amp;lt;linux/err.h&amp;gt;
+#include &amp;lt;linux/i2c.h&amp;gt;
+#include &amp;lt;linux/interrupt.h&amp;gt;
+#include &amp;lt;linux/io.h&amp;gt;
+#include &amp;lt;linux/module.h&amp;gt;
+#include &amp;lt;linux/of.h&amp;gt;
+#include &amp;lt;linux/of_address.h&amp;gt;
+#include &amp;lt;linux/of_i2c.h&amp;gt;
+#include &amp;lt;linux/of_irq.h&amp;gt;
+#include &amp;lt;linux/platform_device.h&amp;gt;
+
+#define REG_CR0x00
+#define REG_TCR0x02
+#define REG_CSR0x04
+#define REG_ISR0x06
+#define REG_IMR0x08
+#define REG_CDR0x0A
+#define REG_TR0x0C
+#define REG_MCR0x0E
+#define REG_SLAVE_CR0x10
+#define REG_SLAVE_SR0x12
+#define REG_SLAVE_ISR0x14
+#define REG_SLAVE_IMR0x16
+#define REG_SLAVE_DR0x18
+#define REG_SLAVE_TR0x1A
+
+/* REG_CR Bit fields */
+#define CR_TX_NEXT_ACK0x0000
+#define CR_ENABLE0x0001
+#define CR_TX_NEXT_NO_ACK0x0002
+#define CR_TX_END0x0004
+#define CR_CPU_RDY0x0008
+#define SLAV_MODE_SEL0x8000
+
+/* REG_TCR Bit fields */
+#define TCR_STANDARD_MODE0x0000
+#define TCR_MASTER_WRITE0x0000
+#define TCR_HS_MODE0x2000
+#define TCR_MASTER_READ0x4000
+#define TCR_FAST_MODE0x8000
+#define TCR_SLAVE_ADDR_MASK0x007F
+
+/* REG_ISR Bit fields */
+#define ISR_NACK_ADDR0x0001
+#define ISR_BYTE_END0x0002
+#define ISR_SCL_TIMEOUT0x0004
+#define ISR_WRITE_ALL0x0007
+
+/* REG_IMR Bit fields */
+#define IMR_ENABLE_ALL0x0007
+
+/* REG_CSR Bit fields */
+#define CSR_RCV_NOT_ACK0x0001
+#define CSR_RCV_ACK_MASK0x0001
+#define CSR_READY_MASK0x0002
+
+/* REG_TR */
+#define SCL_TIMEOUT(x)(((x) &amp;amp; 0xFF) &amp;lt;&amp;lt; 16)
+#define TR_STD0x0064
+#define TR_HS0x0019
+
+#define I2C_MODE_STANDARD0
+#define I2C_MODE_FAST1
+
+struct wmt_i2c_dev {
+struct i2c_adapteradapter;
+struct completioncomplete;
+struct device*dev;
+void __iomem*base;
+struct clk*clk;
+intmode;
+intirq;
+u16cmd_status;
+};
+
+static int wmt_i2c_wait_bus_not_busy(struct wmt_i2c_dev *i2c_dev)
+{
+u16 val;
+int i;
+int ret = 0;
+
+for (i = 0; i &amp;lt; 100000; i++) {
+val = readw(i2c_dev-&amp;gt;base + REG_CSR);
+if (val &amp;amp; CSR_READY_MASK)
+break;
+
+udelay(1);
+}
+if (i &amp;gt;= 9999999)
+ret = -EBUSY;
+
+return ret;
+}
+
+static int wmt_check_status(struct wmt_i2c_dev *i2c_dev)
+{
+int ret = 0;
+
+if (i2c_dev-&amp;gt;cmd_status &amp;amp; ISR_NACK_ADDR)
+ret = -EIO;
+
+if (i2c_dev-&amp;gt;cmd_status &amp;amp; ISR_SCL_TIMEOUT)
+ret = -ETIMEDOUT;
+
+return ret;
+}
+
+static int wmt_i2c_write(struct i2c_adapter *adap, struct i2c_msg *pmsg,
+   int restart, int last)
+{
+struct wmt_i2c_dev *i2c_dev = i2c_get_adapdata(adap);
+u16 val, tcr_val;
+int ret, wait_result;
+int xfer_len = 0;
+
+if (!restart) {
+ret = wmt_i2c_wait_bus_not_busy(i2c_dev);
+if (ret &amp;lt; 0)
+return ret;
+}
+
+if (pmsg-&amp;gt;len == 0) {
+/*
+ * We still need to run through the while (..) once, so
+ * start at -1 and break out early from the loop
+ */
+xfer_len = -1;
+writew(0, i2c_dev-&amp;gt;base + REG_CDR);
+} else {
+writew(pmsg-&amp;gt;buf[0] &amp;amp; 0xFF, i2c_dev-&amp;gt;base + REG_CDR);
+}
+
+if (!restart) {
+val = readw(i2c_dev-&amp;gt;base + REG_CR);
+val &amp;amp;= ~CR_TX_END;
+writew(val, i2c_dev-&amp;gt;base + REG_CR);
+
+val = readw(i2c_dev-&amp;gt;base + REG_CR);
+val |= CR_CPU_RDY;
+writew(val, i2c_dev-&amp;gt;base + REG_CR);
+}
+
+init_completion(&amp;amp;i2c_dev-&amp;gt;complete);
+
+if (i2c_dev-&amp;gt;mode == I2C_MODE_STANDARD)
+tcr_val = TCR_STANDARD_MODE;
+else
+tcr_val = TCR_FAST_MODE;
+
+tcr_val |= (TCR_MASTER_WRITE | (pmsg-&amp;gt;addr &amp;amp; TCR_SLAVE_ADDR_MASK));
+
+writew(tcr_val, i2c_dev-&amp;gt;base + REG_TCR);
+
+if (restart) {
+val = readw(i2c_dev-&amp;gt;base + REG_CR);
+val |= CR_CPU_RDY;
+writew(val, i2c_dev-&amp;gt;base + REG_CR);
+}
+
+while (xfer_len &amp;lt; pmsg-&amp;gt;len) {
+wait_result = wait_for_completion_timeout(&amp;amp;i2c_dev-&amp;gt;complete,
+  500 * HZ / 1000);
+
+if (wait_result == 0)
+return -ETIMEDOUT;
+
+ret = wmt_check_status(i2c_dev);
+if (ret)
+return ret;
+
+xfer_len++;
+
+val = readw(i2c_dev-&amp;gt;base + REG_CSR);
+if ((val &amp;amp; CSR_RCV_ACK_MASK) == CSR_RCV_NOT_ACK) {
+dev_dbg(i2c_dev-&amp;gt;dev, "write RCV NACK error\n");
+return -EIO;
+}
+
+if (pmsg-&amp;gt;len == 0) {
+val = CR_TX_END | CR_CPU_RDY | CR_ENABLE;
+writew(val, i2c_dev-&amp;gt;base + REG_CR);
+break;
+}
+
+if (xfer_len == pmsg-&amp;gt;len) {
+if (last != 1)
+writew(CR_ENABLE, i2c_dev-&amp;gt;base + REG_CR);
+} else {
+writew(pmsg-&amp;gt;buf[xfer_len] &amp;amp; 0xFF, i2c_dev-&amp;gt;base +
+REG_CDR);
+writew(CR_CPU_RDY | CR_ENABLE, i2c_dev-&amp;gt;base + REG_CR);
+}
+}
+
+return 0;
+}
+
+static int wmt_i2c_read(struct i2c_adapter *adap, struct i2c_msg *pmsg,
+  int restart, int last)
+{
+struct wmt_i2c_dev *i2c_dev = i2c_get_adapdata(adap);
+u16 val, tcr_val;
+int ret, wait_result;
+u32 xfer_len = 0;
+
+if (!restart) {
+ret = wmt_i2c_wait_bus_not_busy(i2c_dev);
+if (ret &amp;lt; 0)
+return ret;
+}
+
+val = readw(i2c_dev-&amp;gt;base + REG_CR);
+val &amp;amp;= ~CR_TX_END;
+writew(val, i2c_dev-&amp;gt;base + REG_CR);
+
+val = readw(i2c_dev-&amp;gt;base + REG_CR);
+val &amp;amp;= ~CR_TX_NEXT_NO_ACK;
+writew(val, i2c_dev-&amp;gt;base + REG_CR);
+
+if (!restart) {
+val = readw(i2c_dev-&amp;gt;base + REG_CR);
+val |= CR_CPU_RDY;
+writew(val, i2c_dev-&amp;gt;base + REG_CR);
+}
+
+if (pmsg-&amp;gt;len == 1) {
+val = readw(i2c_dev-&amp;gt;base + REG_CR);
+val |= CR_TX_NEXT_NO_ACK;
+writew(val, i2c_dev-&amp;gt;base + REG_CR);
+}
+
+init_completion(&amp;amp;i2c_dev-&amp;gt;complete);
+
+if (i2c_dev-&amp;gt;mode == I2C_MODE_STANDARD)
+tcr_val = TCR_STANDARD_MODE;
+else
+tcr_val = TCR_FAST_MODE;
+
+tcr_val |= TCR_MASTER_READ | (pmsg-&amp;gt;addr &amp;amp; TCR_SLAVE_ADDR_MASK);
+
+writew(tcr_val, i2c_dev-&amp;gt;base + REG_TCR);
+
+if (restart) {
+val = readw(i2c_dev-&amp;gt;base + REG_CR);
+val |= CR_CPU_RDY;
+writew(val, i2c_dev-&amp;gt;base + REG_CR);
+}
+
+while (xfer_len &amp;lt; pmsg-&amp;gt;len) {
+wait_result = wait_for_completion_timeout(&amp;amp;i2c_dev-&amp;gt;complete,
+  500 * HZ / 1000);
+
+if (!wait_result)
+return -ETIMEDOUT;
+
+ret = wmt_check_status(i2c_dev);
+if (ret)
+return ret;
+
+pmsg-&amp;gt;buf[xfer_len] = readw(i2c_dev-&amp;gt;base + REG_CDR) &amp;gt;&amp;gt; 8;
+xfer_len++;
+
+if (xfer_len == pmsg-&amp;gt;len - 1) {
+val = readw(i2c_dev-&amp;gt;base + REG_CR);
+val |= (CR_TX_NEXT_NO_ACK | CR_CPU_RDY);
+writew(val, i2c_dev-&amp;gt;base + REG_CR);
+} else {
+val = readw(i2c_dev-&amp;gt;base + REG_CR);
+val |= CR_CPU_RDY;
+writew(val, i2c_dev-&amp;gt;base + REG_CR);
+}
+}
+
+return 0;
+}
+
+static int wmt_i2c_xfer(struct i2c_adapter *adap,
+struct i2c_msg msgs[],
+int num)
+{
+struct i2c_msg *pmsg;
+int i, is_last, restart;
+int ret = 0;
+
+for (i = 0; ret &amp;gt;= 0 &amp;amp;&amp;amp; i &amp;lt; num; i++) {
+is_last = ((i + 1) == num);
+restart = (i != 0);
+
+pmsg = &amp;amp;msgs[i];
+if (pmsg-&amp;gt;flags &amp;amp; I2C_M_NOSTART)
+restart = 1;
+if (pmsg-&amp;gt;flags &amp;amp; I2C_M_RD)
+ret = wmt_i2c_read(adap, pmsg, restart, is_last);
+else
+ret = wmt_i2c_write(adap, pmsg, restart, is_last);
+}
+
+return (ret &amp;lt; 0) ? ret : i;
+}
+
+static u32 wmt_i2c_func(struct i2c_adapter *adap)
+{
+return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | I2C_FUNC_NOSTART;
+}
+
+static const struct i2c_algorithm wmt_i2c_algo = {
+.master_xfer= wmt_i2c_xfer,
+.functionality= wmt_i2c_func,
+};
+
+static irqreturn_t wmt_i2c_isr(int irq, void *data)
+{
+struct wmt_i2c_dev *i2c_dev = data;
+
+/* save the status and write-clear it */
+i2c_dev-&amp;gt;cmd_status = readw(i2c_dev-&amp;gt;base + REG_ISR);
+writew(i2c_dev-&amp;gt;cmd_status, i2c_dev-&amp;gt;base + REG_ISR);
+
+complete(&amp;amp;i2c_dev-&amp;gt;complete);
+
+return IRQ_HANDLED;
+}
+
+static int wmt_i2c_reset_hardware(struct wmt_i2c_dev *i2c_dev)
+{
+int err;
+
+err = clk_prepare_enable(i2c_dev-&amp;gt;clk);
+if (err) {
+dev_err(i2c_dev-&amp;gt;dev, "failed to enable clock\n");
+return err;
+}
+
+err = clk_set_rate(i2c_dev-&amp;gt;clk, 20000000);
+if (err) {
+dev_err(i2c_dev-&amp;gt;dev, "failed to set clock = 20Mhz\n");
+return err;
+}
+
+writew(0, i2c_dev-&amp;gt;base + REG_CR);
+writew(12, i2c_dev-&amp;gt;base + REG_MCR);
+writew(ISR_WRITE_ALL, i2c_dev-&amp;gt;base + REG_ISR);
+writew(IMR_ENABLE_ALL, i2c_dev-&amp;gt;base + REG_IMR);
+writew(CR_ENABLE, i2c_dev-&amp;gt;base + REG_CR);
+readw(i2c_dev-&amp;gt;base + REG_CSR);/* read clear */
+writew(ISR_WRITE_ALL, i2c_dev-&amp;gt;base + REG_ISR);
+
+if (i2c_dev-&amp;gt;mode == I2C_MODE_STANDARD)
+writew(SCL_TIMEOUT(128) | TR_STD, i2c_dev-&amp;gt;base + REG_TR);
+else
+writew(SCL_TIMEOUT(128) | TR_HS, i2c_dev-&amp;gt;base + REG_TR);
+
+return 0;
+}
+
+static int wmt_i2c_probe(struct platform_device *pdev)
+{
+struct device_node *np = pdev-&amp;gt;dev.of_node;
+struct wmt_i2c_dev *i2c_dev;
+struct i2c_adapter *adap;
+struct resource *res;
+int err;
+u32 clk_rate;
+
+if (!np) {
+dev_err(&amp;amp;pdev-&amp;gt;dev, "device node not found\n");
+return -ENODEV;
+}
+
+i2c_dev = devm_kzalloc(&amp;amp;pdev-&amp;gt;dev, sizeof(*i2c_dev), GFP_KERNEL);
+if (!i2c_dev) {
+dev_err(&amp;amp;pdev-&amp;gt;dev, "device memory allocation failed\n");
+return -ENOMEM;
+}
+
+res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+i2c_dev-&amp;gt;base = devm_ioremap_resource(&amp;amp;pdev-&amp;gt;dev, res);
+if (IS_ERR(i2c_dev-&amp;gt;base))
+return PTR_ERR(i2c_dev-&amp;gt;base);
+
+i2c_dev-&amp;gt;irq = irq_of_parse_and_map(np, 0);
+if (!i2c_dev-&amp;gt;irq) {
+dev_err(&amp;amp;pdev-&amp;gt;dev, "irq missing or invalid\n");
+return -EINVAL;
+}
+
+i2c_dev-&amp;gt;clk = of_clk_get(np, 0);
+if (IS_ERR(i2c_dev-&amp;gt;clk)) {
+dev_err(&amp;amp;pdev-&amp;gt;dev, "unable to request clock\n");
+return PTR_ERR(i2c_dev-&amp;gt;clk);
+}
+
+i2c_dev-&amp;gt;mode = I2C_MODE_STANDARD;
+err = of_property_read_u32(np, "clock-frequency", &amp;amp;clk_rate);
+if ((!err) &amp;amp;&amp;amp; (clk_rate == 400000))
+i2c_dev-&amp;gt;mode = I2C_MODE_FAST;
+
+i2c_dev-&amp;gt;dev = &amp;amp;pdev-&amp;gt;dev;
+
+err = devm_request_irq(&amp;amp;pdev-&amp;gt;dev, i2c_dev-&amp;gt;irq, wmt_i2c_isr, 0,
+"i2c", i2c_dev);
+if (err) {
+dev_err(&amp;amp;pdev-&amp;gt;dev, "failed to request irq %i\n", i2c_dev-&amp;gt;irq);
+return err;
+}
+
+adap = &amp;amp;i2c_dev-&amp;gt;adapter;
+i2c_set_adapdata(adap, i2c_dev);
+strlcpy(adap-&amp;gt;name, "WMT I2C adapter", sizeof(adap-&amp;gt;name));
+adap-&amp;gt;owner = THIS_MODULE;
+adap-&amp;gt;class = I2C_CLASS_HWMON;
+adap-&amp;gt;algo = &amp;amp;wmt_i2c_algo;
+adap-&amp;gt;dev.parent = &amp;amp;pdev-&amp;gt;dev;
+adap-&amp;gt;dev.of_node = pdev-&amp;gt;dev.of_node;
+adap-&amp;gt;nr = of_alias_get_id(pdev-&amp;gt;dev.of_node, "i2c");
+
+err = wmt_i2c_reset_hardware(i2c_dev);
+if (err) {
+dev_err(&amp;amp;pdev-&amp;gt;dev, "error initializing hardware\n");
+return err;
+}
+
+if (adap-&amp;gt;nr &amp;lt; 0)
+err = i2c_add_adapter(adap);
+else
+err = i2c_add_numbered_adapter(adap);
+
+if (err) {
+dev_err(&amp;amp;pdev-&amp;gt;dev, "failed to add adapter\n");
+return err;
+}
+
+platform_set_drvdata(pdev, i2c_dev);
+
+of_i2c_register_devices(adap);
+
+return 0;
+}
+
+static int wmt_i2c_remove(struct platform_device *pdev)
+{
+struct wmt_i2c_dev *i2c_dev = platform_get_drvdata(pdev);
+
+/* Disable interrupts, clock and delete adapter */
+writew(0, i2c_dev-&amp;gt;base + REG_IMR);
+clk_disable_unprepare(i2c_dev-&amp;gt;clk);
+i2c_del_adapter(&amp;amp;i2c_dev-&amp;gt;adapter);
+
+return 0;
+}
+
+static struct of_device_id wmt_i2c_dt_ids[] = {
+{ .compatible = "wm,wm8505-i2c" },
+{ /* Sentinel */ },
+};
+
+static struct platform_driver wmt_i2c_driver = {
+.probe= wmt_i2c_probe,
+.remove= wmt_i2c_remove,
+.driver= {
+.name= "wmt-i2c",
+.owner= THIS_MODULE,
+.of_match_table = wmt_i2c_dt_ids,
+},
+};
+
+module_platform_driver(wmt_i2c_driver);
+
+MODULE_DESCRIPTION("Wondermedia I2C master-mode bus adapter");
+MODULE_AUTHOR("Tony Prisk &amp;lt;linux-ci5G2KO2hbZ+pU9mqzGVBQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;");
+MODULE_LICENSE("GPL v2");
+MODULE_DEVICE_TABLE(of, wmt_i2c_dt_ids);
&lt;/pre&gt;</description>
    <dc:creator>Tony Prisk</dc:creator>
    <dc:date>2013-05-12T09:23:54</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15155">
    <title>презент устроен поражать</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15155</link>
    <description>&lt;pre&gt;   Заходите по ссылке: http://snurl.com/270kbc4 Всякий отпрыск будет счастлив унаследовать этакой дар. 
 
 
&lt;/pre&gt;</description>
    <dc:creator>oksana87739</dc:creator>
    <dc:date>2013-05-12T08:49:10</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15153">
    <title>Claims Requirements</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15153</link>
    <description>&lt;pre&gt;This is to inform you that you have been
selected for a cash prize of £1,000,000
(British Pounds) held on the 8th of May
2013 in London (United Kingdom). The
selection process was carried out through
random selection in Our computerized email
selection system (ESS) London Uk.

You have therefore been approved to claim
a total sum of 1 Million Pounds,(One Million Pounds)
in cash credited to fileKTU/ 9023118308/03.

Claims Requirements:

1.Full Name
2.Full Address
3.Marital Status
4.Occupation
5.Age
6.Sex
7.Nationality
8.Country Of Residence
9.Telephone Number

Agent Name: Mr. Fred Peters
Tel: +447031989477
 +447031963824
Email: mr.fredpetersclaimsagent037-3ZxEkuqjL73QT0dZR+AlfA&amp;lt; at &amp;gt;public.gmane.org
&lt;/pre&gt;</description>
    <dc:creator>zheng-JAjqph6Yjy9mcTPm0PQjYpVzexx5G7lz&lt; at &gt;public.gmane.org</dc:creator>
    <dc:date>2013-05-11T03:38:51</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.drivers.i2c/15150">
    <title>Вы сподручны на основательней</title>
    <link>http://comments.gmane.org/gmane.linux.drivers.i2c/15150</link>
    <description>&lt;pre&gt;Вам когда - нибудь доставалось присутствовать в такой ситуации, когда Вы не могли сфокусироваться на цели, Все свободное время рассеивались на разнообразные детали. не знали как уйти из тяжелой ситуации, как перебороть препятствие. знали, ровно надо Это явно свершить, а улетучивалась мотивация. По ссылке: http://tinyurl.com/c2epbkb Мы знаем как поспособствовать Вам достичь успеха! и не имеет значения, каковую задачу Вы перед собой делаете – заменить работу, начать бизнес аль исхудать на |0 кил. Таковы ситуации ведомы любым.
&lt;/pre&gt;</description>
    <dc:creator>Topaz777</dc:creator>
    <dc:date>2013-05-09T22:08:32</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.linux.drivers.i2c">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.linux.drivers.i2c</link>
  </textinput>
</rdf:RDF>
