Re: [PATCH 1/2] i2c: s3c2410: add optional pin configuration using pinctrl interface

2012-09-06 Thread Tomasz Figa
Hi,

This patch shows the problem of the need to explicitly migrate all drivers 
to pinctrl.

Maybe we should consider extending the pinctrl subsystem to set the default 
state automatically before binding a driver to a device, at least in case 
of DT-based platforms?

This would be similar to what is done currently with samsung-gpio bindings 
- the pin is being configured by custom xlate callback based on additional 
cells in GPIO specifier, when the driver retrieves the pin using 
of_get{_named,}_gpio without the need of setting it up in the driver.

Best regards,
-- 
Tomasz Figa
Samsung Poland RD Center

On Thursday 06 of September 2012 14:53:00 Thomas Abraham wrote:
 Add optional support for i2c bus pin configuration using pinctrl
 interface
 
 Cc: Ben Dooks ben-li...@fluff.org
 Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
 ---
  drivers/i2c/busses/i2c-s3c2410.c |   19 ---
  1 files changed, 16 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/i2c/busses/i2c-s3c2410.c
 b/drivers/i2c/busses/i2c-s3c2410.c index 5ae3b02..f4b2d6f 100644
 --- a/drivers/i2c/busses/i2c-s3c2410.c
 +++ b/drivers/i2c/busses/i2c-s3c2410.c
 @@ -38,6 +38,7 @@
  #include linux/io.h
  #include linux/of_i2c.h
  #include linux/of_gpio.h
 +#include linux/pinctrl/consumer.h
 
  #include asm/irq.h
 
 @@ -83,6 +84,8 @@ struct s3c24xx_i2c {
 
   struct s3c2410_platform_i2c *pdata;
   int gpios[2];
 + struct pinctrl  *pctrl;
 + struct pinctrl_state*pctrl_state;
  #ifdef CONFIG_CPU_FREQ
   struct notifier_block   freq_transition;
  #endif
 @@ -859,11 +862,17 @@ static int s3c24xx_i2c_init(struct s3c24xx_i2c
 *i2c)
 
   /* inititalise the gpio */
 
 - if (pdata-cfg_gpio)
 + if (pdata-cfg_gpio) {
   pdata-cfg_gpio(to_platform_device(i2c-dev));
 - else
 - if (s3c24xx_i2c_parse_dt_gpio(i2c))
 + } else if (!IS_ERR_OR_NULL(i2c-pctrl) 
 + !IS_ERR_OR_NULL(i2c-pctrl_state)) {
 + if (pinctrl_select_state(i2c-pctrl, i2c-pctrl_state)) {
 + dev_err(i2c-dev, failed to configure io-pins\n);
 + return -ENXIO;
 + }
 + } else if (s3c24xx_i2c_parse_dt_gpio(i2c)) {
   return -EINVAL;
 + }
 
   /* write slave address */
 
 @@ -1013,6 +1022,10 @@ static int s3c24xx_i2c_probe(struct
 platform_device *pdev) i2c-adap.algo_data = i2c;
   i2c-adap.dev.parent = pdev-dev;
 
 + i2c-pctrl = devm_pinctrl_get(i2c-dev);
 + if (!IS_ERR_OR_NULL(i2c-pctrl))
 + i2c-pctrl_state = pinctrl_lookup_state(i2c-pctrl, default);
 +
   /* initialise the i2c controller */
 
   ret = s3c24xx_i2c_init(i2c);

--
To unsubscribe from this list: send the line unsubscribe linux-i2c in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] ARM: dts: exynos4: allow i2c0 bus to be configured using pinctrl interface

2012-09-06 Thread Tomasz Figa
Hi Thomas,

On Thursday 06 of September 2012 14:53:01 Thomas Abraham wrote:
   compatible = samsung,s3c2440-i2c;
   reg = 0x1386 0x100;
   interrupts = 0 58 0;
 + pinctrl-names = default;
 + pinctrl-0 = i2c0_bus;

