summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/tas2562.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: tas2562: Propagate the error in tas2562_dac_event()Fabio Estevam2022-09-141-2/+2
| | | | | | | | | | | | | | | Since commit 2848d34c3ba1 ("ASoC: tas2562: Fix mute/unmute") the following build warning is seen: sound/soc/codecs/tas2562.c:442:13: warning: variable 'ret' set but not used [-Wunused-but-set-variable] Fix the warning by returning the 'ret' variable. Fixes: 2848d34c3ba1 ("ASoC: tas2562: Fix mute/unmute") Signed-off-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Martin Povišer <povik+lin@cutebit.org> Link: https://lore.kernel.org/r/20220913231706.516849-1-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: tas2562: Fix mute/unmuteMartin Povišer2022-09-051-26/+29
| | | | | | | | | | | | | | | Because the PWR_CTRL field is modeled as the power state of the DAC widget, and at the same time it is used to implement mute/unmute, we need some additional book-keeping to have the right end result no matter the sequence of calls. Without this fix, one permanently mutes an ongoing stream by toggling the associated speaker pin control. (This mirrors commit 1e5907bcb3a3 ("ASoC: tas2770: Fix handling of mute/unmute") which was a fix to the tas2770 driver.) Signed-off-by: Martin Povišer <povik+lin@cutebit.org> Link: https://lore.kernel.org/r/20220825142226.80929-3-povik+lin@cutebit.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: tas2562: Drop conflicting set_bias_level power settingMartin Povišer2022-09-051-35/+0
| | | | | | | | | | | | | | The driver is setting the PWR_CTRL field in both the set_bias_level callback and on DAPM events of the DAC widget (and also in the mute_stream method). Drop the set_bias_level callback altogether as the power setting it does is in conflict with the other code paths. (This mirrors commit c8a6ae3fe1c8 ("ASoC: tas2770: Drop conflicting set_bias_level power setting") which was a fix to the tas2770 driver.) Signed-off-by: Martin Povišer <povik+lin@cutebit.org> Link: https://lore.kernel.org/r/20220825142226.80929-2-povik+lin@cutebit.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: tas*: Remove now redundant non_legacy_dai_naming flagCharles Keepax2022-06-271-2/+0
| | | | | | | | | | The ASoC core has now been changed to default to the non-legacy DAI naming, as such drivers using the new scheme no longer need to specify the non_legacy_dai_naming flag. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220623125250.2355471-61-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: tas*: use i2c_match_id and simple i2c probeStephen Kitt2022-04-251-12/+13
| | | | | | | | | | | | | | | As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. The i2c id tables are moved up before the probe function, as suggested by Wolfram Sang, except where the existing code already had a declaration for the of_device_id table. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20220415160613.148882-6-steve@sk2.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: tas2562: remove warning on return valuePierre-Louis Bossart2021-03-181-1/+1
| | | | | | | | | | | | | | | | | | | | 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>
* ASoC: tas2562: remove useless assignmentPierre-Louis Bossart2021-03-181-1/+0
| | | | | | | | | | | | | | | | 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>
* ASoC: tas2562: skip of_device_id table when !CONFIG_OFKrzysztof Kozlowski2020-11-261-0/+2
| | | | | | | | | | | | 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>
* ASoC: tas2562: Remove duplicate code for I/V senseDan Murphy2020-09-221-12/+0
| | | | | | | | | | | Remove duplicate code for programming the I/V sense the call to update the register was duplicated in commit 09ed395b05feb ("ASoC: tas2562: Add voltage sense slot configuration"). Fixes: 09ed395b05feb ("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>
* ASoC: tas2562: Add the TAS2110 class-D amplifierDan Murphy2020-09-211-0/+48
| | | | | | | | | | | 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>
* ASoC: tas2562: Add the TAS2564 compatibleDan Murphy2020-09-211-0/+3
| | | | | | | | | 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>
* ASoC: tas2562: Update shutdown GPIO propertyDan Murphy2020-07-281-5/+18
| | | | | | | | | Update the shutdown GPIO property to be shutdown from shut-down. Fixes: c173dba44c2d2 ("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>
* ASoC: codecs: tas*: merge .digital_mute() into .mute_stream()Kuninori Morimoto2020-07-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | 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>
* ASoC: tas2562: Add voltage sense slot configurationDan Murphy2020-06-291-14/+51
| | | | | | | | | | | | 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>
* ASoC: tas2562: Add right and left channel slot programmingDan Murphy2020-06-291-16/+55
| | | | | | | | | 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>
* ASoC: tas2562: Fix format issue for extra space before a commaDan Murphy2020-06-251-1/+1
| | | | | | | | | | Fix the issue found that there is an extra space before a comma in the volume control. Fixes: bf726b1c86f2c ("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>
* ASoC: tas2562: Update shutdown GPIO propertyDan Murphy2020-06-251-2/+2
| | | | | | | | | Update the shutdown GPIO property to be shutdown from shut-down. Fixes: c173dba44c2d2 ("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>
* Merge branch 'for-5.6' of ↵Mark Brown2020-03-271-1/+1
|\ | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.7
| * ASoC: tas2562: Fixed incorrect amp_level setting.Jonghwan Choi2020-03-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'for-5.6' of ↵Mark Brown2020-03-021-1/+1
|\| | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.7
| * ASoC: tas2562: Fix sample rate error messageDan Murphy2020-02-261-1/+1
| | | | | | | | | | | | | | | | | | Fix error message for setting the sample rate. It says bitwidth but should say sample rate. Signed-off-by: Dan Murphy <dmurphy@ti.com> Link: https://lore.kernel.org/r/20200226130305.12043-3-dmurphy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: tas2562: Add entries for the TAS2563 audio amplifierDan Murphy2020-02-261-1/+8
| | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'for-5.6' of ↵Mark Brown2020-02-241-1/+2
|\| | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.7
| * ASoC: tas2562: Return invalid for when bitwidth is invalidDan Murphy2020-02-181-1/+2
| | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: tas2562: Add support for digital volume controlDan Murphy2020-02-211-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: tas2562: Add support for ISENSE and VSENSEDan Murphy2020-02-191-5/+27
|/ | | | | | | | | | | | 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>
* ASoC: tas2562: Introduce the TAS2562 amplifierDan Murphy2019-10-101-0/+590
Introduce the Texas Instruments TAS2562 amplifier driver with I/V sense for loud speaker applications. http://www.ti.com/lit/gpn/tas2562 Signed-off-by: Dan Murphy <dmurphy@ti.com> Link: https://lore.kernel.org/r/20191008181517.5332-2-dmurphy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>