Skip to content

Commit 006cd13

Browse files
AnilKumar Chmarckleinebudde
authored andcommitted
can: c_can: Adopt pinctrl support
Adopt pinctrl support to c_can driver based on c_can device pointer, pinctrl driver configure SoC pins to d_can mode according to definitions provided in .dts file. In device specific device tree file 'pinctrl-names = "default";' and 'pinctrl-0 = <&d_can1_pins>;' needs to add to configure pins from c_can driver. d_can1_pins node contains the pinmux/config details of d_can L/H pins. Signed-off-by: AnilKumar Ch <[email protected]> Acked-by: Tony Lindgren <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent 8212003 commit 006cd13

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/net/can/c_can/c_can_platform.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <linux/clk.h>
3333
#include <linux/of.h>
3434
#include <linux/of_device.h>
35+
#include <linux/pinctrl/consumer.h>
3536

3637
#include <linux/can/dev.h>
3738

@@ -97,6 +98,7 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
9798
struct c_can_priv *priv;
9899
const struct of_device_id *match;
99100
const struct platform_device_id *id;
101+
struct pinctrl *pinctrl;
100102
struct resource *mem;
101103
int irq;
102104
struct clk *clk;
@@ -113,6 +115,11 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
113115
id = platform_get_device_id(pdev);
114116
}
115117

118+
pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
119+
if (IS_ERR(pinctrl))
120+
dev_warn(&pdev->dev,
121+
"failed to configure pins from driver\n");
122+
116123
/* get the appropriate clk */
117124
clk = clk_get(&pdev->dev, NULL);
118125
if (IS_ERR(clk)) {

0 commit comments

Comments
 (0)