#ifndef PXA2XX_LIB_H
#define PXA2XX_LIB_H
-#include <uapi/sound/asound.h>
-#include <linux/platform_device.h>
-
-/* PCM */
-struct snd_pcm_substream;
-struct snd_pcm_hw_params;
-struct snd_soc_pcm_runtime;
-struct snd_pcm;
-struct snd_soc_component;
-
-extern int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params);
-extern int pxa2xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd);
-extern snd_pcm_uframes_t pxa2xx_pcm_pointer(struct snd_pcm_substream *substream);
-extern int pxa2xx_pcm_prepare(struct snd_pcm_substream *substream);
-extern int pxa2xx_pcm_open(struct snd_pcm_substream *substream);
-extern int pxa2xx_pcm_close(struct snd_pcm_substream *substream);
-extern int pxa2xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm);
-extern int pxa2xx_soc_pcm_new(struct snd_soc_component *component,
- struct snd_soc_pcm_runtime *rtd);
-extern int pxa2xx_soc_pcm_open(struct snd_soc_component *component,
- struct snd_pcm_substream *substream);
-extern int pxa2xx_soc_pcm_close(struct snd_soc_component *component,
- struct snd_pcm_substream *substream);
-extern int pxa2xx_soc_pcm_hw_params(struct snd_soc_component *component,
- struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params);
-extern int pxa2xx_soc_pcm_prepare(struct snd_soc_component *component,
- struct snd_pcm_substream *substream);
-extern int pxa2xx_soc_pcm_trigger(struct snd_soc_component *component,
- struct snd_pcm_substream *substream, int cmd);
-extern snd_pcm_uframes_t
-pxa2xx_soc_pcm_pointer(struct snd_soc_component *component,
- struct snd_pcm_substream *substream);
-
-/* AC97 */
-
-extern int pxa2xx_ac97_read(int slot, unsigned short reg);
-extern int pxa2xx_ac97_write(int slot, unsigned short reg, unsigned short val);
-
-extern bool pxa2xx_ac97_try_warm_reset(void);
-extern bool pxa2xx_ac97_try_cold_reset(void);
-extern void pxa2xx_ac97_finish_reset(void);
-
-extern int pxa2xx_ac97_hw_suspend(void);
-extern int pxa2xx_ac97_hw_resume(void);
-
-extern int pxa2xx_ac97_hw_probe(struct platform_device *dev);
-extern void pxa2xx_ac97_hw_remove(struct platform_device *dev);
+#include <linux/types.h>
/* modem registers, used by touchscreen driver */
u32 pxa2xx_ac97_read_modr(void);
select SND_AC97_CODEC
endif # SND_ARM
-
-config SND_PXA2XX_LIB
- tristate
- select SND_DMAENGINE_PCM
-
-config SND_PXA2XX_LIB_AC97
- bool
obj-$(CONFIG_SND_ARMAACI) += snd-aaci.o
snd-aaci-y := aaci.o
-
-obj-$(CONFIG_SND_PXA2XX_LIB) += snd-pxa2xx-lib.o
-snd-pxa2xx-lib-y := pxa2xx-pcm-lib.o
-snd-pxa2xx-lib-$(CONFIG_SND_PXA2XX_LIB_AC97) += pxa2xx-ac97-lib.o
Say Y if you want to add support for SoC audio on the
Marvell PXA910 reference platform.
+config SND_PXA2XX_LIB
+ tristate
+ select SND_DMAENGINE_PCM
+
+config SND_PXA2XX_LIB_AC97
+ bool
endmenu
# SPDX-License-Identifier: GPL-2.0
# PXA Platform Support
snd-soc-pxa2xx-y := pxa2xx-pcm.o
-snd-soc-pxa2xx-ac97-y := pxa2xx-ac97.o
+snd-soc-pxa2xx-ac97-y := pxa2xx-ac97.o pxa2xx-ac97-lib.o
snd-soc-pxa2xx-i2s-y := pxa2xx-i2s.o
+snd-soc-pxa2xx-lib-y := pxa2xx-pcm-lib.o
snd-soc-pxa-ssp-y := pxa-ssp.o
snd-soc-mmp-sspa-y := mmp-sspa.o
obj-$(CONFIG_SND_PXA2XX_SOC_I2S) += snd-soc-pxa2xx-i2s.o
obj-$(CONFIG_SND_PXA_SOC_SSP) += snd-soc-pxa-ssp.o
obj-$(CONFIG_SND_MMP_SOC_SSPA) += snd-soc-mmp-sspa.o
+obj-$(CONFIG_SND_PXA2XX_LIB) += snd-soc-pxa2xx-lib.o
# PXA Machine Support
snd-soc-spitz-y := spitz.o
#include <sound/initval.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
-#include <sound/pxa2xx-lib.h>
#include <sound/dmaengine_pcm.h>
+#include "pxa2xx-lib.h"
#include "mmp-sspa.h"
/*
#include <sound/initval.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
-#include <sound/pxa2xx-lib.h>
#include <sound/dmaengine_pcm.h>
+#include "pxa2xx-lib.h"
#include "pxa-ssp.h"
/*
#include <linux/platform_data/asoc-pxa.h>
#include "pxa2xx-ac97-regs.h"
+#include "pxa2xx-lib.h"
static DEFINE_MUTEX(car_mutex);
static DECLARE_WAIT_QUEUE_HEAD(gsr_wq);
wait_event_timeout(gsr_wq, (readl(ac97_reg_base + GSR) | gsr_bits) & GSR_SDONE, 1);
return val;
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_read);
int pxa2xx_ac97_write(int slot, unsigned short reg, unsigned short val)
{
return ret;
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_write);
#ifdef CONFIG_PXA25x
static inline void pxa_ac97_warm_pxa25x(void)
return true;
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_try_warm_reset);
bool pxa2xx_ac97_try_cold_reset(void)
{
return true;
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_try_cold_reset);
void pxa2xx_ac97_finish_reset(void)
gcr |= GCR_SDONE_IE|GCR_CDONE_IE;
writel(gcr, ac97_reg_base + GCR);
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_finish_reset);
static irqreturn_t pxa2xx_ac97_irq(int irq, void *dev_id)
{
clk_disable_unprepare(ac97_clk);
return 0;
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_suspend);
int pxa2xx_ac97_hw_resume(void)
{
clk_prepare_enable(ac97_clk);
return 0;
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_resume);
#endif
int pxa2xx_ac97_hw_probe(struct platform_device *dev)
err_conf:
return ret;
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_probe);
void pxa2xx_ac97_hw_remove(struct platform_device *dev)
{
clk_put(ac97_clk);
ac97_clk = NULL;
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_remove);
u32 pxa2xx_ac97_read_modr(void)
{
#include <sound/core.h>
#include <sound/ac97_codec.h>
#include <sound/soc.h>
-#include <sound/pxa2xx-lib.h>
#include <sound/dmaengine_pcm.h>
#include <linux/platform_data/asoc-pxa.h>
+#include "pxa2xx-lib.h"
+
#define PCDR 0x0040 /* PCM FIFO Data Register */
#define MODR 0x0140 /* Modem FIFO Data Register */
#define MCDR 0x0060 /* Mic-in FIFO Data Register */
#include <sound/pcm.h>
#include <sound/initval.h>
#include <sound/soc.h>
-#include <sound/pxa2xx-lib.h>
#include <sound/dmaengine_pcm.h>
#include <linux/platform_data/asoc-pxa.h>
+#include "pxa2xx-lib.h"
#include "pxa2xx-i2s.h"
/*
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __PXA2XX_LIB_H
+#define __PXA2XX_LIB_H
+
+#include <uapi/sound/asound.h>
+#include <linux/platform_device.h>
+
+/* PCM */
+struct snd_pcm_substream;
+struct snd_pcm_hw_params;
+struct snd_soc_pcm_runtime;
+struct snd_pcm;
+struct snd_soc_component;
+
+int pxa2xx_soc_pcm_new(struct snd_soc_component *component,
+ struct snd_soc_pcm_runtime *rtd);
+int pxa2xx_soc_pcm_open(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream);
+int pxa2xx_soc_pcm_close(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream);
+int pxa2xx_soc_pcm_hw_params(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params);
+int pxa2xx_soc_pcm_prepare(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream);
+int pxa2xx_soc_pcm_trigger(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream, int cmd);
+snd_pcm_uframes_t pxa2xx_soc_pcm_pointer(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream);
+
+/* AC97 */
+int pxa2xx_ac97_read(int slot, unsigned short reg);
+int pxa2xx_ac97_write(int slot, unsigned short reg, unsigned short val);
+
+bool pxa2xx_ac97_try_warm_reset(void);
+bool pxa2xx_ac97_try_cold_reset(void);
+void pxa2xx_ac97_finish_reset(void);
+
+int pxa2xx_ac97_hw_suspend(void);
+int pxa2xx_ac97_hw_resume(void);
+
+int pxa2xx_ac97_hw_probe(struct platform_device *dev);
+void pxa2xx_ac97_hw_remove(struct platform_device *dev);
+
+#endif
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
-#include <sound/pxa2xx-lib.h>
#include <sound/dmaengine_pcm.h>
+#include "pxa2xx-lib.h"
+
static const struct snd_pcm_hardware pxa2xx_pcm_hardware = {
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
.fifo_size = 32,
};
-int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
+static int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
{
struct dma_chan *chan = snd_dmaengine_pcm_get_chan(substream);
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
return 0;
}
-EXPORT_SYMBOL(pxa2xx_pcm_hw_params);
-int pxa2xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
+static int pxa2xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
{
return snd_dmaengine_pcm_trigger(substream, cmd);
}
-EXPORT_SYMBOL(pxa2xx_pcm_trigger);
-snd_pcm_uframes_t
+static snd_pcm_uframes_t
pxa2xx_pcm_pointer(struct snd_pcm_substream *substream)
{
return snd_dmaengine_pcm_pointer(substream);
}
-EXPORT_SYMBOL(pxa2xx_pcm_pointer);
-int pxa2xx_pcm_prepare(struct snd_pcm_substream *substream)
+static int pxa2xx_pcm_prepare(struct snd_pcm_substream *substream)
{
return 0;
}
-EXPORT_SYMBOL(pxa2xx_pcm_prepare);
-int pxa2xx_pcm_open(struct snd_pcm_substream *substream)
+static int pxa2xx_pcm_open(struct snd_pcm_substream *substream)
{
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
substream, dma_request_slave_channel(snd_soc_rtd_to_cpu(rtd, 0)->dev,
dma_params->chan_name));
}
-EXPORT_SYMBOL(pxa2xx_pcm_open);
-int pxa2xx_pcm_close(struct snd_pcm_substream *substream)
+static int pxa2xx_pcm_close(struct snd_pcm_substream *substream)
{
return snd_dmaengine_pcm_close_release_chan(substream);
}
-EXPORT_SYMBOL(pxa2xx_pcm_close);
-int pxa2xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm)
+static int pxa2xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm)
{
size_t size = pxa2xx_pcm_hardware.buffer_bytes_max;
return snd_pcm_set_fixed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV_WC,
pcm->card->dev, size);
}
-EXPORT_SYMBOL(pxa2xx_pcm_preallocate_dma_buffer);
int pxa2xx_soc_pcm_new(struct snd_soc_component *component,
struct snd_soc_pcm_runtime *rtd)
#include <sound/core.h>
#include <sound/soc.h>
-#include <sound/pxa2xx-lib.h>
#include <sound/dmaengine_pcm.h>
+#include "pxa2xx-lib.h"
+
static const struct snd_soc_component_driver pxa2xx_soc_platform = {
.pcm_new = pxa2xx_soc_pcm_new,
.open = pxa2xx_soc_pcm_open,