summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/rt5645.c
Commit message (Collapse)AuthorAgeFilesLines
* dmi: Mark all struct dmi_system_id instances constChristoph Hellwig2017-09-141-1/+1
| | | | | | | | | | | | | ... and __initconst if applicable. Based on similar work for an older kernel in the Grsecurity patch. [JD: fix toshiba-wmi build] [JD: add htcpen] [JD: move __initconst where checkscript wants it] Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jean Delvare <jdelvare@suse.de>
*-. Merge remote-tracking branches 'asoc/topic/rt5563', 'asoc/topic/rt5616', ↵Mark Brown2017-09-011-3/+40
|\ \ | | | | | | | | | 'asoc/topic/rt5645', 'asoc/topic/rt5659' and 'asoc/topic/rt5663' into asoc-next
| | * ASoC: rt5645: Add jack detection workaround for MINIX Z83-4 based devicesIan W MORRISON2017-08-311-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | The MINIX NEO Z83-4 and MINIX NEO Z83-4 Pro devices requires jd_mode=3 to make the jack detection work. Using a BIOS DMI product of "Z83-4" will match both devices of 'NEO Z83-4' and 'Z83-4 Pro'. Signed-off-by: Ian W Morrison <ianwmorrison@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: rt5645: make rt5645_platform_data constBhumika Goyal2017-08-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make these const as they are only used during a copy operation. Done using Coccinelle. @match disable optional_qualifier@ identifier s; @@ static struct rt5645_platform_data s = {...}; @ref@ position p; identifier match.s; @@ s@p @good1@ position ref.p; identifier match.s,f,c; expression e; @@ ( e = s@p | e = s@p.f | c(...,s@p.f,...) | c(...,s@p,...) ) @bad depends on !good1@ position ref.p; identifier match.s; @@ s@p @depends on forall !bad disable optional_qualifier@ identifier match.s; @@ static + const struct rt5645_platform_data s; Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: codecs: rt5645: add quirks for Asus T100HAPierre-Louis Bossart2017-08-231-0/+20
| |/ | | | | | | | | | | | | Fix jack detection and dmic setup Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: codecs: add const to snd_soc_codec_driver structuresBhumika Goyal2017-08-101-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
*-. Merge remote-tracking branches 'asoc/topic/rt5614', 'asoc/topic/rt5645', ↵Mark Brown2017-07-031-28/+68
|\ \ | | | | | | | | | 'asoc/topic/rt5651', 'asoc/topic/rt5665' and 'asoc/topic/rt5670' into asoc-next
| | * ASoC: rt5645: Add quirk override by module optionTakashi Iwai2017-06-301-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For making the development easier, add quirk module option to override the platform data setup. For example, a platform with inverted jack detection with jd_mode=2, pass the value 0x21 (0x1 = inv_jd1_1, 0x20 = jd_mode=2). It overrides the whole pdata fields, so pass it carefully. Signed-off-by: Takashi Iwai <tiwai@suse.de> Tested-by: James Cameron <quozl@laptop.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: rt5645: enable speaker protection featuresBard Liao2017-06-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | This patch is uploaded for enabling the speaker protection features of the audio codec. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: rt5645: Add jack detection workaround for GPD WinTakashi Iwai2017-06-281-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GPD Win requires jd_mode=3 and the inverted flag for making the jack detection working. Unfortunately, the BIOS doesn't give a nice way to match with DMI strings, and the only working way so far is to match with the board vendor/name/version/date to some known patterns. Hopefully other vendors won't do such a stupid setup, too... Thanks to Hans de Goede for the DMI matching suggestion. Suggested-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: rt5645: add inv_jd1_1 flagBard Liao2017-06-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The flag will invert jd1_1 status. Which will be used if the jack connector is normal closed. Signed-off-by: Bard Liao <bardliao@realtek.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: rt5645: rename jd_invert flag in platform dataBard Liao2017-06-281-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The jd_invert flag is actually used for level triggered IRQ. Rename it to let code more readable. Signed-off-by: Bard Liao <bardliao@realtek.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: rt5645: read jd1_1 status for jd detectionBard Liao2017-06-281-23/+8
| |/ | | | | | | | | | | | | | | | | | | Read the jd status after invert control. The benefit is we don't need to invert the reading jd status when jd invert is needed. Signed-off-by: Bard Liao <bardliao@realtek.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5645: del btn_check_timer on removeHans de Goede2017-06-281-0/+1
|/ | | | | | | | The timer may still be running when rt5645_i2c_remove() gets called, call del_timer_sync() to make sure it is stopped. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
*-. Merge remote-tracking branches 'asoc/topic/rockchip', 'asoc/topic/rt5514', ↵Mark Brown2017-04-301-0/+10
|\ \ | | | | | | | | | 'asoc/topic/rt5645' and 'asoc/topic/rt5677' into asoc-next
| | * ASoc: rt5645: Add OF device ID tableJavier Martinez Canillas2017-04-051-0/+10
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID and that the MODALIAS reported will always be of the form i2c:<device>. But this could change in the future so the correct approach is to have an OF device ID table if the devices are registered via OF. Before this patch: $ modinfo sound/soc/codecs/snd-soc-rt5645.ko | grep alias alias: acpi*:10EC3270:* alias: acpi*:10EC5640:* alias: acpi*:10EC5650:* alias: acpi*:10EC5648:* alias: acpi*:10EC5645:* alias: i2c:rt5650 alias: i2c:rt5645 After this patch: $ modinfo sound/soc/codecs/snd-soc-rt5645.ko | grep alias alias: of:N*T*Crealtek,rt5650C* alias: of:N*T*Crealtek,rt5650 alias: of:N*T*Crealtek,rt5645C* alias: of:N*T*Crealtek,rt5645 alias: acpi*:10EC3270:* alias: acpi*:10EC5640:* alias: acpi*:10EC5650:* alias: acpi*:10EC5648:* alias: acpi*:10EC5645:* alias: i2c:rt5650 alias: i2c:rt5645 Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
*-. \ Merge remote-tracking branches 'asoc/topic/rt5514', 'asoc/topic/rt5640', ↵Mark Brown2017-02-191-3/+9
|\ \ \ | | |/ | |/| | | | 'asoc/topic/rt5645', 'asoc/topic/rt5659' and 'asoc/topic/rt5660' into asoc-next
| | * ASoC: rt5645: fix error handling for gpio detectionPierre-Louis Bossart2017-02-011-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Optional gpio handling should not cause an error status and prevent probing if it's missing. Remove error return for -ENOENT case and move error message to dev_info Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: rt5645: set high voltage for capless powerBard Liao2017-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The default capless power mode is low voltage mode. We should set it to high voltage mode to get fair headphone performance. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | Merge remote-tracking branch 'asoc/topic/intel' into asoc-nextMark Brown2017-02-191-0/+2
|\ \ \ | |_|/ |/| |
| * | ASoc: rt5645: add ACPI ID 10EC3270Pierre-Louis Bossart2017-01-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | ALC3270 is a low-cost version of RT5645, add ACPI ID to enable probe and use rt5645 codec driver Tested on Asus T100HA Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: rt5645: add support for RT5648Pierre-Louis Bossart2017-01-311-0/+1
| |/ | | | | | | | | | | | | | | add ACPI ID 10EC5648 found e.g on Asus X205TA and use rt5645 driver Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5645: set sel_i2s_pre_div1 to 2Bard Liao2017-01-091-0/+3
|/ | | | | | | | | | | | | | | The i2s clock pre-divider 1 is used for both i2s1 and sysclk. The i2s1 is usually used for the main i2s and the pre-divider will be set in hw_params function. However, if i2s2 is used, the pre-divider is not set in the hw_params function and the default value of i2s clock pre-divider 1 is too high for sysclk and DMIC usage. Fix by overriding default divider value to 2. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=95681 Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codec duplicated callback function goes to component on rt5645Kuninori Morimoto2016-08-081-6/+8
| | | | | | | | | | 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>
* Merge remote-tracking branch 'asoc/topic/rt5645' into asoc-nextMark Brown2016-07-241-2/+21
|\
| * ASoC: rt5645: Add ACPI ID 10EC5640Vinod Koul2016-07-081-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Some CHT platforms use RT5645 codec which has entry 10EC5640 so add it. Also add DMI quirk for jack detection. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=98001 [Jack detection] Suggested-by: Stephen Just <stephenjust@gmail.com> Signed-off-by: Sachin Mokashi <sachinx.mokashi@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: rt5645: add DAC1 soft volume func controlBard Liao2016-07-071-0/+11
| | | | | | | | | | | | | | | | | | | | | | This patch add an alsa control for DAC1 digital volume control function selection. The options are: 0: Gain update immediately 1: Gain update when a zero crossing 2: Gain update when a zero crossing with a soft ramp Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: rt5645: patch reg-0x8aBard Liao2016-07-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | reg-8a assign the tracking source for each ASRC tracker. The default value is 0x0000 which means all ASRC trackers will track LRCK1. But in most cases, we wish each ASRC tracker track the corresponding LRCK. i.e. ASRC1 tracks LRCK1, ASRC2 tracks LRCK2 and so on. So, we rewrite reg-8a as 0x0120. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | Merge remote-tracking branch 'asoc/fix/rt5645' into asoc-linusMark Brown2016-07-241-0/+1
|\ \ | |/ |/|
| * ASoC: rt5645: set RT5645_PRIV_INDEX as volatileBard Liao2016-07-071-0/+1
| | | | | | | | | | | | | | | | RT5645_PRIV_INDEX(0x6a) indicate the address of PR- registers. So, it should be volatile. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5645: fix reg-2f default value.Bard Liao2016-07-011-1/+1
|/ | | | | | | The default value of reg-2f in codec rt5650 is 0x5002, not 0x1002. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5645: polling jd status in all conditionsBard Liao2016-05-051-6/+4
| | | | | | | | | | We only polling jd status when rt5645->pdata.jd_invert is true. However, it should be done at all time since there will be no interrupt for jd if we press a headset button and remove the headset at the same time. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5645: Add dmi_system_id "Google Setzer"John Lin2016-03-211-0/+6
| | | | | | | Add platform specific data for Setzer project. Signed-off-by: John Lin <john.lin@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge remote-tracking branch 'asoc/topic/rt5645' into asoc-nextMark Brown2016-03-131-5/+10
|\
| * ASoC: rt5645: extend delay time for headphone pop noiseJohn Lin2016-02-261-1/+1
| | | | | | | | | | | | | | | | Headphone needs enough delay time before unmuting for avoiding pop sound. We extend the delay time to make sure headphone doesn't pop. Signed-off-by: John Lin <john.lin@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: rt5645: improve headphone pop when system resumes from S3John Lin2016-02-261-4/+9
| | | | | | | | | | | | | | | | | | When playing audio through headphone, headphone makes pop noise if system resumes from S3 to S0. We modify the sequence of writing register for avoiding pop sound. Signed-off-by: John Lin <john.lin@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | Merge remote-tracking branch 'asoc/fix/rt5645' into asoc-linusMark Brown2016-02-101-1/+1
|\ \ | |/ |/|
| * ASoC: rt5645: fix the shift bit of IN1 boostBard Liao2016-01-211-1/+1
| | | | | | | | | | | | | | | | The shift bit of IN1 boost gain control is 12. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
* | Merge remote-tracking branch 'asoc/topic/rt5645' into asoc-nextMark Brown2016-01-111-4/+26
|\ \
| * | ASoC: rt5645: improve IRQ reaction time for HS buttonBard Liao2016-01-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | IRQ reaction time is not immediate when headset putton is pressed. This patch shortens the reaction time. Signed-off-by: John Lin <john.lin@realtek.com> Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: rt5645: Constify ACPI device idsMathias Krause2016-01-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Constify the ACPI device ID array, no need to have it writable at runtime. Also drop the unused RT5645_INIT_REG_LEN define. Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: Bard Liao <bardliao@realtek.com> Cc: Oder Chiou <oder_chiou@realtek.com> Cc: John Lin <john.lin@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: rt5645: use polling to support HS buttonBard Liao2015-12-301-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The IRQ pin will keep high when the headset button is pressed. And keep low when the headset button is released. So, we need irq trigger at both edges. However, some platform can't support it. Therefore, we polling the register to report the button release event once a button presse event is received. To support the headset button detection function for those can't support both edges trigger platforms, we also need to invert the polarity of jack detection irq since we need to keep the IRQ pin low in normal case. Signed-off-by: John Lin <john.lin@realtek.com> Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | Merge tag 'asoc-v4.5' into asoc-nextMark Brown2016-01-111-73/+219
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ASoC: Updates for v4.5 This is quite a busy release on the driver front with a lot of new drivers being added but comparatively quiet on the core side with only one big change going in and that a fairly straightforward refactoring. - Conversion of the array of DAI links to a list by Mengdong Lin, supporting dynamically adding and removing DAI links. - Some more fixes for the topology code, though it is still not final and ready for enabling in production. We really need to get to the point where that can be done. - A pile of changes for Intel SkyLake drivers which hopefully deliver some useful initial functionality for systems with this chipset, though there is more work still to come. - New drivers for a number of Imagination Technologies IPs. - Lots of new features and cleanups for the Renesas drivers. - ANC support for WM5110. - New driver for Atmel class D speaker drivers. - New drivers for Cirrus CS47L24 and WM1831. - New driver for Dialog DA7128. - New drivers for Realtek RT5659 and RT56156. - New driver for Rockchip RK3036. - New driver for TI PC3168A # gpg: Signature made Wed 23 Dec 2015 00:42:40 GMT using RSA key ID 5D5487D0 # gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>" # gpg: aka "Mark Brown <broonie@debian.org>" # gpg: aka "Mark Brown <broonie@kernel.org>" # gpg: aka "Mark Brown <broonie@tardis.ed.ac.uk>" # gpg: aka "Mark Brown <broonie@linaro.org>" # gpg: aka "Mark Brown <Mark.Brown@linaro.org>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 3F25 68AA C269 98F9 E813 A1C5 C3F4 36CA 30F5 D8EB # Subkey fingerprint: ADE6 68AA 6757 18B5 9FE2 9FEA 24D6 8B72 5D54 87D0
| * | ASoC: rt5645: merge DMI tables of google projectsBard Liao2015-11-301-61/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are more and more google projects need to use DMI to get the platform data configuration. And those projects use the same configuration. To clean those redundant code, we define a general DMI for those projects with the same platform data configuration. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | Merge branch 'fix/rt5645' of ↵Mark Brown2015-11-251-0/+7
| |\ \ | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-rt5645
| * \ \ Merge branch 'fix/rt5645' of ↵Mark Brown2015-11-201-1/+15
| |\ \ \ | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-rt5645
| * | | | ASoC: rt5645: Separate regmap for rt5645 and rt5650Bard Liao2015-11-161-9/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rt5645.c support both rt5645 and rt5650 codec. And the default value of registers are not identical. So we use different regmap for the two codecs. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | | ASoC: rt5645: Use the mod_delayed_work instead of the queue_delayed_work and ↵Oder Chiou2015-11-161-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cancel_delayed_work_sync Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | | | Merge remote-tracking branch 'asoc/fix/rt5645' into asoc-linusMark Brown2016-01-051-0/+4
|\ \ \ \ \ | |_|_|/ / |/| | | |
| * | | | ASoC: rt5645: add sys clk detectionBard Liao2015-12-301-0/+4
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | Add system clock detection to prevent output DC from SPO. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
OpenPOWER on IntegriCloud