<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/pinctrl/core.c, branch v3.4.30</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/pinctrl/core.c?h=v3.4.30</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/pinctrl/core.c?h=v3.4.30'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-04-11T07:31:02Z</updated>
<entry>
<title>pinctrl: implement pinctrl_check_ops</title>
<updated>2012-04-11T07:31:02Z</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@wwwdotorg.org</email>
</author>
<published>2012-03-16T20:54:25Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f84cc342b1999db11ece939e1d2bf0743eb4578b'/>
<id>urn:sha1:f84cc342b1999db11ece939e1d2bf0743eb4578b</id>
<content type='text'>
Most code assumes that the pinctrl ops are present. Validate this when
registering a pinctrl driver. Remove the one place in the code that
was checking whether one of these non-optional ops was present.

Signed-off-by: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: enhance mapping table to support pin config operations</title>
<updated>2012-03-05T10:25:11Z</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2012-03-02T20:05:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1e2082b520721734c358f776d34a069867214c8e'/>
<id>urn:sha1:1e2082b520721734c358f776d34a069867214c8e</id>
<content type='text'>
The pinctrl mapping table can now contain entries to:
* Set the mux function of a pin group
* Apply a set of pin config options to a pin or a group

This allows pinctrl_select_state() to apply pin configs settings as well
as mux settings.

v3: Fix find_pinctrl() to iterate over the correct list.
   s/_MUX_CONFIGS_/_CONFIGS_/ in mapping table macros.
   Fix documentation to use correct mapping table macro.
v2: Added numerous extra PIN_MAP_*() special-case macros.
   Fixed kerneldoc typo. Delete pinctrl_get_pin_id() and
   replace it with pin_get_from_name(). Various minor fixes.
   Updates due to rebase.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Dong Aisheng &lt;dong.aisheng@linaro.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: API changes to support multiple states per device</title>
<updated>2012-03-05T10:22:59Z</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2012-03-02T20:05:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6e5e959dde0d92d177f035652aeaa77f9330c9c6'/>
<id>urn:sha1:6e5e959dde0d92d177f035652aeaa77f9330c9c6</id>
<content type='text'>
The API model is changed from:

p = pinctrl_get(dev, "state1");
pinctrl_enable(p);
...
pinctrl_disable(p);
pinctrl_put(p);
p = pinctrl_get(dev, "state2");
pinctrl_enable(p);
...
pinctrl_disable(p);
pinctrl_put(p);

to this:

p = pinctrl_get(dev);
s1 = pinctrl_lookup_state(p, "state1");
s2 = pinctrl_lookup_state(p, "state2");
pinctrl_select_state(p, s1);
...
pinctrl_select_state(p, s2);
...
pinctrl_put(p);

This allows devices to directly transition between states without
disabling the pin controller programming and put()/get()ing the
configuration data each time. This model will also better suit pinconf
programming, which doesn't have a concept of "disable".

The special-case hogging feature of pin controllers is re-written to use
the regular APIs instead of special-case code. Hence, the pinmux-hogs
debugfs file is removed; see the top-level pinctrl-handles files for
equivalent data.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Dong Aisheng &lt;dong.aisheng@linaro.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: refactor struct pinctrl handling in core.c vs pinmux.c</title>
<updated>2012-03-05T10:20:50Z</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2012-03-02T20:05:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7ecdb16fe63e5b356335ebdc236adfb48cef31e1'/>
<id>urn:sha1:7ecdb16fe63e5b356335ebdc236adfb48cef31e1</id>
<content type='text'>
This change separates two aspects of struct pinctrl:

a) The data representation of the parsed mapping table, into:

   1) The top-level struct pinctrl object, a single entity returned
      by pinctrl_get().

   2) The parsed version of each mapping table entry, struct
      pinctrl_setting, of which there is one per mapping table entry.

b) The code that handles this; the code for (1) above is in core.c, and
   the code to parse/execute each entry in (2) above is in pinmux.c, while
   the iteration over multiple settings is lifted to core.c.

This will allow the following future changes:

1) pinctrl_get() API rework, so that struct pinctrl represents all states
   for the device, and the device can select between them without calling
   put()/get() again.

2) To support that, a struct pinctrl_state object will be inserted into
   the data model between the struct pinctrl and struct pinctrl_setting.

3) The mapping table will be extended to allow specification of pin config
   settings too. To support this, struct pinctrl_setting will be enhanced
   to store either mux settings or config settings, and functions will be
   added to pinconf.c to parse/execute pin configuration settings.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Acked-by: Dong Aisheng &lt;dong.aisheng@linaro.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: fix and simplify locking</title>
<updated>2012-03-05T10:19:49Z</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2012-03-02T20:05:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=57b676f9c1b7cd84397fe5a86c9bd2788ac4bd32'/>
<id>urn:sha1:57b676f9c1b7cd84397fe5a86c9bd2788ac4bd32</id>
<content type='text'>
There are many problems with the current pinctrl locking:

struct pinctrl_dev's gpio_ranges_lock isn't effective;
pinctrl_match_gpio_range() only holds this lock while searching for a gpio
range, but the found range is return and manipulated after releading the
lock. This could allow pinctrl_remove_gpio_range() for that range while it
is in use, and the caller may very well delete the range after removing it,
causing pinctrl code to touch the now-free range object.