If pinctrl-names property is omitted then the state index is used as a name 
(e.g. pinctrl-0 would be named 0). Maybe it would be better to use this 
approach (with respective adjustment in first patch)? What do you think?

Best regards,
-- 
Tomasz Figa
Samsung Poland RD Center

--
To unsubscribe from this list: send the line unsubscribe linux-i2c in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] i2c: s3c2410: add optional pin configuration using pinctrl interface

2012-09-06 Thread Thomas Abraham
On 6 September 2012 15:04, Tomasz Figa t.f...@samsung.com wrote:
 Hi,

 This patch shows the problem of the need to explicitly migrate all drivers
 to pinctrl.

 Maybe we should consider extending the pinctrl subsystem to set the default
 state automatically before binding a driver to a device, at least in case
 of DT-based platforms?

The pinctrl driver allows for activating default pin configuration
when the pinctrl driver loads. This is referred to as hogging. But
should hog be used or not is something that needs to be decided. Some
of the factors which favor the driver explicitly setting up the pin
configuration are

1. After a suspend and resume cycle, the pin configuration registers
may be reset to default values. Hence, during resume, the pin
configuration has be redone.

2. Runtime muxing/config is possible.

3. Setting some of the config options such as pull-up by default might
start consuming power from boot time itself, which could be avoided if
such setup is done only when needed.

Adding pinctrl driver support in device drivers seems to be simple
task. And it is just one time effort which can be reused on multiple
SoC's.


 This would be similar to what is done currently with samsung-gpio bindings
 - the pin is being configured by custom xlate callback based on additional
 cells in GPIO specifier, when the driver retrieves the pin using
 of_get{_named,}_gpio without the need of setting it up in the driver.

The Samsung gpio dt bindings was just a bootstrap method to get device
tree support going for Samsung platforms. The gpio xlate callback was
used as a back door to setup the pinmux/pinconfig due to lack of
generic driver interface to setup the pinmux/pinconfig for Samsung
platforms. From a linux perspective, gpio and pinmux/pinconfig are
separate entities. So using gpio xlate to setup pinmux/pinconfig was
not correct but helped getting device tree enabled for Samsung
platforms. With the pinctrl framework available now, there are generic
interfaces to setup gpio and pinmux /pinconfig.

Thanks,
Thomas.


 Best regards,
 --
 Tomasz Figa
 Samsung Poland RD Center

 On Thursday 06 of September 2012 14:53:00 Thomas Abraham wrote:
 Add optional support for i2c bus pin configuration using pinctrl
 interface

 Cc: Ben Dooks ben-li...@fluff.org
 Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
 ---
  drivers/i2c/busses/i2c-s3c2410.c |   19 ---
  1 files changed, 16 insertions(+), 3 deletions(-)

 diff --git a/drivers/i2c/busses/i2c-s3c2410.c
 b/drivers/i2c/busses/i2c-s3c2410.c index 5ae3b02..f4b2d6f 100644
 --- a/drivers/i2c/busses/i2c-s3c2410.c
 +++ b/drivers/i2c/busses/i2c-s3c2410.c
 @@ -38,6 +38,7 @@
  #include linux/io.h
  #include linux/of_i2c.h
  #include linux/of_gpio.h
 +#include linux/pinctrl/consumer.h

  #include asm/irq.h

 @@ -83,6 +84,8 @@ struct s3c24xx_i2c {

   struct s3c2410_platform_i2c *pdata;
   int gpios[2];
 + struct pinctrl  *pctrl;
 + struct pinctrl_state*pctrl_state;
  #ifdef CONFIG_CPU_FREQ
   struct notifier_block   freq_transition;
  #endif
 @@ -859,11 +862,17 @@ static int s3c24xx_i2c_init(struct s3c24xx_i2c
 *i2c)

   /* inititalise the gpio */

 - if (pdata-cfg_gpio)
 + if (pdata-cfg_gpio) {
   pdata-cfg_gpio(to_platform_device(i2c-dev));
 - else
 - if (s3c24xx_i2c_parse_dt_gpio(i2c))
 + } else if (!IS_ERR_OR_NULL(i2c-pctrl) 
 + !IS_ERR_OR_NULL(i2c-pctrl_state)) {
 + if (pinctrl_select_state(i2c-pctrl, i2c-pctrl_state)) {
 + dev_err(i2c-dev, failed to configure io-pins\n);
 + return -ENXIO;
 + }
 + } else if (s3c24xx_i2c_parse_dt_gpio(i2c)) {
   return -EINVAL;
 + }

   /* write slave address */

 @@ -1013,6 +1022,10 @@ static int s3c24xx_i2c_probe(struct
 platform_device *pdev) i2c-adap.algo_data = i2c;
   i2c-adap.dev.parent = pdev-dev;

 + i2c-pctrl = devm_pinctrl_get(i2c-dev);
 + if (!IS_ERR_OR_NULL(i2c-pctrl))
 + i2c-pctrl_state = pinctrl_lookup_state(i2c-pctrl, default);
 +
   /* initialise the i2c controller */

   ret = s3c24xx_i2c_init(i2c);

--
To unsubscribe from this list: send the line unsubscribe linux-i2c in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] ARM: dts: exynos4: allow i2c0 bus to be configured using pinctrl interface

