summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/ts3a227e.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: codecs: Remove unused of_gpio.hAndy Shevchenko2024-06-101-1/+0
| | | | | | | | | | | | of_gpio.h is deprecated and subject to remove. The drivers in question don't use it, simply remove the unused header. Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240605221446.2624964-2-andriy.shevchenko@linux.intel.com Acked-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: Drop explicit initialization of struct ↵Uwe Kleine-König2024-05-031-1/+1
| | | | | | | | | | | | | | | | i2c_device_id::driver_data to 0 These drivers don't use the driver_data member of struct i2c_device_id, so don't explicitly initialize this member. This prepares putting driver_data in an anonymous union which requires either no initialization or named designators. But it's also a nice cleanup on its own. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20240502074722.1103986-2-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Switch i2c drivers back to use .probe()Uwe Kleine-König2023-05-081-1/+1
| | | | | | | | | | | | After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de Link: https://lore.kernel.org/r/20230425095716.331419-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org
* ASoC: ts3a227e: add set_jack and get_jack_typeAstrid Rost2023-01-271-1/+19
| | | | | | | | | Add set_jack and get_jack_type to allow simple-card-utils to add a jack for it. Signed-off-by: Astrid Rost <astrid.rost@axis.com> Link: https://lore.kernel.org/r/20230123135913.2720991-4-astrid.rost@axis.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: ts3a227e: add parameters to control debounce timesAstrid Rost2022-09-211-6/+55
| | | | | | | | | Add devicetree parameters to control the insert, release and press debounce times. Signed-off-by: Astrid Rost <astrid.rost@axis.com> Link: https://lore.kernel.org/r/20220921081834.22009-4-astrid.rost@axis.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: ts3a227e: use simple i2c probe functionStephen Kitt2022-04-111-3/+2
| | | | | | | | | | | | The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20220405165836.2165310-14-steve@sk2.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: ts3a227e: 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/ts3a227e.c:369:34: warning: ‘ts3a227e_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-33-krzk@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner2019-06-191-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* ASoC: ts3a227e: Map BTN_0 to KEY_PLAYPAUSEBenson Leung2017-11-271-1/+1
| | | | | | | | | | | | | | | | The Android 3.5mm Headset jack specification mentions that BTN_0 should be mapped to KEY_MEDIA, but this is less logical than KEY_PLAYPAUSE, which has much broader userspace support. For example, the Chrome OS userspace now supports KEY_PLAYPAUSE to toggle play/pause of videos and audio, but does not handle KEY_MEDIA. Furthermore, Android itself now supports KEY_PLAYPAUSE equivalently, as the new USB headset spec requires KEY_PLAYPAUSE for BTN_0. https://source.android.com/devices/accessories/headset/usb-headset-spec Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: ts3a227e: add acpi tableFang, Yang A2017-09-191-0/+10
| | | | | | | | | | | | This patch adds the acpi match table for the ts3a227e audio accessory detection device. This enables headset features like jack plug/unplug notifications, mic presence, and button pressed events. Signed-off-by: Fang, Yang A <yang.a.fang@intel.com> Signed-off-by: Thierry Escande <thierry.escande@collabora.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: drivers: Drop owner assignment from i2c_driverKrzysztof Kozlowski2015-07-151-1/+0
| | | | | | | | 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>
* ASoC: ts3a227e: do not report jack status when there is i2c read errFang, Yang A2015-07-081-2/+45
| | | | | | | | | | | | | | | | | | After suspend -> resume the ts3a227e_interrupt sometimes comes before i2c controller resume is called .regmap_read will return incorrect status and report a wrong jack status.This patch will disable irq on suspend and enable irq again on the resume to make sure interrupt is coming after TI resumes. Also We should return if there is read err,the interrupt will come again since it is level triggered and we are not yet clear the interrupt. In addtion,cht_bsw_max98090_ti machine driver registered additional notifier base on jack event which will program the audio codec.there will be codec timeout err if such event occurs prior to i2c controller is resumed. Signed-off-by: Fang, Yang A <yang.a.fang@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: ts3a227e: use device property apiFang, Yang A2015-06-021-8/+7
| | | | | | | replace of_property_read_u32 with device_property_read_u32 Signed-off-by: Fang, Yang A <yang.a.fang@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
*---. Merge remote-tracking branches 'asoc/topic/tdm-slot', 'asoc/topic/tegra', ↵Mark Brown2015-02-041-3/+32
|\ \ \ | | | | | | | | | | | | 'asoc/topic/tlv320aic3x', 'asoc/topic/ts3a227e' and 'asoc/topic/ts3a277e' into asoc-next
| | | * ASoC: ts3a227e: fix sparse warningLad, Prabhakar2015-02-041-0/+2
| | |/ | |/| | | | | | | | | | | | | | | | | | | this patch fixes following sparse warning: ts3a227e.c:222:5: warning: symbol 'ts3a227e_enable_jack_detect' was not declared. Should it be static? Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: ts3a227e: Add dts property that allows to specify micbias voltageAnatol Pomozov2015-01-271-0/+27
| | | | | | | | | | | | | | | | | | | | | The voltage controls key press threshold. Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: ts3a227e: Remap keys to match Android headset specificationAnatol Pomozov2015-01-271-3/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ts3a227e datasheet says typical key resistance is key1 50 Ohm key2 135 Ohm key3 240 Ohm key4 470 Ohm The android headset specification expect buttons impedance: A (MEDIA) 0-70 Ohm D (VOICECOMMAND) 110-180 Ohm B (VOLUMEUP) 210-290 Ohm C (VOLUMEDOWN) 360-680 Ohm Thus key mapping should be key1 - MEDIA key2 - VOICECOMMAND key3 - VOLUMEUP key3 - VOLUMEDOWN Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com> Acked-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* / ASoC: ts3a227e: Check and report jack status at probeCheng-Yi Chiang2015-01-051-0/+6
|/ | | | | | | | | | | ts3a227e does not trigger interrupt to report jack status when system boots from warm reset because ts3a227e's power remains on during warm reset. Read jack status at probe to get current jack status. Note that if system boots from EC reset, then this issue will not happen. Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: add TI ts3a227e headset chip driverDylan Reid2014-11-141-0/+314
The TS3A227E is an autonomous audio accessory detection and configuration switch that detects 3-pole or 4-pole audio accessories and configures internal switches to route the signals accordingly. This chip also has built-in support for the new button standard described in the Android "Wired audio headset specification" v1.0. These buttons will be reported on the jack as buttons 0-3 mapped to KEY_MEDIA, KEY_VOLUMEUP, KEY_VOLUMEDOWN, and KEY_VOICE_COMMAND. This will be added as an aux_dev and have the jack passed in from the machine driver. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>