diff options
author | Stephen Warren <swarren@nvidia.com> | 2011-12-02 17:08:37 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-06 05:29:22 -0500 |
commit | a0f203d384fadacba514748cd0095efeadeed96c (patch) | |
tree | 30fa69763a7eb33567b92625a81819ea01d538e0 /arch | |
parent | 102477b6380978b1532e5d1f769155026a332aff (diff) |
ASoC: WM8903: Fix platform data gpio_cfg confusion
wm8903_platform_data.gpio_cfg[] was intended to be interpreted as follows:
0: Don't touch this GPIO's configuration register
1..7fff: Write that value to the GPIO's configuration register
8000: Write zero to the GPIO's configuration register
other: Undefined (invalid)
The rationale is that platform data is usually global data, and a value of
zero means that the field wasn't explicitly set to anything (e.g. because
the field was new to the pdata type, and existing users weren't update to
initialize it) and hence the value zero should be ignored. 0x8000 is an
explicit way to get 0 in the register.
The code worked this way until commit 7cfe561 "ASoC: wm8903: Expose GPIOs
through gpiolib", where the behaviour was changed due to my lack of
awareness of the above rationale.
This patch reverts to the intended behaviour, and updates all in-tree users
to use the correct scheme. This also makes WM8903 consistent with other
devices that use a similar scheme.
WM8903_GPIO_NO_CONFIG is also renamed to WM8903_GPIO_CONFIG_ZERO so that
its name accurately reflects its purpose.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Cc: Olof Johansson <olof@lixom.net>
Cc: Colin Cross <ccross@android.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/board-harmony.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-seaboard.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c index f0bdc5e3fe52..3c57cdcdff4d 100644 --- a/arch/arm/mach-tegra/board-harmony.c +++ b/arch/arm/mach-tegra/board-harmony.c | |||
@@ -89,11 +89,11 @@ static struct wm8903_platform_data harmony_wm8903_pdata = { | |||
89 | .micdet_delay = 100, | 89 | .micdet_delay = 100, |
90 | .gpio_base = HARMONY_GPIO_WM8903(0), | 90 | .gpio_base = HARMONY_GPIO_WM8903(0), |
91 | .gpio_cfg = { | 91 | .gpio_cfg = { |
92 | WM8903_GPIO_NO_CONFIG, | ||
93 | WM8903_GPIO_NO_CONFIG, | ||
94 | 0, | 92 | 0, |
95 | WM8903_GPIO_NO_CONFIG, | 93 | 0, |
96 | WM8903_GPIO_NO_CONFIG, | 94 | WM8903_GPIO_CONFIG_ZERO, |
95 | 0, | ||
96 | 0, | ||
97 | }, | 97 | }, |
98 | }; | 98 | }; |
99 | 99 | ||
diff --git a/arch/arm/mach-tegra/board-seaboard.c b/arch/arm/mach-tegra/board-seaboard.c index bf13ea355efc..5c2f7751a33a 100644 --- a/arch/arm/mach-tegra/board-seaboard.c +++ b/arch/arm/mach-tegra/board-seaboard.c | |||
@@ -171,11 +171,11 @@ static struct wm8903_platform_data wm8903_pdata = { | |||
171 | .micdet_delay = 100, | 171 | .micdet_delay = 100, |
172 | .gpio_base = SEABOARD_GPIO_WM8903(0), | 172 | .gpio_base = SEABOARD_GPIO_WM8903(0), |
173 | .gpio_cfg = { | 173 | .gpio_cfg = { |
174 | WM8903_GPIO_NO_CONFIG, | ||
175 | WM8903_GPIO_NO_CONFIG, | ||
176 | 0, | 174 | 0, |
177 | WM8903_GPIO_NO_CONFIG, | 175 | 0, |
178 | WM8903_GPIO_NO_CONFIG, | 176 | WM8903_GPIO_CONFIG_ZERO, |
177 | 0, | ||
178 | 0, | ||
179 | }, | 179 | }, |
180 | }; | 180 | }; |
181 | 181 | ||