summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt298.c
AgeCommit message (Collapse)Author
2017-08-10ASoC: codecs: add const to snd_soc_codec_driver structuresBhumika Goyal
Declare snd_soc_codec_driver structures as const as they are only passed as an argument to the function snd_soc_register_codec. This argument is of type const, so declare the structures with this property as const. In file codecs/sn95031.c, snd_soc_codec_driver structure is also used in a copy operation along with getting passed to snd_soc_register_codec. So, it can be made const too. Done using Coccinelle: @match disable optional_qualifier@ identifier s; position p; @@ static struct snd_soc_codec_driver s@p={...}; @good1@ identifier match.s; position p; @@ snd_soc_register_codec(...,&s@p,...) @bad@ identifier match.s; position p!={match.p,good1.p}; @@ s@p @depends on !bad disable optional_qualifier@ identifier match.s; @@ static +const struct snd_soc_codec_driver s={...}; Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16ASoC: rt298: Add DMI match for Geminilake reference platformVinod Koul
Geminilake reference platform also uses combo jack for audio connector so we need to set codec pdata to use this based on DMI match for this board. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-12-12Merge remote-tracking branches 'asoc/topic/rl6231', 'asoc/topic/rl6347a', ↵Mark Brown
'asoc/topic/rockchip', 'asoc/topic/rt286' and 'asoc/topic/rt298' into asoc-next
2016-11-29ASoC: rt298: disable IRQ when jack is NULLBard Liao
Disable IRQ when jack is NULL in rt298_mic_detect. So machine driver can use it in suspend/resume. Signed-off-by: Bard Liao <bardliao@realtek.com> Reviewed-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-24ASoC: rt298: fix jack type detect errorBard Liao
rt298_jack_detect may be called before card is instantiated. And snd_soc_dapm_force_enable_pin will not work in that case. So, update bit manually by regmap_update_bits. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08ASoC: codec duplicated callback function goes to component on rt298Kuninori Morimoto
codec driver and component driver has duplicated callback functions, and codec side functions are just copied to component side when register timing. This was quick-hack, but no longer needed. This patch moves these functions from codec driver to component driver. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-27Merge remote-tracking branch 'asoc/topic/rt298' into asoc-nextMark Brown
2016-05-12ASoC: rt298: Add DMI match for Broxton-P reference platformVinod Koul
Broxton-P reference platform also uses combo jack for audio connector so we need to set codec pdata to use this based on DMI match for this board. Signed-off-by: Ramesh Babu <ramesh.babu@intel.com> Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-12ASoC: rt298: fix null deref on acpi driver dataVinod Koul
ACPI driver data can be NULL so we need to check that before dereference the driver data. Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-26ASoC: rt298: fix capture doesn't work at some casesBard Liao
RT298_CBJ_CTRL1(0x4f) bit 10 is needed for headset capture. It will be turned off when "VREF" widget is on and be turned on when bias level is ON. It is odd. And if "VREF" is turned on in bias level is ON, RT298_CBJ_CTRL1(0x4f) bit 10 will be turned off. This patch move the bit control from rt298_set_bias_level and rt298_vref_event to rt298_jack_detect. So it will be turned on once a jack is plugged in. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-26ASoC: rt298: reset AD dilter is there is no MCLKBard Liao
rt298 need to reset AD filter and the ADC settings will take effort. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-24ASoC: rt298: Don't enable IRQ in i2c_probeBard Liao
The IRQ function should not be enabled before irq handler is registered. In fact, it is done in rt298_probe. So remove it from rt298_i2c_probe. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-24ASoC: rt298: enable IRQ for jack detectionBard Liao
There are some registers needed for enabling rt298 IRQ missed on current driver. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16ASoC: rt298: fix remove unnedded clk settingBard Liao
The bit is no longer present. So remove it. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-26Merge remote-tracking branches 'asoc/topic/rt298', 'asoc/topic/rt5640', ↵Mark Brown
'asoc/topic/samsung' and 'asoc/topic/sh' into asoc-next
2015-10-26Merge remote-tracking branches 'asoc/topic/rcar', 'asoc/topic/rl6347a', ↵Mark Brown
'asoc/topic/rockchip' and 'asoc/topic/rt286' into asoc-next
2015-10-21ASoC: rt298: fix wrong setting of gpio2_enBard Liao
The register value to enable gpio2 was incorrect. So fix it. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-16Merge branch 'fix/rt298' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-rt298
2015-10-16ASoC: rt298: Make rt298_index_def constAxel Lin
The index_cache is per instance run time state but rt298_index_def is not. Make rt298_index_def const and make a copy of memory for index_cache rather than directly use the rt298_index_def. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-16ASoC: rt298: correct index default valueBard Liao
Some of the default value on rt298_index_def are incorrect. Change them to the correct value. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-12ASoC: rt298: set register non-volatile by defaultBard Liao
It is not necessary to set registers volatile. So, return false for default case of rt298_volatile_register. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-24ASoC: rl6347a: Clean up unneeded inclusion of header filesAxel Lin
Also move the include of sound/hda_verbs.h to rl6347a.h because it is used in rl6347a.h. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30Merge remote-tracking branches 'asoc/topic/rt298', 'asoc/topic/rt5640', ↵Mark Brown
'asoc/topic/rt5651' and 'asoc/topic/rt5670' into asoc-next
2015-07-16ASoC: rt298: remove meanless pr_infoBard Liao
This line doesn't include any information. So, remove it. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-15ASoC: drivers: Drop owner assignment from i2c_driverKrzysztof Kozlowski
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-09ASoC: add rt298 codec driverBard Liao
It is the initial version of ALC298 codec driver. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>