Commit eae17754ab1ffc88190ebcbd33b6bec79e6e559a

Authored by Mark Brown
Committed by Eric Miao
1 parent 5e901b37e4

[ARM] pxa: merge AC97 platform data structures

Currently there are two possible platform datas for the PXA AC97 driver:
one supported by the generic AC97 driver only which provides callbacks
to allow board-specific configuration at stream startup and teardown,
and another for pxa2xx-ac97-lib which allows configuration of the reset
GPIO for PXA2xx CPUs.

Obviously this won't actually work when using the generic AC97 driver
since the drivers will attempt to parse the platform data in both
formats. Fix this by merging the two structures.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Eric Miao <eric.miao@marvell.com>

Showing 3 changed files with 11 additions and 16 deletions Side-by-side Diff

arch/arm/mach-pxa/include/mach/audio.h
... ... @@ -4,12 +4,22 @@
4 4 #include <sound/core.h>
5 5 #include <sound/pcm.h>
6 6  
  7 +/*
  8 + * @reset_gpio: AC97 reset gpio (normally gpio113 or gpio95)
  9 + * a -1 value means no gpio will be used for reset
  10 +
  11 + * reset_gpio should only be specified for pxa27x CPUs where a silicon
  12 + * bug prevents correct operation of the reset line. If not specified,
  13 + * the default behaviour on these CPUs is to consider gpio 113 as the
  14 + * AC97 reset line, which is the default on most boards.
  15 + */
7 16 typedef struct {
8 17 int (*startup)(struct snd_pcm_substream *, void *);
9 18 void (*shutdown)(struct snd_pcm_substream *, void *);
10 19 void (*suspend)(void *);
11 20 void (*resume)(void *);
12 21 void *priv;
  22 + int reset_gpio;
13 23 } pxa2xx_audio_ops_t;
14 24  
15 25 extern void pxa_set_ac97_info(pxa2xx_audio_ops_t *ops);
include/sound/pxa2xx-lib.h
... ... @@ -42,20 +42,5 @@
42 42 extern int pxa2xx_ac97_hw_probe(struct platform_device *dev);
43 43 extern void pxa2xx_ac97_hw_remove(struct platform_device *dev);
44 44  
45   -/* AC97 platform_data */
46   -/**
47   - * struct pxa2xx_ac97_platform_data - pxa ac97 platform data
48   - * @reset_gpio: AC97 reset gpio (normally gpio113 or gpio95)
49   - * a -1 value means no gpio will be used for reset
50   - *
51   - * Platform data should only be specified for pxa27x CPUs where a silicon bug
52   - * prevents correct operation of the reset line. If not specified, the default
53   - * behaviour is to consider gpio 113 as the AC97 reset line, which is the
54   - * default on most boards.
55   - */
56   -struct pxa2xx_ac97_platform_data {
57   - int reset_gpio;
58   -};
59   -
60 45 #endif
sound/arm/pxa2xx-ac97-lib.c
... ... @@ -364,7 +364,7 @@
364 364 int __devinit pxa2xx_ac97_hw_probe(struct platform_device *dev)
365 365 {
366 366 int ret;
367   - struct pxa2xx_ac97_platform_data *pdata = dev->dev.platform_data;
  367 + pxa2xx_audio_ops_t *pdata = dev->dev.platform_data;
368 368  
369 369 if (pdata) {
370 370 switch (pdata->reset_gpio) {