2012-09-06 Thread Thomas Abraham
On 6 September 2012 15:43, Tomasz Figa t.f...@samsung.com wrote:
 Hi Thomas,

 On Thursday 06 of September 2012 14:53:01 Thomas Abraham wrote:
   compatible = samsung,s3c2440-i2c;
   reg = 0x1386 0x100;
   interrupts = 0 58 0;
 + pinctrl-names = default;
 + pinctrl-0 = i2c0_bus;

 If pinctrl-names property is omitted then the state index is used as a name
 (e.g. pinctrl-0 would be named 0). Maybe it would be better to use this
 approach (with respective adjustment in first patch)? What do you think?

I tend to prefer to name the states because it is easier to
cross-reference code and dts files. i2c was a simple one, but for mmc
controllers, there will 1-bit state, 4-bit state and 8-bit state, and
it will be nicer to name then accordingly. So I prefer to use names
but if there is wider consensus on not using names, we can drop names.

Thanks,
Thomas.


 Best regards,
 --
 Tomasz Figa
 Samsung Poland RD Center

--
To unsubscribe from this list: send the line unsubscribe linux-i2c in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] i2c: omap: Prevent NULL pointer dereference in remove

2012-09-06 Thread Shubhrajyoti D
Prevent the NULL pointer access by moving the platform_set_drvdata function
after the access of the pdev.

[  654.961761] Unable to handle kernel NULL pointer dereference at virtual 
address 0070
[  654.970611] pgd = df254000
[  654.973480] [0070] *pgd=9f1da831, *pte=, *ppte=
[  654.980163] Internal error: Oops: 17 [#1] SMP ARM
[  654.985076] Modules linked in:
[  654.988281] CPU: 1Not tainted  (3.6.0-rc1-00031-ge547de1-dirty #339)
[  654.995330] PC is at omap_i2c_runtime_resume+0x8/0x148
[  655.000732] LR is at omap_i2c_runtime_resume+0x8/0x148

Signed-off-by: Shubhrajyoti D shubhrajy...@ti.com
---
v2: Implement Jean's suggestion of not deleting instead make it NULL at a safer 
time.

 drivers/i2c/busses/i2c-omap.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 5d19a49..c4ddb08 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -1112,8 +1112,6 @@ static int __devexit omap_i2c_remove(struct 
platform_device *pdev)
struct resource *mem;
int ret;
 
-   platform_set_drvdata(pdev, NULL);
-
free_irq(dev-irq, dev);
i2c_del_adapter(dev-adapter);
ret = pm_runtime_get_sync(pdev-dev);
@@ -1127,6 +1125,7 @@ static int __devexit omap_i2c_remove(struct 
platform_device *pdev)
kfree(dev);
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(mem-start, resource_size(mem));
+   platform_set_drvdata(pdev, NULL);
return 0;
 }
 
-- 
1.7.5.4

--
To unsubscribe from this list: send the line unsubscribe linux-i2c in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] i2c: omap: Prevent NULL pointer dereference in remove

