cppcheck warning:
sound/soc/codecs/tas2562.c:530:9: warning: Identical condition and return expression 'ret', return value is always 0 [identicalConditionAfterEarlyExit]
return ret;
^
sound/soc/codecs/tas2562.c:525:6: note: If condition 'ret' is true, the function will return/exit
if (ret)
^
sound/soc/codecs/tas2562.c:530:9: note: Returning identical expression 'ret'
return ret;
^
Fix with return 0
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
cppcheck throws a warning:
sound/soc/codecs/tas2562.c:203:4: style: Assignment of function
parameter has no effect outside the function. [uselessAssignmentArg]
tx_mask &= ~(1 << right_slot);
^
This assignment seems to come from a copy/paste but the value is
indeed not used. Let's remove it.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-20-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/tas2562.c:805:34: warning: ‘tas2562_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-31-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Remove duplicate code for programming the I/V sense the call to update
the register was duplicated in commit 09ed395b05 ("ASoC: tas2562:
Add voltage sense slot configuration").
Fixes: 09ed395b05 ("ASoC: tas2562: Add voltage sense slot configuration")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200922142411.10364-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add the TAS2110 amplifier to the TAS2562 driver. The TAS2110 is register
and bitmap compatible. The chips differ in that the TAS2110 does not
have the I/V Sense feedback path. Since these features do not exist the
device needs to be registered without these controls.
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200921153820.18357-2-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add the TAS2564 as a supported amplifier. This amplifier is register,
bitmap and feature compatible to the TAS2562.
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200918150130.21015-2-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Update the shutdown GPIO property to be shutdown from shut-down.
Fixes: c173dba44c ("ASoC: tas2562: Introduce the TAS2562 amplifier")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200723160838.9738-2-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
snd_soc_dai_digital_mute() is internally using both
mute_stream() (1) or digital_mute() (2), but the difference between
these 2 are only handling direction.
We can merge digital_mute() into mute_stream
int snd_soc_dai_digital_mute(xxx, int direction)
{
...
else if (dai->driver->ops->mute_stream)
(1) return dai->driver->ops->mute_stream(xxx, direction);
else if (direction == SNDRV_PCM_STREAM_PLAYBACK &&
dai->driver->ops->digital_mute)
(2) return dai->driver->ops->digital_mute(xxx);
...
}
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/873661xxhu.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add Vsense slot configuration based on the device tree. Adding this
property enables the slot programming to be moved to the tdm_set_slot
callback. This in affect sets the slots for the Isense and Vsense and
enabling this these modes are now based on whether these features were
powered on or not.
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200626154143.20351-3-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add programming for the tdm slots for the right and left. This also
requires configuring the RX/TX offsets for the DAI format type.
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200626154143.20351-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Fix the issue found that there is an extra space before a comma in the
volume control.
Fixes: bf726b1c86 ("ASoC: tas2562: Add support for digital volume control")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200624174932.9604-4-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Update the shutdown GPIO property to be shutdown from shut-down.
Fixes: c173dba44c ("ASoC: tas2562: Introduce the TAS2562 amplifier")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200624174932.9604-3-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
According to the tas2562 datasheet,the bits[5:1] represents the amp_level value.
So to set the amp_level value correctly,the shift value should be set to 1.
Signed-off-by: Jonghwan Choi <charlie.jh@kakaocorp.com>
Acked-by: Dan Murphy <dmurphy@ti.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200319140043.GA6688@jhbirdchoi-MS-7B79
Signed-off-by: Mark Brown <broonie@kernel.org>
The TAS2563 is register compatible with the TAS2562. The main
difference is the TAS2563 has a programmable DSP to manage different
audio profiles.
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200226130305.12043-2-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add support for digital volume control. There is no dedicated register
for volume control but instead there are 4. The values of the registers
are determined with exponential floating point math.
So a table was created with register values for 2dB step increments
from -110dB to 0dB.
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200221124151.8774-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add additional support for ISENSE and VSENSE feature for the TAS2562.
This feature monitors the output to the loud speaker attempts to
eliminate IR drop errors due to packaging.
This feature is defined in Section 8.4.5 IV Sense of the data sheet.
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200219134622.22066-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
If the bitwidth passed in to the set_bitwidth function is not supported
then return an error.
Fixes: 29b74236bd57 ("ASoC: tas2562: Introduce the TAS2562 amplifier")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200218185252.26290-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>