lkml.org 
[lkml]   [2012]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] i2c: pinctrl-ify i2c-omap.c
Date
Enable pinctrl for i2c-omap.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
---
drivers/i2c/busses/i2c-omap.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index db31eae..4c38aa0 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -44,6 +44,8 @@
#include <linux/i2c-omap.h>
#include <linux/pm_runtime.h>
#include <linux/pm_qos.h>
+#include <linux/pinctrl/consumer.h>
+#include <linux/err.h>

/* I2C controller revisions */
#define OMAP_I2C_OMAP1_REV_2 0x20
@@ -1064,6 +1066,7 @@ omap_i2c_probe(struct platform_device *pdev)
const struct of_device_id *match;
int irq;
int r;
+ struct pinctrl *pinctrl;

/* NOTE: driver uses the static register mapping */
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1202,6 +1205,13 @@ omap_i2c_probe(struct platform_device *pdev)

of_i2c_register_devices(adap);

+ pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+ if (IS_ERR(pinctrl))
+ dev_warn(dev->dev, "unable to select pin group\n");
+
+ dev_info(dev->dev, "bus %d rev%d.%d.%d at %d kHz\n", adap->nr,
+ dev->dtrev, dev->rev >> 4, dev->rev & 0xf, dev->speed);
+
pm_runtime_mark_last_busy(dev->dev);
pm_runtime_put_autosuspend(dev->dev);

--
1.7.12


\
 
 \ /
  Last update: 2012-10-30 20:01    [W:0.073 / U:1.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site