Thread (18 messages) 18 messages, 4 authors, 2012-11-07
STALE4958d
Revisions (2)
  1. v3 [diff vs current]
  2. v3 current

[PATCH 08/10] pinctrl: single: support pinconf generic

From: haojian.zhuang@gmail.com (Haojian Zhuang)
Date: 2012-11-07 07:27:28

On Thursday, November 1, 2012, Tony Lindgren wrote:
quoted
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -20,6 +20,7 @@
 #include <linux/of_device.h>
 #include <linux/of_address.h>

+#include <linux/pinctrl/pinconf-generic.h>
 #include <linux/pinctrl/pinctrl.h>
 #include <linux/pinctrl/pinmux.h>
@@ -28,6 +29,9 @@
 #define DRIVER_NAME                  "pinctrl-single"
 #define PCS_MUX_PINS_NAME            "pinctrl-single,pins"
 #define PCS_MUX_BITS_NAME            "pinctrl-single,bits"
+#define PCS_BIAS_NAME                        "pinctrl-single,bias"
+#define PCS_POWER_SOURCE_NAME                "pinctrl-single,power-source"
+#define PCS_SCHMITT_NAME             "pinctrl-single,input-schmitt"
 #define PCS_REG_NAME_LEN             ((sizeof(unsigned long) * 2) + 1)
 #define PCS_OFF_DISABLED             ~0U
 #define PCS_MAX_GPIO_VALUES          3
Here too you can remove the new defines.
quoted
 static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs,
                                              struct device_node *np,
                                              struct pinctrl_map **map,
+                                             unsigned num_configs,
                                              const char **pgnames)
 {
...

Then I suggest you add a generic pinconf-generic property to
indicate the controller supports pinconf. At least for omaps,
only some register ranges support pinconf. And by adding
pinconf-generic, you can parse it once during the probe of
pinctrl-single.c, and set pcs->pinconf flag.

Then you can use here and avoid calling of_property_read_u32
for about 600 times unnecessarily for omap4:
I don't want to add new property for this. I think that we can use
compatible name instead.

"pinctrl-single" is only for pinmux & gpio range.
"pinconf-single" is for pinmux & gpio range & generic pinconf.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help