Clarify struct snd_soc_jack_gpio documentation for the idx and name fields.
Because name is passed as connection ID to gpiod_get_index() when using GPIO
descriptor defined jack pins it is not only used as a label in debugfs but
also as function name lookup in systems that support functions names for
GPIOs.
Clarify also idx since the index is within the function of the GPIO consumer
device and not within the device itself only.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
When CONFIG_PM is disabled, the CONFIG_SND_HDA_POWER_SAVE_DEFAULT symbol
does not get defined, which causes a build error for the hda-tegra driver:
hda/hda_tegra.c:80:25: error: 'CONFIG_SND_HDA_POWER_SAVE_DEFAULT' undeclared here (not in a function)
static int power_save = CONFIG_SND_HDA_POWER_SAVE_DEFAULT;
^
/git/arm-soc/sound/pci/hda/hda_tegra.c:235:13: warning: 'hda_tegra_disable_clocks' defined but not used [-Wunused-function]
static void hda_tegra_disable_clocks(struct hda_tegra *data)
^
This works around the problem by not referencing that macro
when CONFIG_PM is disabled. Instead, we assume that it's disabled
unconditionally and cannot be enabled at runtime.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Dylan Reid <dgreid@chromium.org>
Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
commit 8c5178fca4 ("ALSA: Add params_width() helpers") introduces
a helper to get the sample width. Updating Samsung related sound
drivers to use this helper.
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Having the binary ones complement operator in the new bitmak value makes the
code hard to read.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
When headphones are plugged in, force AFG and node 0x02
("Headphone Playback Volume") to D0 to avoid pop noises.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=76611
Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
No need to go via the CODEC to get a pointer to the card. This will help to
eventually remove the card field from the snd_soc_codec struct.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
If master clock is provided through device tree, then update
the master clock frequency during set_sysclk.
Documentation has been updated to reflect the change.
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
If master clock is provided through device tree, then update
the master clock frequency during set_sysclk.
Documentation has been updated to reflect the change.
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Add "depends on I2C" to shut up the build errors from randconfig.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Make including the omap-pcm.h outside sound/soc/omap more convenient.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Allow jack GPIO pins be defined also using GPIO descriptor-based interface
in addition to legacy GPIO numbers. This is done by adding two new fields to
struct snd_soc_jack_gpio: idx and gpiod_dev.
Legacy GPIO numbers are used only when GPIO consumer device gpiod_dev is
NULL and otherwise idx is the descriptor index within the GPIO consumer
device.
New function snd_soc_jack_add_gpiods() is added for typical cases where all
GPIO descriptor jack pins belong to same GPIO consumer device. For other
cases the caller must set the gpiod_dev in struct snd_soc_jack_gpio before
calling snd_soc_jack_add_gpios().
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This patch does basic GPIO descriptor conversion to soc-jack. Even the GPIOs
are still passed and requested using legacy GPIO numbers the driver
internals are converted to use GPIO descriptor API.
Motivation for this is to prepare soc-jack so that it will allow registering
jack GPIO pins using both GPIO descriptors and legacy GPIO numbers.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Failure to terminate this match table can lead to boot failures
depending on where the compiler places the match table.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The DMAC src/dst addr needs to be set from driver when DT case.
(It was set from SoC/DMAEngine code when non-DT case)
This patch adds rsnd_gen_dma_addr() to set DMAC src/dst addr.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Renesas sound driver is supporting to use DMAEngine.
But, DMA slave channel name "tx", "rx" is not enough
in DT case.
Becuase, it has many ports and path combination.
This patch adds rsnd_dma_of_name() to find
DMA channel name, for example
memory to SSI0 is "mem_ssi0",
SSI0 to memory is "ssi0_mem",
SSI0 to SRC0 is "ssi0_src0",
SRC0 to SSI0 is "src0_ssi0",
SRC0 to DVC0 is "src0_dvc0"...
Renesas sound want to use PIO transfer mode for some reasons.
It will be PIO tranfer mode if device node doesn't have
DMA settings.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Renesas sound driver uses many modules (= SSI/SRC/DVC),
and each module had own name.
But, each module name can be used as several purpose,
like clock name, DMA name etc...
This patch uses common name for each module.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Renesas sound driver is supporting Gen1/Gen2.
SRC probe can return error if it was unknown
generation.
Now, rsnd_src_non_ops is not needed.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
DT DMA support needs struct platform_device pointer,
and it can get struct device pointer from platform_device.
Save platform_device instead of device.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Driver needs to call of_node_put() after of_get_chile_by_name()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
snd_soc_jack_add_gpios() schedules a work queue item to poll the GPIO to
generate an initial jack status report. If sound card initialization
fails, that work item needs to be cancelled, so it doesn't run after the
card has been freed. Specifically, freeing the card calls
snd_jack_dev_free() which calls snd_jack_dev_disconnect() which sets
jack->input_dev = NULL, and input_dev is used by snd_jack_report(), which
is called from the work queue item.
snd_soc_jack_free_gpios() cancels the work item. The Tegra ASoC machine
drivers do call this function in the platform driver remove() callback.
However, this happens after the sound card is freed, at least when the
card is freed due to errors late during snd_soc_instantiate_card(). This
leaves a window where the work item can execute after the card is freed.
In next-20140522, sound card initialization does fail for unrelated
reasons, and hits the problem described above.
To solve this, fix the Tegra ASoC machine drivers to clean up the Jack
GPIOs during the snd_soc_card's .remove() callback, which is executed
before the overall card object is freed. also, gGuard the cleanup call
based on whether we actually setup up the GPIOs in the first place.
Ideally, we'd do the cleanup in a struct snd_soc_dai_link .fini/remove
function to match where the GPIOs get set up. However, there is no such
callback.
This change fixes all Tegra machine drivers. By code inspection, I
believe some non-Tegra machine drivers have the same issue. I'll send a
patch for that separately, once this is reviewed.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This makes sure a format string can never get processed into the worker
thread name from the device name.
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Some platforms require that the codecs mclk is a fixed multiplication
factor of the audio stream rate. Add a optional property to the
binding to hold this factor and implement a hw_params() function to
make use of it.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Mark Brown <broonie@linaro.org>
This patch adds the clock divisor and multiplier NI, MI values for audio
sampling frequencies 44100 and 48000 Hz and PCLK 19.2 MHz. This is useful
for the Odroid X2/U2 boards when the codec works in master mode and its
MCLK clock is fed from the I2S CDCLK output.
Signed-off-by: Chen Zhen <zhen1.chen@samsung.com>
[s.nawrocki@samsung.com: edited the commit description]
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
In post commit, a quirk of this firmware about transactions is reported.
This commit apply a workaround for this quirk.
They often fail transactions due to gap_count mismatch. This state is changed
by generating bus reset.
The fw_schedule_bus_reset() is an exported symbol in firewire-core. But there
are no header for public. This commit moves its prototype from
drivers/firewire/core.h to include/linux/firewire.h.
This mismatch still affects bus management before generating this bus reset.
It still takes a time to call driver's probe() because transactions are still
often failed.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Just powering on, these devices below wait to download firmware.
- Firewire Audiophile
- Firewire 410
- Firewire 1814
- ProjectMix I/O
But firmware version 5058 or later, flash memory in the device stores the
firmware. So this driver can enable these devices by sending a certain cue to
load the firmware.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The firmwares for M-Audio Firewire 410/1814 and ProjectMix I/O has a quirk to
ignore MIDI messages in data blocks more than 8. This commit uses a flag which
Fireworks uses for a similar quirk.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
M-Audio Firewire 1814 has a quirk, ProjectMix I/O also has. They transmit
empty packet with wrong value of dbc incremented by 8 at high sampling rate.
According to IEC 61883-1, this value should be the same as the one in
previous packet.
This commit adds a flag named as CIP_EMPTY_HAS_WRONG_DBC. With flag, the value
of dbc in empty packet is overwittern by an expected value.
This is an example of this quirk:
CIP Header 0 CIP Header 1 Payload size
010D0000 9004F759 210
010D0010 90040B59 210
010D0020 90042359 210
01020028 9004FFFF 2 <-
010D0030 90043759 210
010D0040 90044B59 210
010D0050 90046359 210
01020058 9004FFFF 2 <-
010D0060 90047759 210
010D0070 90048B59 210
010D0080 9004A359 210
01020088 9004FFFF 2 <-
010D0090 9004B759 210
010D00A0 9004CB59 210
010D00B0 9004E359 210
010200B8 9004FFFF 2 <-
010D00C0 9004F759 210
010D00D0 90040B59 210
010D00E0 90042359 210
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit allows this driver to support some models which M-Audio produces
with DM1000 but its firmware is special. They are:
- Firewire 1814
- ProjectMix I/O
They have heavily customized firmware. The usual operations can't be applied to
them. For this reason, this commit adds a model specific member to 'struct
snd_bebob' and some model specific functions. Some parameters are write-only so
this commit also adds control interface for applications to set them.
M-Audio special firmware quirks:
- Just after powering on, they wait to download firmware. This state is
changed when receiving cue. Then bus reset is generated and the device is
recognized as a different model with the uploaded firmware.
- They don't respond against BridgeCo AV/C extension commands. So drivers
can't get their stream formations and so on.
- They do not start to transmit packets only by establishing connection but
also by receiving SIGNAL FORMAT command.
- After booting up, they often fail to send response against driver's request
due to mismatch of gap_count.
This module don't support to upload firmware.
Tested-by: Darren Anderson <darrena092@gmail.com> (ProjectMix I/O)
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit allows this driver to support some models which M-Audio produces
with DM1000/DM1000E with usual firmware. They are:
- Firewire 410
- Firewire AudioPhile
- Firewire Solo
- Ozonic
- NRV10
- FirewireLightBridge
According to a person who worked in BridgeCo, some models are produced with
'Pre-BeBoB'. This means that these products were released before BeBoB was
officially produced, and later BeBoB specification was formed. So these models
have some quirks.
M-Audio usual firmware quirks:
- Just after powering on, 'Firewire 410' waits to download firmware. This
state is changed when receiving cue. Then bus reset is generated and the
device is recognized as a different model with the uploaded firmware.
- 'Firewire Audiophile' also waits to download firmware but its
vendor id/model id is the same as the one after loading firmware.
- The information of channel mapping for MIDI conformant data channel is
invalid against BridgeCo specification.
This commit adds some codes for these quirks but don't support to upload
firmware.
This commit also adds specific operations to get metering information. The
metering information also includes status of clock synchronization if the model
supports to switch source of clock.
The specification of FirewireLightBridge is unknown. So in this time, normal
operations are applied for this model.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit allows this driver to support all of models which Focusrite
produces with DM1000/BeBoB. They are:
- Saffire
- Saffire LE
- SaffirePro 10 I/O
- SaffirePro 26 I/O
This commit adds Focusrite specific operations:
1. Get source of clock
2. Get/Set sampling frequency
3. Get metering information
The driver uses these functionalities to read/write specific address by async
transaction.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit allows this driver to support all of models which Yamaha produced
with DM1000/BeBoB. They are:
- GO44
- GO46
This commit adds Yamaha specific operations. To get source of clock, AV/C Audio
Subunit command is used.
I note that their appearances are similar to some models of TerraTec; 'Go44' is
similar to 'PHASE 24 FW' and 'GO46' is similar to 'PHASE X24 FW'. But their
combination of Audio/Music subunits is a bit different.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit allows this driver to support all of models which Terratec produced
with DM1000/BeBoB. They are:
- PHASE 24 FW
- PHASE X24 FW
- PHASE 88 Rack FW
- EWS MIC2
- EWS MIC4
- Aureon 7.1 Firewire
For Phase series, this commit adds a Terratec specific operation. To get source
of clock. AV/C Audio Subunit command is used.
For EWS series and Aureon, this module uses normal operations.
Tested-by: Maximilian Engelhardt <maxi@daemonizer.de> (PHASE 24 FW)
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is for some devices which have its own operations or quirks.
Many functionality should be implemented in user land. Then this commit adds
functionality related to stream such as sampling frequency or clock source. For
help to debug, this commit adds the functionality to get metering information
if it's available.
To help these functionalities, this commit adds some AV/C commands defined in
'AV/C Audio Subunit Specification (1394TA).
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This interface is designed for mixer/control application. By using hwdep
interface, the application can get information about firewire node, can
lock/unlock kernel streaming and can get notification at starting/stopping
kernel streaming.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit adds a functionality to capture/playback PCM samples.
When AMDTP stream is already running for PCM or the source of clock is not
internal, available sampling rate is limited at current one.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit adds a functionality to capture/playback MIDI messages.
When no AMDTP streams are running, this module starts AMDTP stream at current
sampling rate for MIDI substream.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit adds proc interface to get these information for debugging:
- firmware information
- stream formation
- current clock source and sampling rate
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Normal BeBoB firmware has a quirk. When receiving bus reset, it transmits
packets with discontinuous value in dbc field.
This causes two situation, one is to abort streaming by firewire-lib as a
result of detecting the discontinuity. Another is to call driver's .update()
because of bus reset. These two is generated independently. (The former
depends on isochronous stream and the latter depends on IEEE1394 bus driver.)
When BeBoB driver works with XRUN-recoverable applications, this situation
looks like stream_start_duplex() call followed by stream_update_duplex() call
because applications will call snd_pcm_prepare() immediately at XRUN.
To update connections and streams at first, this commit use completion. When
queueing error occurs, stream_start_duplex() is forced to wait maximum
1000msec. During this, when .update() is called, the completion is waken and
stream_start_duplex() is processed without breaking connections.
At bus reset, stream_start_duplex() shouldn't break/establish connections and
stream_update_duplex() should update connections because a caller of
fw_iso_resources_allocate() is responsible for calling
fw_iso_resources_update() on bus reset.
This commit also adds a flag, which has an effect to skip checking continuity
for first packet. This flag is useful for BeBoB quirk to start handling packets
during streaming.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit adds management functionality for connections and streams.
BeBoB uses CMP to manage connections and uses AMDTP for streams.
This commit also adds some BridgeCo's AV/C extension commands. There are some
BridgeCo's AV/C extension commands but this commit just uses below commands
to get device's capability and status:
1.Extended Plug Info commands
- Plug Channel Position Specific Data
- Plug Type Specific Data
- Cluster(Section) Info Specific Data
- Plug Input Specific Data
2.Extended Stream Format Information commands
- Extended Stream Format Information Command - List Request
For Extended Plug Info commands for Cluster Info Specific Data, I pick up
'section' instead of 'cluster' from document to prevent from misunderstanding
because 'cluster' is also used in IEC 61883-6.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit adds two functionality for hwdep interface, adds two parameters for
this driver, add a node for proc interface.
To receive responses from devices, this driver already allocate own callback
into initial memory space in host controller. This means no one can allocate
its own callback to the address. So this driver must give a way for user
applications to receive responses.
This commit adds a functionality to receive responses via hwdep interface. The
application can receive responses to read from this interface. To achieve this,
this commit adds a buffer to queue responses. The default size of this buffer is
1024 bytes. This size can be changed to give preferrable size to
'resp_buf_size' parameter for this driver. The application should notice rest
of space in this buffer because this driver don't push responses when this
buffer has no space.
Additionaly, this commit adds a functionality to transmit commands via hwdep
interface. The application can transmit commands to write into this interface.
I note that the application can transmit one command at once, but can receive
as many responses as possible untill the user-buffer is full.
When using these interfaces, the application must keep maximum number of
sequence number in command within the number in firewire.h because this driver
uses this number to distinguish the response is against the command by the
application or this driver.
Usually responses against commands which the application transmits are pushed
into this buffer. But to enable 'resp_buf_debug' parameter for this driver, all
responses are pushed into the buffer. When using this mode, I reccomend to
expand the size of buffer.
Finally this commit adds a new node into proc interface to output status of the
buffer.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This interface is designed for mixer/control application. To use hwdep
interface, the application can get information about firewire node, can
lock/unlock kernel streaming and can get notification at starting/stopping
kernel streaming.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit adds a functionality to capture/playback PCM samples.
When AMDTP stream is already running for PCM or the source of clock is not
internal, available sampling rate is limited at current one.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fireworks has a quirk to ignore MIDI messages in data blocks more than 8.
This commit adds a flag for this quirk and codes to skip 8 or more data
blocks to transfer MIDI messages.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit adds a functionality to capture/playback MIDI messages.
When no AMDTP streams are running, this driver starts AMDTP stream for MIDI
stream at current sampling rate.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fireworks has a quirk to reset data block counter at bus reset.
This commit adds a flag of CIP_SKIP_DBC_ZERO_CHECK. This flag has an effect
to skip checking dbc continuity when dbc is zero.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>