Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294063
b: refs/heads/master
c: 77a5988
h: refs/heads/master
i:
  294061: a9ddc2b
  294059: 176a418
  294055: e5735ec
  294047: 3b8cde2
v: v3
  • Loading branch information
Linus Walleij committed Feb 10, 2012
1 parent 3c7548a commit 0903cb5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: befe5bdfbb698b3bc57c58d0bd7ca3391c9275ed
refs/heads/master: 77a5988355f993840928d195f790a939200a4ff0
8 changes: 4 additions & 4 deletions trunk/Documentation/pinctrl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -989,21 +989,21 @@ is registered. This means that the core will attempt to call pinctrl_get() and
pinctrl_enable() on it immediately after the pin control device has been
registered.

This is enabled by simply setting the .hog_on_boot field in the map to true,
like this:
This is enabled by simply setting the .dev_name field in the map to the name
of the pin controller itself, like this:

{
.name = "POWERMAP"
.ctrl_dev_name = "pinctrl-foo",
.function = "power_func",
.hog_on_boot = true,
.dev_name = "pinctrl-foo",
},

Since it may be common to request the core to hog a few always-applicable
mux settings on the primary pin controller, there is a convenience macro for
this:

PIN_MAP_PRIMARY_SYS_HOG("POWERMAP", "power_func")
PIN_MAP_PRIMARY_SYS_HOG("POWERMAP", "pinctrl-foo", "power_func")

This gives the exact same result as the above construction.

Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/pinctrl/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,11 +793,9 @@ int pinctrl_hog_maps(struct pinctrl_dev *pctldev)
for (i = 0; i < pinctrl_maps_num; i++) {
struct pinctrl_map const *map = &pinctrl_maps[i];

if (!map->hog_on_boot)
continue;

if (map->ctrl_dev_name &&
!strcmp(map->ctrl_dev_name, devname)) {
!strcmp(map->ctrl_dev_name, devname) &&
!strcmp(map->dev_name, devname)) {
/* OK time to hog! */
ret = pinctrl_hog_map(pctldev, map);
if (ret)
Expand Down
18 changes: 6 additions & 12 deletions trunk/include/linux/pinctrl/machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,16 @@
* selects a certain specific pin group to activate for the function, if
* left as NULL, the first applicable group will be used
* @dev_name: the name of the device using this specific mapping, the name
* must be the same as in your struct device*
* @hog_on_boot: if this is set to true, the pin control subsystem will itself
* hog the mappings as the pinmux device drivers are attached, so this is
* typically used with system maps (mux mappings without an assigned
* device) that you want to get hogged and enabled by default as soon as
* a pinmux device supporting it is registered. These maps will not be
* disabled and put until the system shuts down.
* must be the same as in your struct device*. If this name is set to the
* same name as the pin controllers own dev_name(), the map entry will be
* hogged by the driver itself upon registration
*/
struct pinctrl_map {
const char *name;
const char *ctrl_dev_name;
const char *function;
const char *group;
const char *dev_name;
bool hog_on_boot;
};

/*
Expand All @@ -62,17 +57,16 @@ struct pinctrl_map {
* to be hogged by the pin control core until the system shuts down.
*/
#define PIN_MAP_SYS_HOG(a, b, c) \
{ .name = a, .ctrl_dev_name = b, .function = c, \
.hog_on_boot = true }
{ .name = a, .ctrl_dev_name = b, .dev_name = b, .function = c, }

/*
* Convenience macro to map a system function onto a certain pinctrl device
* using a specified group, to be hogged by the pin control core until the
* system shuts down.
*/
#define PIN_MAP_SYS_HOG_GROUP(a, b, c, d) \
{ .name = a, .ctrl_dev_name = b, .function = c, .group = d, \
.hog_on_boot = true }
{ .name = a, .ctrl_dev_name = b, .dev_name = b, .function = c, \
.group = d, }

#ifdef CONFIG_PINMUX

Expand Down

0 comments on commit 0903cb5

Please sign in to comment.