2012-09-06 Thread Shubhrajyoti Datta
Hi Jean,
Thanks for the review.

On Thu, Aug 30, 2012 at 12:17 AM, Jean Delvare kh...@linux-fr.org wrote:
 On Thu, 23 Aug 2012 19:51:26 +0530, Shubhrajyoti D wrote:
 Prevent the NULL pointer access of pdev-dev in remove. The platform_device 
 is anyways
 deleted so remove  platform_set_drvdata(pdev, NULL);.

[...]

 @@ -1112,8 +,6 @@ static int __devexit omap_i2c_remove(struct 
 platform_device *pdev)
   struct resource *mem;
   int ret;

 - platform_set_drvdata(pdev, NULL);
 -

 This OTOH is a good catch. But the problem isn't with calling
 platform_set_drvdata(pdev, NULL) per se. The problem is with calling it
 too early. It should be called after i2c_del_adapter(), and ideally
 before freeing the memory.


Just  sent a patch implementing your suggestion.
thanks,
--
To unsubscribe from this list: send the line unsubscribe linux-i2c in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] i2c: omap: Prevent NULL pointer dereference in remove

2012-09-06 Thread Jean Delvare
On Thu, 6 Sep 2012 17:31:56 +0530, Shubhrajyoti D wrote:
 Prevent the NULL pointer access by moving the platform_set_drvdata function
 after the access of the pdev.
 
 [  654.961761] Unable to handle kernel NULL pointer dereference at virtual 
 address 0070
 [  654.970611] pgd = df254000
 [  654.973480] [0070] *pgd=9f1da831, *pte=, *ppte=
 [  654.980163] Internal error: Oops: 17 [#1] SMP ARM
 [  654.985076] Modules linked in:
 [  654.988281] CPU: 1Not tainted  (3.6.0-rc1-00031-ge547de1-dirty #339)
 [  654.995330] PC is at omap_i2c_runtime_resume+0x8/0x148
 [  655.000732] LR is at omap_i2c_runtime_resume+0x8/0x148
 
 Signed-off-by: Shubhrajyoti D shubhrajy...@ti.com

Acked-by: Jean Delvare kh...@linux-fr.org

(This will rather go in Ben's or Wolfram's i2c tree.)

 ---
 v2: Implement Jean's suggestion of not deleting instead make it NULL at a 
 safer time.
 
  drivers/i2c/busses/i2c-omap.c |3 +--
  1 files changed, 1 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
 index 5d19a49..c4ddb08 100644
 --- a/drivers/i2c/busses/i2c-omap.c
 +++ b/drivers/i2c/busses/i2c-omap.c
 @@ -1112,8 +1112,6 @@ static int __devexit omap_i2c_remove(struct 
 platform_device *pdev)
   struct resource *mem;
   int ret;
  
 - platform_set_drvdata(pdev, NULL);
 -
   free_irq(dev-irq, dev);
   i2c_del_adapter(dev-adapter);
   ret = pm_runtime_get_sync(pdev-dev);
 @@ -1127,6 +1125,7 @@ static int __devexit omap_i2c_remove(struct 
 platform_device *pdev)
   kfree(dev);
   mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   release_mem_region(mem-start, resource_size(mem));
 + platform_set_drvdata(pdev, NULL);
   return 0;
  }
  


-- 
Jean Delvare
--
To unsubscribe from this list: send the line unsubscribe linux-i2c in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: FW: [RESEND PATCH] i2c: Adding support for Intel iSMT SMBus 2.0 host controller

2012-09-06 Thread Bill Brown
Hi Shubhrajyoti,

On Thu, 2012-09-06 at 09:16 -0700, Brown, Bill E wrote:
 
 -Original Message-
 From: linux-i2c-ow...@vger.kernel.org 
 [mailto:linux-i2c-ow...@vger.kernel.org] On Behalf Of Shubhrajyoti Datta
 Sent: Thursday, August 16, 2012 1:58 AM
 To: Brown, Bill E
 Cc: Jean Delvare; linux-i2c@vger.kernel.org
 Subject: Re: [RESEND PATCH] i2c: Adding support for Intel iSMT SMBus 2.0 host 
 controller
 
 Hi Bill,
 Some minor doubts below.
 
 On Sat, Aug 11, 2012 at 4:47 AM, Bill Brown bill.e.br...@intel.com wrote:
  The iSMT (Intel SMBus Message Transport) supports multi-master 
  I2C/SMBus, as well as IPMI.  It's operation is DMA-based and utilizes 
  descriptors to initiate transactions on the bus.
 
  The iSMT hardware can act as both a master and a target, although this 
  driver only supports being a master.
 
  Signed-off-by: Bill Brown bill.e.br...@intel.com
  ---
   drivers/i2c/busses/Kconfig|   10 +
   drivers/i2c/busses/Makefile   |1 +
   drivers/i2c/busses/i2c-ismt.c |  862 
  +
   drivers/i2c/busses/i2c-ismt.h |  111 ++
   4 files changed, 984 insertions(+), 0 deletions(-)  create mode 
  100644 drivers/i2c/busses/i2c-ismt.c  create mode 100644 
  drivers/i2c/busses/i2c-ismt.h
 
  diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig 
  index d2c5095..2b5ffa3 100644
  --- a/drivers/i2c/busses/Kconfig
  +++ b/drivers/i2c/busses/Kconfig
  @@ -119,6 +119,16 @@ config I2C_ISCH
This driver can also be built as a module. If so, the module
will be called i2c-isch.
 
  +config I2C_ISMT
  +   tristate Intel iSMT SMBus Controller
  +   depends on PCI
  +   help
  + If you say yes to this option, support will be included for the 
  Intel
  + iSMT SMBus host controller interface.
  +
  + This driver can also be built as a module.  If so, the module 
  will be
  + called i2c-ismt.
  +
   config I2C_PIIX4
  tristate Intel PIIX4 and compatible 
  (ATI/AMD/Serverworks/Broadcom/SMSC)
  depends on PCI
  diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile 
  index 569567b..8a05c80 100644
  --- a/drivers/i2c/busses/Makefile
  +++ b/drivers/i2c/busses/Makefile
  @@ -22,6 +22,7 @@ obj-$(CONFIG_I2C_SIS630)  += i2c-sis630.o
   obj-$(CONFIG_I2C_SIS96X)   += i2c-sis96x.o
   obj-$(CONFIG_I2C_VIA)  += i2c-via.o
   obj-$(CONFIG_I2C_VIAPRO)   += i2c-viapro.o
  +obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
 
   # Mac SMBus host controller drivers
   obj-$(CONFIG_I2C_HYDRA)+= i2c-hydra.o
  diff --git a/drivers/i2c/busses/i2c-ismt.c 
  b/drivers/i2c/busses/i2c-ismt.c new file mode 100644 index 
  000..dd107dd
  --- /dev/null
  +++ b/drivers/i2c/busses/i2c-ismt.c
  @@ -0,0 +1,862 @@
  +/*
  + * This file is provided under a dual BSD/GPLv2 license.  When using 
  +or
  + * redistributing this file, you may do so under either license.
  + *
  + * GPL LICENSE SUMMARY
  + *
  + * Copyright(c) 2012 Intel Corporation. All rights reserved.
  + *
  + * This program is free software; you can redistribute it and/or 
  +modify
  + * it under the terms of version 2 of the GNU General Public License 
  +as
  + * published by the Free Software Foundation.
  + *
  + * This program is distributed in the hope that it will be useful, 
  +but
  + * WITHOUT ANY WARRANTY; without even the implied warranty of
  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  + * General Public License for more details.
  + *
  + * You should have received a copy of the GNU General Public License
  + * along with this program; if not, write to the Free Software
  + * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 
  USA.
  + * The full GNU General Public License is included in this 
  +distribution
  + * in the file called LICENSE.GPL.
  + *
  + * BSD LICENSE
  + *
  + * Copyright(c) 2012 Intel Corporation. All rights reserved.
  + * All rights reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + *   * Redistributions of source code must retain the above copyright
  + * notice, this list of conditions and the following disclaimer.
  + *   * Redistributions in binary form must reproduce the above copyright
  + * notice, this list of conditions and the following disclaimer in
  + * the documentation and/or other materials provided with the
  + * distribution.
  + *   * Neither the name of Intel Corporation nor the names of its
  + * contributors may be used to endorse or promote products derived
  + * from this software without specific prior written permission.
  + *
  + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
  +CONTRIBUTORS
  + * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  + * LIMITED TO, THE IMPLIED 

[PATCH v2] i2c: Adding support for Intel iSMT SMBus 2.0 host controller

2012-09-06 Thread Bill Brown
The iSMT (Intel SMBus Message Transport) supports multi-master I2C/SMBus,
as well as IPMI.  It's operation is DMA-based and utilizes descriptors to
initiate transactions on the bus.

The iSMT hardware can act as both a master and a target, although this
driver only supports being a master.

Signed-off-by: Bill Brown bill.e.br...@intel.com
---
 drivers/i2c/busses/Kconfig|   10 +
 drivers/i2c/busses/Makefile   |1 +
 drivers/i2c/busses/i2c-ismt.c |  845 +
 drivers/i2c/busses/i2c-ismt.h |  111 ++
 4 files changed, 967 insertions(+), 0 deletions(-)
 create mode 100644 drivers/i2c/busses/i2c-ismt.c
 create mode 100644 drivers/i2c/busses/i2c-ismt.h

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 7244c8b..64d5756 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -119,6 +119,16 @@ config I2C_ISCH
  This driver can also be built as a module. If so, the module
  will be called i2c-isch.
 
+config I2C_ISMT
+   tristate Intel iSMT SMBus Controller
+   depends on PCI
+   help
+ If you say yes to this option, support will be included for the Intel
+ iSMT SMBus host controller interface.
+
+ This driver can also be built as a module.  If so, the module will be
+ called i2c-ismt.
+
 config I2C_PIIX4
tristate Intel PIIX4 and compatible 
(ATI/AMD/Serverworks/Broadcom/SMSC)
depends on PCI
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
index ce3c2be..694711a 100644
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
@@ -22,6 +22,7 @@ obj-$(CONFIG_I2C_SIS630)  += i2c-sis630.o
 obj-$(CONFIG_I2C_SIS96X)   += i2c-sis96x.o
 obj-$(CONFIG_I2C_VIA)  += i2c-via.o
 obj-$(CONFIG_I2C_VIAPRO)   += i2c-viapro.o
+obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
 
 # Mac SMBus host controller drivers
 obj-$(CONFIG_I2C_HYDRA)+= i2c-hydra.o
diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c
new file mode 100644
index 000..46df042
--- /dev/null
+++ b/drivers/i2c/busses/i2c-ismt.c
@@ -0,0 +1,845 @@
+/*
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * GPL LICENSE SUMMARY
+ *
+ * Copyright(c) 2012 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ * The full GNU General Public License is included in this distribution
+ * in the file called LICENSE.GPL.
+ *
+ * BSD LICENSE
+ *
+ * Copyright(c) 2012 Intel Corporation. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+  Supports the SMBus Message Transport (SMT) on the following Intel SOCs:
+  BWD
+  CTN
+
+  Features supported by this driver:
+  Software