Solving this requires the introduction of a higher-level lock, at least
a lock per pin controller, which both gpio range registration and
pinctrl_get()/put() will acquire.

There is missing locking on HW programming; pin controllers may pack the
configuration for different pins/groups/config options/... into one
register, and hence have to read-modify-write the register. This needs to
be protected, but currently isn't. Related, a future change will add a
"complete" op to the pin controller drivers, the idea being that each
state's programming will be programmed into the pinctrl driver followed
by the "complete" call, which may e.g. flush a register cache to HW. For
this to work, it must not be possible to interleave the pinctrl driver
calls for different devices.

As above, solving this requires the introduction of a higher-level lock,
at least a lock per pin controller, which will be held for the duration
of any pinctrl_enable()/disable() call.

However, each pinctrl mapping table entry may affect a different pin
controller if necessary. Hence, with a per-pin-controller lock, almost
any pinctrl API may need to acquire multiple locks, one per controller.
To avoid deadlock, these would need to be acquired in the same order in
all cases. This is extremely difficult to implement in the case of
pinctrl_get(), which doesn't know which pin controllers to lock until it
has parsed the entire mapping table, since it contains somewhat arbitrary
data.

The simplest solution here is to introduce a single lock that covers all
pin controllers at once. This will be acquired by all pinctrl APIs.

This then makes struct pinctrl's mutex irrelevant, since that single lock
will always be held whenever this mutex is currently held.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: assume map table entries can't have a NULL name field</title>
<updated>2012-03-02T15:20:54Z</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2012-03-02T01:48:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=110e4ec5a1cfe20190e7f8c2b8b4eef369de3c99'/>
<id>urn:sha1:110e4ec5a1cfe20190e7f8c2b8b4eef369de3c99</id>
<content type='text'>
pinctrl_register_mappings() already requires that every mapping table
entry have a non-NULL name field.

Logically, this makes sense too; drivers should always request a specific
named state so they know what they're getting. Relying on getting the
first mentioned state in the mapping table is error-prone, and a nasty
special case to implement, given that a given the mapping table may define
multiple states for a device.

Remove a small part of the documentation that talked about optionally
requesting a specific state; it's mandatory now.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Dong Aisheng &lt;dong.aisheng@linaro.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: introduce PINCTRL_STATE_DEFAULT, define hogs as that state</title>
<updated>2012-03-02T15:18:24Z</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2012-03-02T01:48:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=46919ae63d4820e76724beb655274ce143f0da0b'/>
<id>urn:sha1:46919ae63d4820e76724beb655274ce143f0da0b</id>
<content type='text'>
This provides a single centralized name for the default state.

Update PIN_MAP_* macros to use this state name, instead of requiring the
user to pass a state name in.

With this change, hog entries in the mapping table are defined as those
with state name PINCTRL_STATE_DEFAULT, i.e. all entries have the same
name. This interacts badly with the nested iteration over mapping table
entries in pinctrl_hog_maps() and pinctrl_hog_map() which would now
attempt to claim each hog mapping table entry multiple times. Replacing
the custom hog code with a simple pinctrl_get()/pinctrl_enable().

Update documentation and mapping tables to use this.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Dong Aisheng &lt;dong.aisheng@linaro.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: move pinctrl-maps debugfs file to top-level</title>
<updated>2012-02-29T18:10:56Z</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2012-02-24T00:04:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3eedb4372354a70ce63c9f4ec294d2eba0d79d17'/>
<id>urn:sha1:3eedb4372354a70ce63c9f4ec294d2eba0d79d17</id>
<content type='text'>
The debugfs file pinctrl-maps is a system-wide file, not specific to any
pin controller, so place it in the top-level directory.

Also, move the code implementing the file to keep the order of all the
functions matching the order they're created in pinctrl_init_*debugfs().
The only non-obvious change here is no private data is passed to
debugfs_create_file() or single_open().

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Dong Aisheng &lt;dong.aisheng@linaro.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: remove pin and hogs locks from struct pinctrl_dev</title>
<updated>2012-02-24T05:30:50Z</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2012-02-22T21:26:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2304b4737f492b6ee9b714d8129e153af0bef989'/>
<id>urn:sha1:2304b4737f492b6ee9b714d8129e153af0bef989</id>
<content type='text'>
struct pinctrl_dev's pin_desc_tree_lock and pinctrl_hogs_lock aren't
useful; the data they protect is read-only except when registering or
unregistering a pinctrl_dev, and at those times, it doesn't make sense to
protect one part of the structure independently from the rest.

Move pinctrl_init_device_debugfs() to the end of pinctrl_register() so
that debugfs can't access the struct pinctrl_dev until it's fully
initialized, i.e. after the hogs are set up.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: allocate sizeof(*p) instead of sizeof(struct foo)</title>
<updated>2012-02-24T05:28:56Z</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2012-02-22T21:26:00Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=02f5b98951c631a3c4b3cc398dd2b14d274a6155'/>
<id>urn:sha1:02f5b98951c631a3c4b3cc398dd2b14d274a6155</id>
<content type='text'>
This hopefully makes it harder to take the sizeof the wrong type.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Dong Aisheng &lt;dong.aisheng@linaro.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
</feed>
