2019-05-27 14:55:01 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
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 11:22:28 +08: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>
|
|
|
|
*/
|
|
|
|
|
2009-07-29 18:24:46 +08: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 16:04:11 +08:00
|
|
|
#include <linux/slab.h>
|
2011-07-16 00:38:28 +08:00
|
|
|
#include <linux/module.h>
|
2011-12-30 11:04:54 +08:00
|
|
|
#include <linux/regulator/consumer.h>
|
2009-07-29 18:24:46 +08: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 11:22:28 +08:00
|
|
|
#include <sound/core.h>
|
|
|
|
#include <sound/initval.h>
|
2010-11-05 21:53:46 +08: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 11:22:28 +08:00
|
|
|
|
|
|
|
#include "cx20442.h"
|
|
|
|
|
|
|
|
|
|
|
|
struct cx20442_priv {
|
2017-11-09 09:04:09 +08:00
|
|
|
struct tty_struct *tty;
|
2011-12-30 11:04:54 +08:00
|
|
|
struct regulator *por;
|
2018-01-16 10:00:18 +08:00
|
|
|
u8 reg_cache;
|
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 11:22:28 +08: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"},
|
|
|
|
};
|
|
|
|
|
2018-01-29 12:15:57 +08:00
|
|
|
static unsigned int cx20442_read_reg_cache(struct snd_soc_component *component,
|
2018-01-16 10:00:18 +08:00
|
|
|
unsigned int reg)
|
|
|
|
{
|
2018-01-29 12:15:57 +08:00
|
|
|
struct cx20442_priv *cx20442 = snd_soc_component_get_drvdata(component);
|
2018-01-16 10:00:18 +08:00
|
|
|
|
|
|
|
if (reg >= 1)
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
return cx20442->reg_cache;
|
|
|
|
}
|
|
|
|
|
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 11:22:28 +08:00
|
|
|
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-29 02:24:12 +08: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 11:22:28 +08: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-29 02:24:12 +08: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 11:22:28 +08: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;
|
|
|
|
}
|
|
|
|
|
2018-01-29 12:15:57 +08:00
|
|
|
static int cx20442_write(struct snd_soc_component *component, unsigned int reg,
|
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 11:22:28 +08:00
|
|
|
unsigned int value)
|
|
|
|
{
|
2018-01-29 12:15:57 +08:00
|
|
|
struct cx20442_priv *cx20442 = snd_soc_component_get_drvdata(component);
|
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 11:22:28 +08:00
|
|
|
int vls, vsp, old, len;
|
|
|
|
char buf[18];
|
|
|
|
|
2018-01-16 10:00:18 +08:00
|
|
|
if (reg >= 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 11:22:28 +08:00
|
|
|
return -EINVAL;
|
|
|
|
|
2017-11-09 09:04:09 +08:00
|
|
|
/* tty and write pointers required for talking to the modem
|
2009-07-29 18:24:46 +08:00
|
|
|
* are expected to be set by the line discipline initialization code */
|
2017-11-09 09:04:09 +08:00
|
|
|
if (!cx20442->tty || !cx20442->tty->ops->write)
|
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 11:22:28 +08:00
|
|
|
return -EIO;
|
|
|
|
|
2018-01-16 10:00:18 +08:00
|
|
|
old = cx20442->reg_cache;
|
|
|
|
cx20442->reg_cache = value;
|
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 11:22:28 +08:00
|
|
|
|
|
|
|
vls = cx20442_pm_to_v253_vls(value);
|
|
|
|
if (vls < 0)
|
|
|
|
return vls;
|
|
|
|
|
|
|
|
vsp = cx20442_pm_to_v253_vsp(value);
|
2009-07-29 02:24:12 +08: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 11:22:28 +08: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;
|
|
|
|
|
2018-01-29 12:15:57 +08:00
|
|
|
dev_dbg(component->dev, "%s: %s\n", __func__, buf);
|
2017-11-09 09:04:09 +08:00
|
|
|
if (cx20442->tty->ops->write(cx20442->tty, 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 11:22:28 +08:00
|
|
|
return -EIO;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2009-07-29 18:24:46 +08: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 */
|
2021-07-22 19:51:41 +08:00
|
|
|
static const char v253_init[] = "ate0m0q0+fclass=8\r";
|
2009-07-29 18:24:46 +08:00
|
|
|
|
|
|
|
/* 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-18 04:15:21 +08:00
|
|
|
/* Won't work if no codec pointer has been passed by a card driver */
|
|
|
|
if (!tty->disc_data)
|
|
|
|
return -ENODEV;
|
2009-07-29 18:24:46 +08:00
|
|
|
|
2016-06-17 04:04:35 +08:00
|
|
|
tty->receive_room = 16;
|
2009-07-29 18:24:46 +08: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)
|
|
|
|
{
|
2018-01-29 12:15:57 +08:00
|
|
|
struct snd_soc_component *component = tty->disc_data;
|
2010-03-18 04:15:21 +08:00
|
|
|
struct cx20442_priv *cx20442;
|
2009-07-29 18:24:46 +08:00
|
|
|
|
|
|
|
tty->disc_data = NULL;
|
|
|
|
|
2018-01-29 12:15:57 +08:00
|
|
|
if (!component)
|
2009-07-29 18:24:46 +08:00
|
|
|
return;
|
|
|
|
|
2018-01-29 12:15:57 +08:00
|
|
|
cx20442 = snd_soc_component_get_drvdata(component);
|
2010-03-18 04:15:21 +08:00
|
|
|
|
2009-07-29 18:24:46 +08:00
|
|
|
/* Prevent the codec driver from further accessing the modem */
|
2017-11-09 09:04:09 +08:00
|
|
|
cx20442->tty = NULL;
|
2018-01-29 12:15:57 +08:00
|
|
|
component->card->pop_time = 0;
|
2009-07-29 18:24:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Line discipline .hangup() */
|
2021-09-14 17:11:22 +08:00
|
|
|
static void v253_hangup(struct tty_struct *tty)
|
2009-07-29 18:24:46 +08:00
|
|
|
{
|
|
|
|
v253_close(tty);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Line discipline .receive_buf() */
|
2023-08-10 17:14:51 +08:00
|
|
|
static void v253_receive(struct tty_struct *tty, const u8 *cp, const u8 *fp,
|
2023-08-10 17:14:50 +08:00
|
|
|
size_t count)
|
2009-07-29 18:24:46 +08:00
|
|
|
{
|
2018-01-29 12:15:57 +08:00
|
|
|
struct snd_soc_component *component = tty->disc_data;
|
2010-03-18 04:15:21 +08:00
|
|
|
struct cx20442_priv *cx20442;
|
2009-07-29 18:24:46 +08:00
|
|
|
|
2018-01-29 12:15:57 +08:00
|
|
|
if (!component)
|
2011-06-04 06:00:50 +08:00
|
|
|
return;
|
2009-07-29 18:24:46 +08:00
|
|
|
|
2018-01-29 12:15:57 +08:00
|
|
|
cx20442 = snd_soc_component_get_drvdata(component);
|
2010-03-18 04:15:21 +08:00
|
|
|
|
2017-11-09 09:04:09 +08:00
|
|
|
if (!cx20442->tty) {
|
2009-07-29 18:24:46 +08:00
|
|
|
/* First modem response, complete setup procedure */
|
|
|
|
|
|
|
|
/* Set up codec driver access to modem controls */
|
2017-11-09 09:04:09 +08:00
|
|
|
cx20442->tty = tty;
|
2018-01-29 12:15:57 +08:00
|
|
|
component->card->pop_time = 1;
|
2009-07-29 18:24:46 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct tty_ldisc_ops v253_ops = {
|
|
|
|
.name = "cx20442",
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.open = v253_open,
|
|
|
|
.close = v253_close,
|
|
|
|
.hangup = v253_hangup,
|
|
|
|
.receive_buf = v253_receive,
|
|
|
|
};
|
|
|
|
EXPORT_SYMBOL_GPL(v253_ops);
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Codec DAI
|
|
|
|
*/
|
|
|
|
|
2010-03-18 04:15:21 +08:00
|
|
|
static struct snd_soc_dai_driver cx20442_dai = {
|
2010-08-19 21:15:50 +08: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 11:22:28 +08: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,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2018-01-29 12:15:57 +08:00
|
|
|
static int cx20442_set_bias_level(struct snd_soc_component *component,
|
2011-12-30 11:04:54 +08:00
|
|
|
enum snd_soc_bias_level level)
|
|
|
|
{
|
2018-01-29 12:15:57 +08:00
|
|
|
struct cx20442_priv *cx20442 = snd_soc_component_get_drvdata(component);
|
2011-12-30 11:04:54 +08:00
|
|
|
int err = 0;
|
|
|
|
|
|
|
|
switch (level) {
|
|
|
|
case SND_SOC_BIAS_PREPARE:
|
2018-01-29 12:15:57 +08:00
|
|
|
if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_STANDBY)
|
2011-12-30 11:04:54 +08:00
|
|
|
break;
|
|
|
|
if (IS_ERR(cx20442->por))
|
|
|
|
err = PTR_ERR(cx20442->por);
|
|
|
|
else
|
|
|
|
err = regulator_enable(cx20442->por);
|
|
|
|
break;
|
|
|
|
case SND_SOC_BIAS_STANDBY:
|
2018-01-29 12:15:57 +08:00
|
|
|
if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_PREPARE)
|
2011-12-30 11:04:54 +08:00
|
|
|
break;
|
|
|
|
if (IS_ERR(cx20442->por))
|
|
|
|
err = PTR_ERR(cx20442->por);
|
|
|
|
else
|
|
|
|
err = regulator_disable(cx20442->por);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
2018-01-29 12:15:57 +08:00
|
|
|
static int cx20442_component_probe(struct snd_soc_component *component)
|
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 11:22:28 +08:00
|
|
|
{
|
2010-03-18 04:15:21 +08: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 11:22:28 +08:00
|
|
|
|
2010-03-18 04:15:21 +08: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 11:22:28 +08:00
|
|
|
|
2018-01-29 12:15:57 +08:00
|
|
|
cx20442->por = regulator_get(component->dev, "POR");
|
2018-06-25 02:14:41 +08:00
|
|
|
if (IS_ERR(cx20442->por)) {
|
|
|
|
int err = PTR_ERR(cx20442->por);
|
|
|
|
|
|
|
|
dev_warn(component->dev, "failed to get POR supply (%d)", err);
|
|
|
|
/*
|
|
|
|
* When running on a non-dt platform and requested regulator
|
|
|
|
* is not available, regulator_get() never returns
|
|
|
|
* -EPROBE_DEFER as it is not able to justify if the regulator
|
|
|
|
* may still appear later. On the other hand, the board can
|
|
|
|
* still set full constraints flag at late_initcall in order
|
|
|
|
* to instruct regulator_get() to return a dummy one if
|
|
|
|
* sufficient. Hence, if we get -ENODEV here, let's convert
|
|
|
|
* it to -EPROBE_DEFER and wait for the board to decide or
|
|
|
|
* let Deferred Probe infrastructure handle this error.
|
|
|
|
*/
|
|
|
|
if (err == -ENODEV)
|
|
|
|
err = -EPROBE_DEFER;
|
|
|
|
kfree(cx20442);
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
2017-11-09 09:04:09 +08:00
|
|
|
cx20442->tty = NULL;
|
2011-12-30 11:04:54 +08:00
|
|
|
|
2018-01-29 12:15:57 +08:00
|
|
|
snd_soc_component_set_drvdata(component, cx20442);
|
|
|
|
component->card->pop_time = 0;
|
2010-03-18 04:15:21 +08: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 11:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* power down chip */
|
2018-01-29 12:15:57 +08:00
|
|
|
static void cx20442_component_remove(struct snd_soc_component *component)
|
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 11:22:28 +08:00
|
|
|
{
|
2018-01-29 12:15:57 +08:00
|
|
|
struct cx20442_priv *cx20442 = snd_soc_component_get_drvdata(component);
|
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 11:22:28 +08:00
|
|
|
|
2017-11-09 09:04:09 +08:00
|
|
|
if (cx20442->tty) {
|
|
|
|
struct tty_struct *tty = cx20442->tty;
|
2014-03-04 17:20:56 +08:00
|
|
|
tty_hangup(tty);
|
2010-03-18 04:15:21 +08: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 11:22:28 +08:00
|
|
|
|
2011-12-30 11:04:54 +08:00
|
|
|
if (!IS_ERR(cx20442->por)) {
|
|
|
|
/* should be already in STANDBY, hence disabled */
|
|
|
|
regulator_put(cx20442->por);
|
|
|
|
}
|
|
|
|
|
2018-01-29 12:15:57 +08:00
|
|
|
snd_soc_component_set_drvdata(component, NULL);
|
2010-03-18 04:15:21 +08: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 11:22:28 +08:00
|
|
|
}
|
|
|
|
|
2018-01-29 12:15:57 +08:00
|
|
|
static const struct snd_soc_component_driver cx20442_component_dev = {
|
|
|
|
.probe = cx20442_component_probe,
|
|
|
|
.remove = cx20442_component_remove,
|
|
|
|
.set_bias_level = cx20442_set_bias_level,
|
|
|
|
.read = cx20442_read_reg_cache,
|
|
|
|
.write = cx20442_write,
|
|
|
|
.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),
|
|
|
|
.idle_bias_on = 1,
|
|
|
|
.use_pmdown_time = 1,
|
|
|
|
.endianness = 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 11:22:28 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static int cx20442_platform_probe(struct platform_device *pdev)
|
|
|
|
{
|
2018-01-29 12:15:57 +08:00
|
|
|
return devm_snd_soc_register_component(&pdev->dev,
|
|
|
|
&cx20442_component_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 11:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static struct platform_driver cx20442_platform_driver = {
|
|
|
|
.driver = {
|
2010-03-18 04:15:21 +08: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 11:22:28 +08:00
|
|
|
},
|
|
|
|
.probe = cx20442_platform_probe,
|
|
|
|
};
|
|
|
|
|
2011-11-24 06:52:08 +08: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 11:22:28 +08:00
|
|
|
|
|
|
|
MODULE_DESCRIPTION("ASoC CX20442-11 voice modem codec driver");
|
|
|
|
MODULE_AUTHOR("Janusz Krzysztofik");
|
|
|
|
MODULE_LICENSE("GPL");
|
2010-03-18 04:15:21 +08:00
|
|
|
MODULE_ALIAS("platform:cx20442-codec");
|