lkml.org 
[lkml]   [2012]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] OMAP i2c: pinctrl-ify i2c-omap.c
Date
Add support for pinctrl mux settings in the OMAP I2C driver.
If no such pinctl bindings are found a warning message is printed.

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

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index b149e32..f722478 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -43,6 +43,8 @@
#include <linux/slab.h>
#include <linux/i2c-omap.h>
#include <linux/pm_runtime.h>
+#include <linux/pinctrl/consumer.h>
+#include <linux/err.h>

/* I2C controller revisions */
#define OMAP_I2C_OMAP1_REV_2 0x20
@@ -1057,6 +1059,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);
@@ -1197,6 +1200,10 @@ 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, "pins are not configured from the driver\n");
+
pm_runtime_mark_last_busy(dev->dev);
pm_runtime_put_autosuspend(dev->dev);

--
1.7.12


\
 
 \ /
  Last update: 2012-09-18 21:01    [W:0.089 / U:0.164 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site