/*
* arch/arm/mach-omap1/omap-alsa-aic23.c
- *
+ *
* Alsa codec Driver for AIC23 chip on OSK5912 platform board
*
* Copyright (C) 2005 Instituto Nokia de Tecnologia - INdT - Manaus Brazil
* {daniel.petrini, david.cohen, anderson.briglia}@indt.org.br
*
* Copyright (C) 2006 Mika Laitio <lamikr@cc.jyu.fi>
- *
+ *
* Based in former alsa driver for osk and oss driver
*
* This program is free software; you can redistribute it and/or modify it
#include <asm/arch/omap-alsa.h>
#include "omap-alsa-aic23.h"
-static struct clk *aic23_mclk = 0;
+static struct clk *aic23_mclk;
/* aic23 related */
static const struct aic23_samplerate_reg_info
/*
* Hardware capabilities
*/
-
+
/*
* DAC USB-mode sampling rates (MCLK = 12 MHz)
* The rates and rate_reg_into MUST be in the same order
static struct snd_pcm_hardware aic23_snd_omap_alsa_playback = {
.info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
- SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID),
+ SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID),
.formats = (SNDRV_PCM_FMTBIT_S16_LE),
.rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |
SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 |
* codec dependent code.
*/
-extern int aic23_write_value(u8 reg, u16 value);
-
/* TLV320AIC23 is a write only device */
void audio_aic23_write(u8 address, u16 data)
{
/* Initialize the AIC23 internal state */
- /* Analog audio path control, DAC selected, delete INSEL_MIC for line in */
- audio_aic23_write(ANALOG_AUDIO_CONTROL_ADDR, DEFAULT_ANALOG_AUDIO_CONTROL);
+ /*
+ * Analog audio path control, DAC selected,
+ * delete INSEL_MIC for line-in
+ */
+ audio_aic23_write(ANALOG_AUDIO_CONTROL_ADDR,
+ DEFAULT_ANALOG_AUDIO_CONTROL);
/* Digital audio path control, de-emphasis control 44.1kHz */
audio_aic23_write(DIGITAL_AUDIO_CONTROL_ADDR, DEEMP_44K);
}
/*
- * Omap MCBSP clock configuration and Power Management
- *
- * Here we have some functions that allows clock to be enabled and
- * disabled only when needed. Besides doing clock configuration
- * it allows turn on/turn off audio when necessary.
+ * OMAP MCBSP clock configuration and Power Management
+ *
+ * Here we have some functions that allow clock to be enabled and
+ * disabled only when needed. Besides doing clock configuration
+ * it allows turn on/turn off audio when necessary.
*/
/*
* Do clock framework mclk search
/*
* Do some sanity check, set clock rate, starts it and
- * turn codec audio on
+ * turn codec audio on
*/
int aic23_clock_on(void)
{
clk_get_usecount(aic23_mclk));
/* Now turn the audio on */
- audio_aic23_write(POWER_DOWN_CONTROL_ADDR,
+ audio_aic23_write(POWER_DOWN_CONTROL_ADDR,
~DEVICE_POWER_OFF & ~OUT_OFF & ~DAC_OFF &
- ~ADC_OFF & ~MIC_OFF & ~LINE_OFF);
+ ~ADC_OFF & ~MIC_OFF & ~LINE_OFF);
return 0;
}
*/
int aic23_clock_off(void)
{
- if (clk_get_usecount(aic23_mclk) > 0) {
+ if (clk_get_usecount(aic23_mclk) > 0) {
if (clk_get_rate(aic23_mclk) != CODEC_CLOCK) {
printk(KERN_WARNING
"MCLK for audio should be %d Hz. But is %d Hz\n",
clk_disable(aic23_mclk);
}
-
+
audio_aic23_write(POWER_DOWN_CONTROL_ADDR,
DEVICE_POWER_OFF | OUT_OFF | DAC_OFF |
- ADC_OFF | MIC_OFF | LINE_OFF);
+ ADC_OFF | MIC_OFF | LINE_OFF);
return 0;
}
{
int ret;
struct omap_alsa_codec_config *codec_cfg;
-
+
codec_cfg = pdev->dev.platform_data;
if (codec_cfg != NULL) {
codec_cfg->hw_constraints_rates = &aic23_hw_constraints_rates;
- codec_cfg->snd_omap_alsa_playback = &aic23_snd_omap_alsa_playback;
- codec_cfg->snd_omap_alsa_capture = &aic23_snd_omap_alsa_capture;
+ codec_cfg->snd_omap_alsa_playback =
+ &aic23_snd_omap_alsa_playback;
+ codec_cfg->snd_omap_alsa_capture = &aic23_snd_omap_alsa_capture;
codec_cfg->codec_configure_dev = aic23_configure;
codec_cfg->codec_set_samplerate = aic23_set_samplerate;
codec_cfg->codec_clock_setup = aic23_clock_setup;
codec_cfg->codec_clock_on = aic23_clock_on;
codec_cfg->codec_clock_off = aic23_clock_off;
- codec_cfg->get_default_samplerate = aic23_get_default_samplerate;
+ codec_cfg->get_default_samplerate =
+ aic23_get_default_samplerate;
ret = snd_omap_alsa_post_probe(pdev, codec_cfg);
- }
- else
+ } else
ret = -ENODEV;
return ret;
}
static int __init omap_alsa_aic23_init(void)
{
int err;
-
+
ADEBUG();
err = platform_driver_register(&omap_alsa_driver);
static void __exit omap_alsa_aic23_exit(void)
{
ADEBUG();
-
+
platform_driver_unregister(&omap_alsa_driver);
}