ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
/*
|
|
|
|
* cx20442.c -- CX20442 ALSA Soc Audio driver
|
|
|
|
*
|
|
|
|
* Copyright 2009 Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
|
|
|
|
*
|
|
|
|
* Initially based on sound/soc/codecs/wm8400.c
|
|
|
|
* Copyright 2008, 2009 Wolfson Microelectronics PLC.
|
|
|
|
* Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*/
|
|
|
|
|
2009-07-29 14:24:46 +04:00
|
|
|
#include <linux/tty.h>
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 11:04:11 +03:00
|
|
|
#include <linux/slab.h>
|
2011-07-15 20:38:28 +04:00
|
|
|
#include <linux/module.h>
|
2011-12-30 07:04:54 +04:00
|
|
|
#include <linux/regulator/consumer.h>
|
2009-07-29 14:24:46 +04:00
|
|
|
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
#include <sound/core.h>
|
|
|
|
#include <sound/initval.h>
|
2010-11-05 16:53:46 +03:00
|
|
|
#include <sound/soc.h>
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
|
|
|
|
#include "cx20442.h"
|
|
|
|
|
|
|
|
|
|
|
|
struct cx20442_priv {
|
2010-03-17 23:15:21 +03:00
|
|
|
void *control_data;
|
2011-12-30 07:04:54 +04:00
|
|
|
struct regulator *por;
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#define CX20442_PM 0x0
|
|
|
|
|
|
|
|
#define CX20442_TELIN 0
|
|
|
|
#define CX20442_TELOUT 1
|
|
|
|
#define CX20442_MIC 2
|
|
|
|
#define CX20442_SPKOUT 3
|
|
|
|
#define CX20442_AGC 4
|
|
|
|
|
|
|
|
static const struct snd_soc_dapm_widget cx20442_dapm_widgets[] = {
|
|
|
|
SND_SOC_DAPM_OUTPUT("TELOUT"),
|
|
|
|
SND_SOC_DAPM_OUTPUT("SPKOUT"),
|
|
|
|
SND_SOC_DAPM_OUTPUT("AGCOUT"),
|
|
|
|
|
|
|
|
SND_SOC_DAPM_MIXER("SPKOUT Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
|
|
|
|
|
|
|
|
SND_SOC_DAPM_PGA("TELOUT Amp", CX20442_PM, CX20442_TELOUT, 0, NULL, 0),
|
|
|
|
SND_SOC_DAPM_PGA("SPKOUT Amp", CX20442_PM, CX20442_SPKOUT, 0, NULL, 0),
|
|
|
|
SND_SOC_DAPM_PGA("SPKOUT AGC", CX20442_PM, CX20442_AGC, 0, NULL, 0),
|
|
|
|
|
|
|
|
SND_SOC_DAPM_DAC("DAC", "Playback", SND_SOC_NOPM, 0, 0),
|
|
|
|
SND_SOC_DAPM_ADC("ADC", "Capture", SND_SOC_NOPM, 0, 0),
|
|
|
|
|
|
|
|
SND_SOC_DAPM_MIXER("Input Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
|
|
|
|
|
|
|
|
SND_SOC_DAPM_MICBIAS("TELIN Bias", CX20442_PM, CX20442_TELIN, 0),
|
|
|
|
SND_SOC_DAPM_MICBIAS("MIC Bias", CX20442_PM, CX20442_MIC, 0),
|
|
|
|
|
|
|
|
SND_SOC_DAPM_PGA("MIC AGC", CX20442_PM, CX20442_AGC, 0, NULL, 0),
|
|
|
|
|
|
|
|
SND_SOC_DAPM_INPUT("TELIN"),
|
|
|
|
SND_SOC_DAPM_INPUT("MIC"),
|
|
|
|
SND_SOC_DAPM_INPUT("AGCIN"),
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct snd_soc_dapm_route cx20442_audio_map[] = {
|
|
|
|
{"TELOUT", NULL, "TELOUT Amp"},
|
|
|
|
|
|
|
|
{"SPKOUT", NULL, "SPKOUT Mixer"},
|
|
|
|
{"SPKOUT Mixer", NULL, "SPKOUT Amp"},
|
|
|
|
|
|
|
|
{"TELOUT Amp", NULL, "DAC"},
|
|
|
|
{"SPKOUT Amp", NULL, "DAC"},
|
|
|
|
|
|
|
|
{"SPKOUT Mixer", NULL, "SPKOUT AGC"},
|
|
|
|
{"SPKOUT AGC", NULL, "AGCIN"},
|
|
|
|
|
|
|
|
{"AGCOUT", NULL, "MIC AGC"},
|
|
|
|
{"MIC AGC", NULL, "MIC"},
|
|
|
|
|
|
|
|
{"MIC Bias", NULL, "MIC"},
|
|
|
|
{"Input Mixer", NULL, "MIC Bias"},
|
|
|
|
|
|
|
|
{"TELIN Bias", NULL, "TELIN"},
|
|
|
|
{"Input Mixer", NULL, "TELIN Bias"},
|
|
|
|
|
|
|
|
{"ADC", NULL, "Input Mixer"},
|
|
|
|
};
|
|
|
|
|
|
|
|
static unsigned int cx20442_read_reg_cache(struct snd_soc_codec *codec,
|
|
|
|
unsigned int reg)
|
|
|
|
{
|
|
|
|
u8 *reg_cache = codec->reg_cache;
|
|
|
|
|
2010-03-17 23:15:21 +03:00
|
|
|
if (reg >= codec->driver->reg_cache_size)
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
return reg_cache[reg];
|
|
|
|
}
|
|
|
|
|
|
|
|
enum v253_vls {
|
|
|
|
V253_VLS_NONE = 0,
|
|
|
|
V253_VLS_T,
|
|
|
|
V253_VLS_L,
|
|
|
|
V253_VLS_LT,
|
|
|
|
V253_VLS_S,
|
|
|
|
V253_VLS_ST,
|
|
|
|
V253_VLS_M,
|
|
|
|
V253_VLS_MST,
|
|
|
|
V253_VLS_S1,
|
|
|
|
V253_VLS_S1T,
|
|
|
|
V253_VLS_MS1T,
|
|
|
|
V253_VLS_M1,
|
|
|
|
V253_VLS_M1ST,
|
|
|
|
V253_VLS_M1S1T,
|
|
|
|
V253_VLS_H,
|
|
|
|
V253_VLS_HT,
|
|
|
|
V253_VLS_MS,
|
|
|
|
V253_VLS_MS1,
|
|
|
|
V253_VLS_M1S,
|
|
|
|
V253_VLS_M1S1,
|
|
|
|
V253_VLS_TEST,
|
|
|
|
};
|
|
|
|
|
|
|
|
static int cx20442_pm_to_v253_vls(u8 value)
|
|
|
|
{
|
2009-07-28 22:24:12 +04:00
|
|
|
switch (value & ~(1 << CX20442_AGC)) {
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
case 0:
|
|
|
|
return V253_VLS_T;
|
|
|
|
case (1 << CX20442_SPKOUT):
|
|
|
|
case (1 << CX20442_MIC):
|
|
|
|
case (1 << CX20442_SPKOUT) | (1 << CX20442_MIC):
|
|
|
|
return V253_VLS_M1S1;
|
|
|
|
case (1 << CX20442_TELOUT):
|
|
|
|
case (1 << CX20442_TELIN):
|
|
|
|
case (1 << CX20442_TELOUT) | (1 << CX20442_TELIN):
|
|
|
|
return V253_VLS_L;
|
|
|
|
case (1 << CX20442_TELOUT) | (1 << CX20442_MIC):
|
|
|
|
return V253_VLS_NONE;
|
|
|
|
}
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
static int cx20442_pm_to_v253_vsp(u8 value)
|
|
|
|
{
|
2009-07-28 22:24:12 +04:00
|
|
|
switch (value & ~(1 << CX20442_AGC)) {
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
case (1 << CX20442_SPKOUT):
|
|
|
|
case (1 << CX20442_MIC):
|
|
|
|
case (1 << CX20442_SPKOUT) | (1 << CX20442_MIC):
|
|
|
|
return (bool)(value & (1 << CX20442_AGC));
|
|
|
|
}
|
|
|
|
return (value & (1 << CX20442_AGC)) ? -EINVAL : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int cx20442_write(struct snd_soc_codec *codec, unsigned int reg,
|
|
|
|
unsigned int value)
|
|
|
|
{
|
2010-03-17 23:15:21 +03:00
|
|
|
struct cx20442_priv *cx20442 = snd_soc_codec_get_drvdata(codec);
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
u8 *reg_cache = codec->reg_cache;
|
|
|
|
int vls, vsp, old, len;
|
|
|
|
char buf[18];
|
|
|
|
|
2010-03-17 23:15:21 +03:00
|
|
|
if (reg >= codec->driver->reg_cache_size)
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
return -EINVAL;
|
|
|
|
|
2009-07-28 22:24:12 +04:00
|
|
|
/* hw_write and control_data pointers required for talking to the modem
|
2009-07-29 14:24:46 +04:00
|
|
|
* are expected to be set by the line discipline initialization code */
|
2010-03-17 23:15:21 +03:00
|
|
|
if (!codec->hw_write || !cx20442->control_data)
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
return -EIO;
|
|
|
|
|
|
|
|
old = reg_cache[reg];
|
|
|
|
reg_cache[reg] = value;
|
|
|
|
|
|
|
|
vls = cx20442_pm_to_v253_vls(value);
|
|
|
|
if (vls < 0)
|
|
|
|
return vls;
|
|
|
|
|
|
|
|
vsp = cx20442_pm_to_v253_vsp(value);
|
2009-07-28 22:24:12 +04:00
|
|
|
if (vsp < 0)
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
return vsp;
|
|
|
|
|
|
|
|
if ((vls == V253_VLS_T) ||
|
|
|
|
(vls == cx20442_pm_to_v253_vls(old))) {
|
|
|
|
if (vsp == cx20442_pm_to_v253_vsp(old))
|
|
|
|
return 0;
|
|
|
|
len = snprintf(buf, ARRAY_SIZE(buf), "at+vsp=%d\r", vsp);
|
|
|
|
} else if (vsp == cx20442_pm_to_v253_vsp(old))
|
|
|
|
len = snprintf(buf, ARRAY_SIZE(buf), "at+vls=%d\r", vls);
|
|
|
|
else
|
|
|
|
len = snprintf(buf, ARRAY_SIZE(buf),
|
|
|
|
"at+vls=%d;+vsp=%d\r", vls, vsp);
|
|
|
|
|
|
|
|
if (unlikely(len > (ARRAY_SIZE(buf) - 1)))
|
|
|
|
return -ENOMEM;
|
|
|
|
|
2009-08-06 14:24:54 +04:00
|
|
|
dev_dbg(codec->dev, "%s: %s\n", __func__, buf);
|
2010-03-17 23:15:21 +03:00
|
|
|
if (codec->hw_write(cx20442->control_data, buf, len) != len)
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
return -EIO;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-07-29 14:24:46 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Line discpline related code
|
|
|
|
*
|
|
|
|
* Any of the callback functions below can be used in two ways:
|
|
|
|
* 1) registerd by a machine driver as one of line discipline operations,
|
|
|
|
* 2) called from a machine's provided line discipline callback function
|
|
|
|
* in case when extra machine specific code must be run as well.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Modem init: echo off, digital speaker off, quiet off, voice mode */
|
|
|
|
static const char *v253_init = "ate0m0q0+fclass=8\r";
|
|
|
|
|
|
|
|
/* Line discipline .open() */
|
|
|
|
static int v253_open(struct tty_struct *tty)
|
|
|
|
{
|
|
|
|
int ret, len = strlen(v253_init);
|
|
|
|
|
|
|
|
/* Doesn't make sense without write callback */
|
|
|
|
if (!tty->ops->write)
|
|
|
|
return -EINVAL;
|
|
|
|
|
2010-03-17 23:15:21 +03:00
|
|
|
/* Won't work if no codec pointer has been passed by a card driver */
|
|
|
|
if (!tty->disc_data)
|
|
|
|
return -ENODEV;
|
2009-07-29 14:24:46 +04:00
|
|
|
|
|
|
|
if (tty->ops->write(tty, v253_init, len) != len) {
|
|
|
|
ret = -EIO;
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
/* Actual setup will be performed after the modem responds. */
|
|
|
|
return 0;
|
|
|
|
err:
|
|
|
|
tty->disc_data = NULL;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Line discipline .close() */
|
|
|
|
static void v253_close(struct tty_struct *tty)
|
|
|
|
{
|
|
|
|
struct snd_soc_codec *codec = tty->disc_data;
|
2010-03-17 23:15:21 +03:00
|
|
|
struct cx20442_priv *cx20442;
|
2009-07-29 14:24:46 +04:00
|
|
|
|
|
|
|
tty->disc_data = NULL;
|
|
|
|
|
|
|
|
if (!codec)
|
|
|
|
return;
|
|
|
|
|
2010-03-17 23:15:21 +03:00
|
|
|
cx20442 = snd_soc_codec_get_drvdata(codec);
|
|
|
|
|
2009-07-29 14:24:46 +04:00
|
|
|
/* Prevent the codec driver from further accessing the modem */
|
|
|
|
codec->hw_write = NULL;
|
2010-03-17 23:15:21 +03:00
|
|
|
cx20442->control_data = NULL;
|
2014-07-18 00:01:07 +04:00
|
|
|
codec->component.card->pop_time = 0;
|
2009-07-29 14:24:46 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Line discipline .hangup() */
|
|
|
|
static int v253_hangup(struct tty_struct *tty)
|
|
|
|
{
|
|
|
|
v253_close(tty);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Line discipline .receive_buf() */
|
2011-06-04 02:00:50 +04:00
|
|
|
static void v253_receive(struct tty_struct *tty,
|
|
|
|
const unsigned char *cp, char *fp, int count)
|
2009-07-29 14:24:46 +04:00
|
|
|
{
|
|
|
|
struct snd_soc_codec *codec = tty->disc_data;
|
2010-03-17 23:15:21 +03:00
|
|
|
struct cx20442_priv *cx20442;
|
2009-07-29 14:24:46 +04:00
|
|
|
|
|
|
|
if (!codec)
|
2011-06-04 02:00:50 +04:00
|
|
|
return;
|
2009-07-29 14:24:46 +04:00
|
|
|
|
2010-03-17 23:15:21 +03:00
|
|
|
cx20442 = snd_soc_codec_get_drvdata(codec);
|
|
|
|
|
|
|
|
if (!cx20442->control_data) {
|
2009-07-29 14:24:46 +04:00
|
|
|
/* First modem response, complete setup procedure */
|
|
|
|
|
|
|
|
/* Set up codec driver access to modem controls */
|
2010-03-17 23:15:21 +03:00
|
|
|
cx20442->control_data = tty;
|
2009-07-29 14:24:46 +04:00
|
|
|
codec->hw_write = (hw_write_t)tty->ops->write;
|
2014-07-18 00:01:07 +04:00
|
|
|
codec->component.card->pop_time = 1;
|
2009-07-29 14:24:46 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Line discipline .write_wakeup() */
|
|
|
|
static void v253_wakeup(struct tty_struct *tty)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
struct tty_ldisc_ops v253_ops = {
|
|
|
|
.magic = TTY_LDISC_MAGIC,
|
|
|
|
.name = "cx20442",
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.open = v253_open,
|
|
|
|
.close = v253_close,
|
|
|
|
.hangup = v253_hangup,
|
|
|
|
.receive_buf = v253_receive,
|
|
|
|
.write_wakeup = v253_wakeup,
|
|
|
|
};
|
|
|
|
EXPORT_SYMBOL_GPL(v253_ops);
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Codec DAI
|
|
|
|
*/
|
|
|
|
|
2010-03-17 23:15:21 +03:00
|
|
|
static struct snd_soc_dai_driver cx20442_dai = {
|
2010-08-19 17:15:50 +04:00
|
|
|
.name = "cx20442-voice",
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
.playback = {
|
|
|
|
.stream_name = "Playback",
|
|
|
|
.channels_min = 1,
|
|
|
|
.channels_max = 1,
|
|
|
|
.rates = SNDRV_PCM_RATE_8000,
|
|
|
|
.formats = SNDRV_PCM_FMTBIT_S16_LE,
|
|
|
|
},
|
|
|
|
.capture = {
|
|
|
|
.stream_name = "Capture",
|
|
|
|
.channels_min = 1,
|
|
|
|
.channels_max = 1,
|
|
|
|
.rates = SNDRV_PCM_RATE_8000,
|
|
|
|
.formats = SNDRV_PCM_FMTBIT_S16_LE,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-12-30 07:04:54 +04:00
|
|
|
static int cx20442_set_bias_level(struct snd_soc_codec *codec,
|
|
|
|
enum snd_soc_bias_level level)
|
|
|
|
{
|
|
|
|
struct cx20442_priv *cx20442 = snd_soc_codec_get_drvdata(codec);
|
|
|
|
int err = 0;
|
|
|
|
|
|
|
|
switch (level) {
|
|
|
|
case SND_SOC_BIAS_PREPARE:
|
|
|
|
if (codec->dapm.bias_level != SND_SOC_BIAS_STANDBY)
|
|
|
|
break;
|
|
|
|
if (IS_ERR(cx20442->por))
|
|
|
|
err = PTR_ERR(cx20442->por);
|
|
|
|
else
|
|
|
|
err = regulator_enable(cx20442->por);
|
|
|
|
break;
|
|
|
|
case SND_SOC_BIAS_STANDBY:
|
|
|
|
if (codec->dapm.bias_level != SND_SOC_BIAS_PREPARE)
|
|
|
|
break;
|
|
|
|
if (IS_ERR(cx20442->por))
|
|
|
|
err = PTR_ERR(cx20442->por);
|
|
|
|
else
|
|
|
|
err = regulator_disable(cx20442->por);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (!err)
|
|
|
|
codec->dapm.bias_level = level;
|
|
|
|
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
2010-03-17 23:15:21 +03:00
|
|
|
static int cx20442_codec_probe(struct snd_soc_codec *codec)
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
{
|
2010-03-17 23:15:21 +03:00
|
|
|
struct cx20442_priv *cx20442;
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
|
2010-03-17 23:15:21 +03:00
|
|
|
cx20442 = kzalloc(sizeof(struct cx20442_priv), GFP_KERNEL);
|
|
|
|
if (cx20442 == NULL)
|
|
|
|
return -ENOMEM;
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
|
2011-12-30 07:04:54 +04:00
|
|
|
cx20442->por = regulator_get(codec->dev, "POR");
|
|
|
|
if (IS_ERR(cx20442->por))
|
|
|
|
dev_warn(codec->dev, "failed to get the regulator");
|
2010-03-17 23:15:21 +03:00
|
|
|
cx20442->control_data = NULL;
|
2011-12-30 07:04:54 +04:00
|
|
|
|
|
|
|
snd_soc_codec_set_drvdata(codec, cx20442);
|
2010-03-17 23:15:21 +03:00
|
|
|
codec->hw_write = NULL;
|
2014-07-18 00:01:07 +04:00
|
|
|
codec->component.card->pop_time = 0;
|
2010-03-17 23:15:21 +03:00
|
|
|
|
|
|
|
return 0;
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* power down chip */
|
2010-03-17 23:15:21 +03:00
|
|
|
static int cx20442_codec_remove(struct snd_soc_codec *codec)
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
{
|
2010-03-17 23:15:21 +03:00
|
|
|
struct cx20442_priv *cx20442 = snd_soc_codec_get_drvdata(codec);
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
|
2010-03-17 23:15:21 +03:00
|
|
|
if (cx20442->control_data) {
|
2014-03-04 13:20:56 +04:00
|
|
|
struct tty_struct *tty = cx20442->control_data;
|
|
|
|
tty_hangup(tty);
|
2010-03-17 23:15:21 +03:00
|
|
|
}
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
|
2011-12-30 07:04:54 +04:00
|
|
|
if (!IS_ERR(cx20442->por)) {
|
|
|
|
/* should be already in STANDBY, hence disabled */
|
|
|
|
regulator_put(cx20442->por);
|
|
|
|
}
|
|
|
|
|
|
|
|
snd_soc_codec_set_drvdata(codec, NULL);
|
2010-03-17 23:15:21 +03:00
|
|
|
kfree(cx20442);
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
ASoC: CX20442: fix wrong reg_cache_default content
Content of the CX20442's snd_soc_codec_driver.reg_cache_default pointed
area, introduced with my recent NULL pointer dereferece fix (commit
f019ee5feb344ff0b22b58df4568676295aae14f), occured wrong after further
testing, more thorough than just booting successfully. There are two
problems with it:
1) It should read
(1 << CX20442_TELOUT) | (1 << CX20442_MIC),
not
CX20442_TELOUT | CX20442_MIC.
2) While correctly matching actual codec hardware state on boot when
fixed per 1), a few more code modifications would still be required
to reflect that state not only into register cache, but also force
them into DAPM pins state, otherwise an inconsitency occures which
may prevent further codec state changes from being applied correctly.
As a result, the phone stops ringing after reboot, until someone
picks up the handset for the first time.
Revert that reg_cache_default content to a working, previous de facto
default value of 0, in hope this change can still be accepted as an rc
cycle fix.
Created and tested against linux-2.6.38-rc4
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-02-10 15:24:32 +03:00
|
|
|
static const u8 cx20442_reg;
|
2011-02-01 15:01:17 +03:00
|
|
|
|
2010-03-17 23:15:21 +03:00
|
|
|
static struct snd_soc_codec_driver cx20442_codec_dev = {
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
.probe = cx20442_codec_probe,
|
|
|
|
.remove = cx20442_codec_remove,
|
2011-12-30 07:04:54 +04:00
|
|
|
.set_bias_level = cx20442_set_bias_level,
|
2011-02-01 15:01:17 +03:00
|
|
|
.reg_cache_default = &cx20442_reg,
|
2010-03-17 23:15:21 +03:00
|
|
|
.reg_cache_size = 1,
|
|
|
|
.reg_word_size = sizeof(u8),
|
|
|
|
.read = cx20442_read_reg_cache,
|
|
|
|
.write = cx20442_write,
|
2011-03-30 17:53:09 +04:00
|
|
|
.dapm_widgets = cx20442_dapm_widgets,
|
|
|
|
.num_dapm_widgets = ARRAY_SIZE(cx20442_dapm_widgets),
|
|
|
|
.dapm_routes = cx20442_audio_map,
|
|
|
|
.num_dapm_routes = ARRAY_SIZE(cx20442_audio_map),
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
static int cx20442_platform_probe(struct platform_device *pdev)
|
|
|
|
{
|
2010-03-17 23:15:21 +03:00
|
|
|
return snd_soc_register_codec(&pdev->dev,
|
|
|
|
&cx20442_codec_dev, &cx20442_dai, 1);
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static int __exit cx20442_platform_remove(struct platform_device *pdev)
|
|
|
|
{
|
2010-03-17 23:15:21 +03:00
|
|
|
snd_soc_unregister_codec(&pdev->dev);
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct platform_driver cx20442_platform_driver = {
|
|
|
|
.driver = {
|
2010-03-17 23:15:21 +03:00
|
|
|
.name = "cx20442-codec",
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
.owner = THIS_MODULE,
|
|
|
|
},
|
|
|
|
.probe = cx20442_platform_probe,
|
|
|
|
.remove = __exit_p(cx20442_platform_remove),
|
|
|
|
};
|
|
|
|
|
2011-11-24 02:52:08 +04:00
|
|
|
module_platform_driver(cx20442_platform_driver);
|
ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 07:22:28 +04:00
|
|
|
|
|
|
|
MODULE_DESCRIPTION("ASoC CX20442-11 voice modem codec driver");
|
|
|
|
MODULE_AUTHOR("Janusz Krzysztofik");
|
|
|
|
MODULE_LICENSE("GPL");
|
2010-03-17 23:15:21 +03:00
|
|
|
MODULE_ALIAS("platform:cx20442-codec");
|