File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,7 +73,6 @@ static struct pinctrl_desc foo_desc = {
7373 .pins = foo_pins,
7474 .npins = ARRAY_SIZE(foo_pins),
7575 .owner = THIS_MODULE,
76- .strict = true,
7776};
7877
7978int __init foo_probe(void)
@@ -715,6 +714,7 @@ static struct pinmux_ops foo_pmxops = {
715714 .get_function_name = foo_get_fname,
716715 .get_function_groups = foo_get_groups,
717716 .set_mux = foo_set_mux,
717+ .strict = true,
718718};
719719
720720/* Pinmux operations are handled by some pin controller */
Original file line number Diff line number Diff line change @@ -703,14 +703,14 @@ static struct pinmux_ops adi_pinmux_ops = {
703703 .get_function_name = adi_pinmux_get_func_name ,
704704 .get_function_groups = adi_pinmux_get_groups ,
705705 .gpio_request_enable = adi_pinmux_request_gpio ,
706+ .strict = true,
706707};
707708
708709
709710static struct pinctrl_desc adi_pinmux_desc = {
710711 .name = DRIVER_NAME ,
711712 .pctlops = & adi_pctrl_ops ,
712713 .pmxops = & adi_pinmux_ops ,
713- .strict = true,
714714 .owner = THIS_MODULE ,
715715};
716716
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ static int pin_request(struct pinctrl_dev *pctldev,
107107 desc -> name , desc -> gpio_owner , owner );
108108 goto out ;
109109 }
110- if (pctldev -> desc -> strict && desc -> mux_usecount &&
110+ if (ops -> strict && desc -> mux_usecount &&
111111 strcmp (desc -> mux_owner , owner )) {
112112 dev_err (pctldev -> dev ,
113113 "pin %s already requested by %s; cannot claim for %s\n" ,
@@ -123,7 +123,7 @@ static int pin_request(struct pinctrl_dev *pctldev,
123123 desc -> name , desc -> mux_owner , owner );
124124 goto out ;
125125 }
126- if (pctldev -> desc -> strict && desc -> gpio_owner ) {
126+ if (ops -> strict && desc -> gpio_owner ) {
127127 dev_err (pctldev -> dev ,
128128 "pin %s already requested by %s; cannot claim for %s\n" ,
129129 desc -> name , desc -> gpio_owner , owner );
Original file line number Diff line number Diff line change @@ -114,8 +114,6 @@ struct pinctrl_ops {
114114 * of the pins field above
115115 * @pctlops: pin control operation vtable, to support global concepts like
116116 * grouping of pins, this is optional.
117- * @strict: check both gpio_owner and mux_owner strictly before approving
118- the pin request
119117 * @pmxops: pinmux operations vtable, if you support pinmuxing in your driver
120118 * @confops: pin config operations vtable, if you support pin configuration in
121119 * your driver
@@ -134,7 +132,6 @@ struct pinctrl_desc {
134132 const struct pinctrl_ops * pctlops ;
135133 const struct pinmux_ops * pmxops ;
136134 const struct pinconf_ops * confops ;
137- bool strict ;
138135 struct module * owner ;
139136#ifdef CONFIG_GENERIC_PINCONF
140137 unsigned int num_custom_params ;
Original file line number Diff line number Diff line change @@ -56,6 +56,9 @@ struct pinctrl_dev;
5656 * depending on whether the GPIO is configured as input or output,
5757 * a direction selector function may be implemented as a backing
5858 * to the GPIO controllers that need pin muxing.
59+ * @strict: do not allow simultaneous use of the same pin for GPIO and another
60+ * function. Check both gpio_owner and mux_owner strictly before approving
61+ * the pin request.
5962 */
6063struct pinmux_ops {
6164 int (* request ) (struct pinctrl_dev * pctldev , unsigned offset );
@@ -79,6 +82,7 @@ struct pinmux_ops {
7982 struct pinctrl_gpio_range * range ,
8083 unsigned offset ,
8184 bool input );
85+ bool strict ;
8286};
8387
8488#endif /* CONFIG_PINMUX */
You can’t perform that action at this time.
0 commit comments