diff options
author | Chris Chiu <chiu@endlessos.org> | 2021-01-11 06:41:38 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-01-11 15:03:07 +0100 |
commit | 21f603482a6bdc4e7481f5a8e0e4b654d8d6e3a3 (patch) | |
tree | bea252a572007777beaf6a863848322d3ad080f6 /sound/soc/codecs/rt5645.c | |
parent | ASoC: es8328: Remove redundant null check before clk_disable_unprepare (diff) | |
download | linux-21f603482a6bdc4e7481f5a8e0e4b654d8d6e3a3.tar.xz linux-21f603482a6bdc4e7481f5a8e0e4b654d8d6e3a3.zip |
ASoC: rt5645: Introduce mapping for ACPI-defined GPIO
On at least one laptop (ECS EF20EA) the 'hp-detect' GPIO is defined in
the DSDT table by the ACPI GpioIo resources in _CRS. The GPIO related
information should be mapped to the rt5645 driver to enable the jack
detection also on non-DT platforms.
Signed-off-by: Chris Chiu <chiu@endlessos.org>
Link: https://lore.kernel.org/r/20210111054141.4668-2-chiu@endlessos.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt5645.c')
-rw-r--r-- | sound/soc/codecs/rt5645.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 1c9e61abda30..33f277678223 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -42,6 +42,8 @@ static unsigned int quirk = -1; module_param(quirk, uint, 0444); MODULE_PARM_DESC(quirk, "RT5645 pdata quirk override"); +static const struct acpi_gpio_mapping *cht_rt5645_gpios; + #define RT5645_DEVICE_ID 0x6308 #define RT5650_DEVICE_ID 0x6419 @@ -3831,6 +3833,10 @@ static int rt5645_i2c_probe(struct i2c_client *i2c, rt5645->pdata.dmic2_data_pin = QUIRK_DMIC2_DATA_PIN(quirk); } + if (cht_rt5645_gpios && has_acpi_companion(&i2c->dev)) + if (devm_acpi_dev_add_driver_gpios(&i2c->dev, cht_rt5645_gpios)) + dev_dbg(&i2c->dev, "Failed to add driver gpios\n"); + rt5645->gpiod_hp_det = devm_gpiod_get_optional(&i2c->dev, "hp-detect", GPIOD_IN); |