diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-05-06 10:59:45 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-05-11 21:43:17 -0400 |
commit | d98d033c15b77d51ed723ba10c49fa13233e59c1 (patch) | |
tree | f03e5aff546d9fb8df10fec6587d9a961c1bc3d7 | |
parent | 39febc018bd26edb9f9f73c0f5ee661de37c7869 (diff) |
i2c: mxs: adopt pinctrl support
Cc: linux-i2c@vger.kernel.org
Cc: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
-rw-r--r-- | drivers/i2c/busses/i2c-mxs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c index 3d471d56bf1..7c7711dc19d 100644 --- a/drivers/i2c/busses/i2c-mxs.c +++ b/drivers/i2c/busses/i2c-mxs.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
27 | #include <linux/jiffies.h> | 27 | #include <linux/jiffies.h> |
28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
29 | #include <linux/pinctrl/consumer.h> | ||
29 | 30 | ||
30 | #include <mach/common.h> | 31 | #include <mach/common.h> |
31 | 32 | ||
@@ -323,10 +324,15 @@ static int __devinit mxs_i2c_probe(struct platform_device *pdev) | |||
323 | struct device *dev = &pdev->dev; | 324 | struct device *dev = &pdev->dev; |
324 | struct mxs_i2c_dev *i2c; | 325 | struct mxs_i2c_dev *i2c; |
325 | struct i2c_adapter *adap; | 326 | struct i2c_adapter *adap; |
327 | struct pinctrl *pinctrl; | ||
326 | struct resource *res; | 328 | struct resource *res; |
327 | resource_size_t res_size; | 329 | resource_size_t res_size; |
328 | int err, irq; | 330 | int err, irq; |
329 | 331 | ||
332 | pinctrl = devm_pinctrl_get_select_default(dev); | ||
333 | if (IS_ERR(pinctrl)) | ||
334 | return PTR_ERR(pinctrl); | ||
335 | |||
330 | i2c = devm_kzalloc(dev, sizeof(struct mxs_i2c_dev), GFP_KERNEL); | 336 | i2c = devm_kzalloc(dev, sizeof(struct mxs_i2c_dev), GFP_KERNEL); |
331 | if (!i2c) | 337 | if (!i2c) |
332 | return -ENOMEM; | 338 | return -ENOMEM; |