提交 83a551c8 编写于 作者: A Arnd Bergmann

ARM: pxa: z2: use gpio lookup for audio device

The audio device is allocated by the audio driver, and it uses a gpio
number from the mach/z2.h header file.

Change it to use a gpio lookup table for the device allocated by the
driver to keep the header file local to the machine.
Acked-by: NMark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org
Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
Acked-by: NRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: NArnd Bergmann <arnd@arndb.de>
上级 21645983
...@@ -651,6 +651,15 @@ static void __init z2_spi_init(void) ...@@ -651,6 +651,15 @@ static void __init z2_spi_init(void)
static inline void z2_spi_init(void) {} static inline void z2_spi_init(void) {}
#endif #endif
static struct gpiod_lookup_table z2_audio_gpio_table = {
.dev_id = "soc-audio",
.table = {
GPIO_LOOKUP("gpio-pxa", GPIO37_ZIPITZ2_HEADSET_DETECT,
"hsdet-gpio", GPIO_ACTIVE_HIGH),
{ },
},
};
/****************************************************************************** /******************************************************************************
* Core power regulator * Core power regulator
******************************************************************************/ ******************************************************************************/
...@@ -755,6 +764,8 @@ static void __init z2_init(void) ...@@ -755,6 +764,8 @@ static void __init z2_init(void)
z2_keys_init(); z2_keys_init();
z2_pmic_init(); z2_pmic_init();
gpiod_add_lookup_table(&z2_audio_gpio_table);
pm_power_off = z2_power_off; pm_power_off = z2_power_off;
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/gpio.h> #include <linux/gpio/consumer.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/asoc-pxa.h>
#include <mach/z2.h>
#include "../codecs/wm8750.h" #include "../codecs/wm8750.h"
#include "pxa2xx-i2s.h" #include "pxa2xx-i2s.h"
...@@ -89,7 +88,6 @@ static struct snd_soc_jack_pin hs_jack_pins[] = { ...@@ -89,7 +88,6 @@ static struct snd_soc_jack_pin hs_jack_pins[] = {
/* Headset jack detection gpios */ /* Headset jack detection gpios */
static struct snd_soc_jack_gpio hs_jack_gpios[] = { static struct snd_soc_jack_gpio hs_jack_gpios[] = {
{ {
.gpio = GPIO37_ZIPITZ2_HEADSET_DETECT,
.name = "hsdet-gpio", .name = "hsdet-gpio",
.report = SND_JACK_HEADSET, .report = SND_JACK_HEADSET,
.debounce_time = 200, .debounce_time = 200,
...@@ -195,6 +193,7 @@ static int __init z2_init(void) ...@@ -195,6 +193,7 @@ static int __init z2_init(void)
if (!z2_snd_device) if (!z2_snd_device)
return -ENOMEM; return -ENOMEM;
hs_jack_gpios[0].gpiod_dev = &z2_snd_device->dev;
platform_set_drvdata(z2_snd_device, &snd_soc_z2); platform_set_drvdata(z2_snd_device, &snd_soc_z2);
ret = platform_device_add(z2_snd_device); ret = platform_device_add(z2_snd_device);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册