2 * Core driver for the imx pin controller
4 * Copyright (C) 2012 Freescale Semiconductor, Inc.
5 * Copyright (C) 2012 Linaro Ltd.
7 * Author: Dong Aisheng <dong.aisheng@linaro.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
15 #include <linux/err.h>
16 #include <linux/init.h>
18 #include <linux/module.h>
20 #include <linux/of_device.h>
21 #include <linux/of_address.h>
22 #include <linux/pinctrl/machine.h>
23 #include <linux/pinctrl/pinconf.h>
24 #include <linux/pinctrl/pinctrl.h>
25 #include <linux/pinctrl/pinmux.h>
26 #include <linux/slab.h>
29 #include "pinctrl-imx.h"
31 /* The bits in CONFIG cell defined in binding doc*/
32 #define IMX_NO_PAD_CTL 0x80000000 /* no pin config need */
33 #define IMX_PAD_SION 0x40000000 /* set SION */
36 * @dev: a pointer back to containing device
37 * @base: the offset to the controller in virtual memory
41 struct pinctrl_dev
*pctl
;
43 void __iomem
*input_sel_base
;
44 const struct imx_pinctrl_soc_info
*info
;
47 static const inline struct imx_pin_group
*imx_pinctrl_find_group_by_name(
48 const struct imx_pinctrl_soc_info
*info
,
51 const struct imx_pin_group
*grp
= NULL
;
54 for (i
= 0; i
< info
->ngroups
; i
++) {
55 if (!strcmp(info
->groups
[i
].name
, name
)) {
56 grp
= &info
->groups
[i
];
64 static int imx_get_groups_count(struct pinctrl_dev
*pctldev
)
66 struct imx_pinctrl
*ipctl
= pinctrl_dev_get_drvdata(pctldev
);
67 const struct imx_pinctrl_soc_info
*info
= ipctl
->info
;
72 static const char *imx_get_group_name(struct pinctrl_dev
*pctldev
,
75 struct imx_pinctrl
*ipctl
= pinctrl_dev_get_drvdata(pctldev
);
76 const struct imx_pinctrl_soc_info
*info
= ipctl
->info
;
78 return info
->groups
[selector
].name
;
81 static int imx_get_group_pins(struct pinctrl_dev
*pctldev
, unsigned selector
,
82 const unsigned **pins
,
85 struct imx_pinctrl
*ipctl
= pinctrl_dev_get_drvdata(pctldev
);
86 const struct imx_pinctrl_soc_info
*info
= ipctl
->info
;
88 if (selector
>= info
->ngroups
)
91 *pins
= info
->groups
[selector
].pin_ids
;
92 *npins
= info
->groups
[selector
].npins
;
97 static void imx_pin_dbg_show(struct pinctrl_dev
*pctldev
, struct seq_file
*s
,
100 seq_printf(s
, "%s", dev_name(pctldev
->dev
));
103 static int imx_dt_node_to_map(struct pinctrl_dev
*pctldev
,
104 struct device_node
*np
,
105 struct pinctrl_map
**map
, unsigned *num_maps
)
107 struct imx_pinctrl
*ipctl
= pinctrl_dev_get_drvdata(pctldev
);
108 const struct imx_pinctrl_soc_info
*info
= ipctl
->info
;
109 const struct imx_pin_group
*grp
;
110 struct pinctrl_map
*new_map
;
111 struct device_node
*parent
;
116 * first find the group of this node and check if we need create
117 * config maps for pins
119 grp
= imx_pinctrl_find_group_by_name(info
, np
->name
);
121 dev_err(info
->dev
, "unable to find group for node %s\n",
126 for (i
= 0; i
< grp
->npins
; i
++) {
127 if (!(grp
->pins
[i
].config
& IMX_NO_PAD_CTL
))
131 new_map
= kmalloc(sizeof(struct pinctrl_map
) * map_num
, GFP_KERNEL
);
139 parent
= of_get_parent(np
);
144 new_map
[0].type
= PIN_MAP_TYPE_MUX_GROUP
;
145 new_map
[0].data
.mux
.function
= parent
->name
;
146 new_map
[0].data
.mux
.group
= np
->name
;
149 /* create config map */
151 for (i
= j
= 0; i
< grp
->npins
; i
++) {
152 if (!(grp
->pins
[i
].config
& IMX_NO_PAD_CTL
)) {
153 new_map
[j
].type
= PIN_MAP_TYPE_CONFIGS_PIN
;
154 new_map
[j
].data
.configs
.group_or_pin
=
155 pin_get_name(pctldev
, grp
->pins
[i
].pin
);
156 new_map
[j
].data
.configs
.configs
= &grp
->pins
[i
].config
;
157 new_map
[j
].data
.configs
.num_configs
= 1;
162 dev_dbg(pctldev
->dev
, "maps: function %s group %s num %d\n",
163 (*map
)->data
.mux
.function
, (*map
)->data
.mux
.group
, map_num
);
168 static void imx_dt_free_map(struct pinctrl_dev
*pctldev
,
169 struct pinctrl_map
*map
, unsigned num_maps
)
174 static const struct pinctrl_ops imx_pctrl_ops
= {
175 .get_groups_count
= imx_get_groups_count
,
176 .get_group_name
= imx_get_group_name
,
177 .get_group_pins
= imx_get_group_pins
,
178 .pin_dbg_show
= imx_pin_dbg_show
,
179 .dt_node_to_map
= imx_dt_node_to_map
,
180 .dt_free_map
= imx_dt_free_map
,
184 static int imx_pmx_set(struct pinctrl_dev
*pctldev
, unsigned selector
,
187 struct imx_pinctrl
*ipctl
= pinctrl_dev_get_drvdata(pctldev
);
188 const struct imx_pinctrl_soc_info
*info
= ipctl
->info
;
189 const struct imx_pin_reg
*pin_reg
;
190 unsigned int npins
, pin_id
;
192 struct imx_pin_group
*grp
;
195 * Configure the mux mode for each pin in the group for a specific
198 grp
= &info
->groups
[group
];
201 dev_dbg(ipctl
->dev
, "enable function %s group %s\n",
202 info
->functions
[selector
].name
, grp
->name
);
204 for (i
= 0; i
< npins
; i
++) {
205 struct imx_pin
*pin
= &grp
->pins
[i
];
207 pin_reg
= &info
->pin_regs
[pin_id
];
209 if (pin_reg
->mux_reg
== -1) {
210 dev_err(ipctl
->dev
, "Pin(%s) does not support mux function\n",
211 info
->pins
[pin_id
].name
);
215 if (info
->flags
& SHARE_MUX_CONF_REG
) {
217 reg
= readl(ipctl
->base
+ pin_reg
->mux_reg
);
219 reg
|= (pin
->mux_mode
<< 20);
220 writel(reg
, ipctl
->base
+ pin_reg
->mux_reg
);
222 writel(pin
->mux_mode
, ipctl
->base
+ pin_reg
->mux_reg
);
224 dev_dbg(ipctl
->dev
, "write: offset 0x%x val 0x%x\n",
225 pin_reg
->mux_reg
, pin
->mux_mode
);
228 * If the select input value begins with 0xff, it's a quirky
229 * select input and the value should be interpreted as below.
231 * | 0xff | shift | width | select |
232 * It's used to work around the problem that the select
233 * input for some pin is not implemented in the select
234 * input register but in some general purpose register.
235 * We encode the select input value, width and shift of
236 * the bit field into input_val cell of pin function ID
237 * in device tree, and then decode them here for setting
238 * up the select input bits in general purpose register.
240 if (pin
->input_val
>> 24 == 0xff) {
241 u32 val
= pin
->input_val
;
242 u8 select
= val
& 0xff;
243 u8 width
= (val
>> 8) & 0xff;
244 u8 shift
= (val
>> 16) & 0xff;
245 u32 mask
= ((1 << width
) - 1) << shift
;
247 * The input_reg[i] here is actually some IOMUXC general
248 * purpose register, not regular select input register.
250 val
= readl(ipctl
->base
+ pin
->input_reg
);
252 val
|= select
<< shift
;
253 writel(val
, ipctl
->base
+ pin
->input_reg
);
254 } else if (pin
->input_reg
) {
256 * Regular select input register can never be at offset
257 * 0, and we only print register value for regular case.
259 if (ipctl
->input_sel_base
)
260 writel(pin
->input_val
, ipctl
->input_sel_base
+
263 writel(pin
->input_val
, ipctl
->base
+
266 "==>select_input: offset 0x%x val 0x%x\n",
267 pin
->input_reg
, pin
->input_val
);
274 static int imx_pmx_get_funcs_count(struct pinctrl_dev
*pctldev
)
276 struct imx_pinctrl
*ipctl
= pinctrl_dev_get_drvdata(pctldev
);
277 const struct imx_pinctrl_soc_info
*info
= ipctl
->info
;
279 return info
->nfunctions
;
282 static const char *imx_pmx_get_func_name(struct pinctrl_dev
*pctldev
,
285 struct imx_pinctrl
*ipctl
= pinctrl_dev_get_drvdata(pctldev
);
286 const struct imx_pinctrl_soc_info
*info
= ipctl
->info
;
288 return info
->functions
[selector
].name
;
291 static int imx_pmx_get_groups(struct pinctrl_dev
*pctldev
, unsigned selector
,
292 const char * const **groups
,
293 unsigned * const num_groups
)
295 struct imx_pinctrl
*ipctl
= pinctrl_dev_get_drvdata(pctldev
);
296 const struct imx_pinctrl_soc_info
*info
= ipctl
->info
;
298 *groups
= info
->functions
[selector
].groups
;
299 *num_groups
= info
->functions
[selector
].num_groups
;
304 static int imx_pmx_gpio_request_enable(struct pinctrl_dev
*pctldev
,
305 struct pinctrl_gpio_range
*range
, unsigned offset
)
307 struct imx_pinctrl
*ipctl
= pinctrl_dev_get_drvdata(pctldev
);
308 const struct imx_pinctrl_soc_info
*info
= ipctl
->info
;
309 const struct imx_pin_reg
*pin_reg
;
310 struct imx_pin_group
*grp
;
311 struct imx_pin
*imx_pin
;
312 unsigned int pin
, group
;
315 /* Currently implementation only for shared mux/conf register */
316 if (!(info
->flags
& SHARE_MUX_CONF_REG
))
319 pin_reg
= &info
->pin_regs
[offset
];
320 if (pin_reg
->mux_reg
== -1)
323 /* Find the pinctrl config with GPIO mux mode for the requested pin */
324 for (group
= 0; group
< info
->ngroups
; group
++) {
325 grp
= &info
->groups
[group
];
326 for (pin
= 0; pin
< grp
->npins
; pin
++) {
327 imx_pin
= &grp
->pins
[pin
];
328 if (imx_pin
->pin
== offset
&& !imx_pin
->mux_mode
)
336 reg
= readl(ipctl
->base
+ pin_reg
->mux_reg
);
338 reg
|= imx_pin
->config
;
339 writel(reg
, ipctl
->base
+ pin_reg
->mux_reg
);
344 static int imx_pmx_gpio_set_direction(struct pinctrl_dev
*pctldev
,
345 struct pinctrl_gpio_range
*range
, unsigned offset
, bool input
)
347 struct imx_pinctrl
*ipctl
= pinctrl_dev_get_drvdata(pctldev
);
348 const struct imx_pinctrl_soc_info
*info
= ipctl
->info
;
349 const struct imx_pin_reg
*pin_reg
;
353 * Only Vybrid has the input/output buffer enable flags (IBE/OBE)
354 * They are part of the shared mux/conf register.
356 if (!(info
->flags
& SHARE_MUX_CONF_REG
))
359 pin_reg
= &info
->pin_regs
[offset
];
360 if (pin_reg
->mux_reg
== -1)
363 /* IBE always enabled allows us to read the value "on the wire" */
364 reg
= readl(ipctl
->base
+ pin_reg
->mux_reg
);
369 writel(reg
, ipctl
->base
+ pin_reg
->mux_reg
);
374 static const struct pinmux_ops imx_pmx_ops
= {
375 .get_functions_count
= imx_pmx_get_funcs_count
,
376 .get_function_name
= imx_pmx_get_func_name
,
377 .get_function_groups
= imx_pmx_get_groups
,
378 .set_mux
= imx_pmx_set
,
379 .gpio_request_enable
= imx_pmx_gpio_request_enable
,
380 .gpio_set_direction
= imx_pmx_gpio_set_direction
,
383 static int imx_pinconf_get(struct pinctrl_dev
*pctldev
,
384 unsigned pin_id
, unsigned long *config
)
386 struct imx_pinctrl
*ipctl
= pinctrl_dev_get_drvdata(pctldev
);
387 const struct imx_pinctrl_soc_info
*info
= ipctl
->info
;
388 const struct imx_pin_reg
*pin_reg
= &info
->pin_regs
[pin_id
];
390 if (pin_reg
->conf_reg
== -1) {
391 dev_err(info
->dev
, "Pin(%s) does not support config function\n",
392 info
->pins
[pin_id
].name
);
396 *config
= readl(ipctl
->base
+ pin_reg
->conf_reg
);
398 if (info
->flags
& SHARE_MUX_CONF_REG
)
404 static int imx_pinconf_set(struct pinctrl_dev
*pctldev
,
405 unsigned pin_id
, unsigned long *configs
,
406 unsigned num_configs
)
408 struct imx_pinctrl
*ipctl
= pinctrl_dev_get_drvdata(pctldev
);
409 const struct imx_pinctrl_soc_info
*info
= ipctl
->info
;
410 const struct imx_pin_reg
*pin_reg
= &info
->pin_regs
[pin_id
];
413 if (pin_reg
->conf_reg
== -1) {
414 dev_err(info
->dev
, "Pin(%s) does not support config function\n",
415 info
->pins
[pin_id
].name
);
419 dev_dbg(ipctl
->dev
, "pinconf set pin %s\n",
420 info
->pins
[pin_id
].name
);
422 for (i
= 0; i
< num_configs
; i
++) {
423 if (info
->flags
& SHARE_MUX_CONF_REG
) {
425 reg
= readl(ipctl
->base
+ pin_reg
->conf_reg
);
428 writel(reg
, ipctl
->base
+ pin_reg
->conf_reg
);
430 writel(configs
[i
], ipctl
->base
+ pin_reg
->conf_reg
);
432 dev_dbg(ipctl
->dev
, "write: offset 0x%x val 0x%lx\n",
433 pin_reg
->conf_reg
, configs
[i
]);
434 } /* for each config */
439 static void imx_pinconf_dbg_show(struct pinctrl_dev
*pctldev
,
440 struct seq_file
*s
, unsigned pin_id
)
442 struct imx_pinctrl
*ipctl
= pinctrl_dev_get_drvdata(pctldev
);
443 const struct imx_pinctrl_soc_info
*info
= ipctl
->info
;
444 const struct imx_pin_reg
*pin_reg
= &info
->pin_regs
[pin_id
];
445 unsigned long config
;
447 if (!pin_reg
|| pin_reg
->conf_reg
== -1) {
448 seq_printf(s
, "N/A");
452 config
= readl(ipctl
->base
+ pin_reg
->conf_reg
);
453 seq_printf(s
, "0x%lx", config
);
456 static void imx_pinconf_group_dbg_show(struct pinctrl_dev
*pctldev
,
457 struct seq_file
*s
, unsigned group
)
459 struct imx_pinctrl
*ipctl
= pinctrl_dev_get_drvdata(pctldev
);
460 const struct imx_pinctrl_soc_info
*info
= ipctl
->info
;
461 struct imx_pin_group
*grp
;
462 unsigned long config
;
466 if (group
> info
->ngroups
)
470 grp
= &info
->groups
[group
];
471 for (i
= 0; i
< grp
->npins
; i
++) {
472 struct imx_pin
*pin
= &grp
->pins
[i
];
473 name
= pin_get_name(pctldev
, pin
->pin
);
474 ret
= imx_pinconf_get(pctldev
, pin
->pin
, &config
);
477 seq_printf(s
, "%s: 0x%lx", name
, config
);
481 static const struct pinconf_ops imx_pinconf_ops
= {
482 .pin_config_get
= imx_pinconf_get
,
483 .pin_config_set
= imx_pinconf_set
,
484 .pin_config_dbg_show
= imx_pinconf_dbg_show
,
485 .pin_config_group_dbg_show
= imx_pinconf_group_dbg_show
,
488 static struct pinctrl_desc imx_pinctrl_desc
= {
489 .pctlops
= &imx_pctrl_ops
,
490 .pmxops
= &imx_pmx_ops
,
491 .confops
= &imx_pinconf_ops
,
492 .owner
= THIS_MODULE
,
496 * Each pin represented in fsl,pins consists of 5 u32 PIN_FUNC_ID and
497 * 1 u32 CONFIG, so 24 types in total for each pin.
499 #define FSL_PIN_SIZE 24
500 #define SHARE_FSL_PIN_SIZE 20
502 static int imx_pinctrl_parse_groups(struct device_node
*np
,
503 struct imx_pin_group
*grp
,
504 struct imx_pinctrl_soc_info
*info
,
512 dev_dbg(info
->dev
, "group(%d): %s\n", index
, np
->name
);
514 if (info
->flags
& SHARE_MUX_CONF_REG
)
515 pin_size
= SHARE_FSL_PIN_SIZE
;
517 pin_size
= FSL_PIN_SIZE
;
518 /* Initialise group */
519 grp
->name
= np
->name
;
522 * the binding format is fsl,pins = <PIN_FUNC_ID CONFIG ...>,
523 * do sanity check and calculate pins number
525 list
= of_get_property(np
, "fsl,pins", &size
);
527 dev_err(info
->dev
, "no fsl,pins property in node %s\n", np
->full_name
);
531 /* we do not check return since it's safe node passed down */
532 if (!size
|| size
% pin_size
) {
533 dev_err(info
->dev
, "Invalid fsl,pins property in node %s\n", np
->full_name
);
537 grp
->npins
= size
/ pin_size
;
538 grp
->pins
= devm_kzalloc(info
->dev
, grp
->npins
* sizeof(struct imx_pin
),
540 grp
->pin_ids
= devm_kzalloc(info
->dev
, grp
->npins
* sizeof(unsigned int),
542 if (!grp
->pins
|| ! grp
->pin_ids
)
545 for (i
= 0; i
< grp
->npins
; i
++) {
546 u32 mux_reg
= be32_to_cpu(*list
++);
549 struct imx_pin_reg
*pin_reg
;
550 struct imx_pin
*pin
= &grp
->pins
[i
];
552 if (!(info
->flags
& ZERO_OFFSET_VALID
) && !mux_reg
)
555 if (info
->flags
& SHARE_MUX_CONF_REG
) {
558 conf_reg
= be32_to_cpu(*list
++);
563 pin_id
= (mux_reg
!= -1) ? mux_reg
/ 4 : conf_reg
/ 4;
564 pin_reg
= &info
->pin_regs
[pin_id
];
566 grp
->pin_ids
[i
] = pin_id
;
567 pin_reg
->mux_reg
= mux_reg
;
568 pin_reg
->conf_reg
= conf_reg
;
569 pin
->input_reg
= be32_to_cpu(*list
++);
570 pin
->mux_mode
= be32_to_cpu(*list
++);
571 pin
->input_val
= be32_to_cpu(*list
++);
573 /* SION bit is in mux register */
574 config
= be32_to_cpu(*list
++);
575 if (config
& IMX_PAD_SION
)
576 pin
->mux_mode
|= IOMUXC_CONFIG_SION
;
577 pin
->config
= config
& ~IMX_PAD_SION
;
579 dev_dbg(info
->dev
, "%s: 0x%x 0x%08lx", info
->pins
[pin_id
].name
,
580 pin
->mux_mode
, pin
->config
);
586 static int imx_pinctrl_parse_functions(struct device_node
*np
,
587 struct imx_pinctrl_soc_info
*info
,
590 struct device_node
*child
;
591 struct imx_pmx_func
*func
;
592 struct imx_pin_group
*grp
;
595 dev_dbg(info
->dev
, "parse function(%d): %s\n", index
, np
->name
);
597 func
= &info
->functions
[index
];
599 /* Initialise function */
600 func
->name
= np
->name
;
601 func
->num_groups
= of_get_child_count(np
);
602 if (func
->num_groups
== 0) {
603 dev_err(info
->dev
, "no groups defined in %s\n", np
->full_name
);
606 func
->groups
= devm_kzalloc(info
->dev
,
607 func
->num_groups
* sizeof(char *), GFP_KERNEL
);
609 for_each_child_of_node(np
, child
) {
610 func
->groups
[i
] = child
->name
;
611 grp
= &info
->groups
[info
->group_index
++];
612 imx_pinctrl_parse_groups(child
, grp
, info
, i
++);
619 * Check if the DT contains pins in the direct child nodes. This indicates the
620 * newer DT format to store pins. This function returns true if the first found
621 * fsl,pins property is in a child of np. Otherwise false is returned.
623 static bool imx_pinctrl_dt_is_flat_functions(struct device_node
*np
)
625 struct device_node
*function_np
;
626 struct device_node
*pinctrl_np
;
628 for_each_child_of_node(np
, function_np
) {
629 if (of_property_read_bool(function_np
, "fsl,pins"))
632 for_each_child_of_node(function_np
, pinctrl_np
) {
633 if (of_property_read_bool(pinctrl_np
, "fsl,pins"))
641 static int imx_pinctrl_probe_dt(struct platform_device
*pdev
,
642 struct imx_pinctrl_soc_info
*info
)
644 struct device_node
*np
= pdev
->dev
.of_node
;
645 struct device_node
*child
;
653 flat_funcs
= imx_pinctrl_dt_is_flat_functions(np
);
657 nfuncs
= of_get_child_count(np
);
659 dev_err(&pdev
->dev
, "no functions defined\n");
664 info
->nfunctions
= nfuncs
;
665 info
->functions
= devm_kzalloc(&pdev
->dev
, nfuncs
* sizeof(struct imx_pmx_func
),
667 if (!info
->functions
)
671 info
->ngroups
= of_get_child_count(np
);
674 for_each_child_of_node(np
, child
)
675 info
->ngroups
+= of_get_child_count(child
);
677 info
->groups
= devm_kzalloc(&pdev
->dev
, info
->ngroups
* sizeof(struct imx_pin_group
),
683 imx_pinctrl_parse_functions(np
, info
, 0);
685 for_each_child_of_node(np
, child
)
686 imx_pinctrl_parse_functions(child
, info
, i
++);
692 int imx_pinctrl_probe(struct platform_device
*pdev
,
693 struct imx_pinctrl_soc_info
*info
)
695 struct device_node
*dev_np
= pdev
->dev
.of_node
;
696 struct device_node
*np
;
697 struct imx_pinctrl
*ipctl
;
698 struct resource
*res
;
701 if (!info
|| !info
->pins
|| !info
->npins
) {
702 dev_err(&pdev
->dev
, "wrong pinctrl info\n");
705 info
->dev
= &pdev
->dev
;
707 /* Create state holders etc for this driver */
708 ipctl
= devm_kzalloc(&pdev
->dev
, sizeof(*ipctl
), GFP_KERNEL
);
712 info
->pin_regs
= devm_kmalloc(&pdev
->dev
, sizeof(*info
->pin_regs
) *
713 info
->npins
, GFP_KERNEL
);
717 for (i
= 0; i
< info
->npins
; i
++) {
718 info
->pin_regs
[i
].mux_reg
= -1;
719 info
->pin_regs
[i
].conf_reg
= -1;
722 res
= platform_get_resource(pdev
, IORESOURCE_MEM
, 0);
723 ipctl
->base
= devm_ioremap_resource(&pdev
->dev
, res
);
724 if (IS_ERR(ipctl
->base
))
725 return PTR_ERR(ipctl
->base
);
727 if (of_property_read_bool(dev_np
, "fsl,input-sel")) {
728 np
= of_parse_phandle(dev_np
, "fsl,input-sel", 0);
730 ipctl
->input_sel_base
= of_iomap(np
, 0);
731 if (IS_ERR(ipctl
->input_sel_base
)) {
734 "iomuxc input select base address not found\n");
735 return PTR_ERR(ipctl
->input_sel_base
);
738 dev_err(&pdev
->dev
, "iomuxc fsl,input-sel property not found\n");
744 imx_pinctrl_desc
.name
= dev_name(&pdev
->dev
);
745 imx_pinctrl_desc
.pins
= info
->pins
;
746 imx_pinctrl_desc
.npins
= info
->npins
;
748 ret
= imx_pinctrl_probe_dt(pdev
, info
);
750 dev_err(&pdev
->dev
, "fail to probe dt properties\n");
755 ipctl
->dev
= info
->dev
;
756 platform_set_drvdata(pdev
, ipctl
);
757 ipctl
->pctl
= pinctrl_register(&imx_pinctrl_desc
, &pdev
->dev
, ipctl
);
758 if (IS_ERR(ipctl
->pctl
)) {
759 dev_err(&pdev
->dev
, "could not register IMX pinctrl driver\n");
760 return PTR_ERR(ipctl
->pctl
);
763 dev_info(&pdev
->dev
, "initialized IMX pinctrl driver\n");
768 int imx_pinctrl_remove(struct platform_device
*pdev
)
770 struct imx_pinctrl
*ipctl
= platform_get_drvdata(pdev
);
772 pinctrl_unregister(ipctl
->pctl
);