Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: arizona-haptics - Use SoC component pin control functions

The name of a codec pin can have an optional prefix string, which is
defined by the SoC machine driver. The snd_soc_dapm_x_pin functions
take the fully-specified name including the prefix and so the existing
code would fail to find the pin if the audio machine driver had added
a prefix.

Switch to using the snd_soc_component_x_pin equivalent functions that
take a specified SoC component and automatically add the name prefix to
the provided pin name.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Richard Fitzgerald and committed by
Mark Brown
931afc41 1b4d9c22

+9 -4
+9 -4
drivers/input/misc/arizona-haptics.c
··· 37 37 struct arizona_haptics, 38 38 work); 39 39 struct arizona *arizona = haptics->arizona; 40 + struct snd_soc_component *component = 41 + snd_soc_dapm_to_component(arizona->dapm); 40 42 int ret; 41 43 42 44 if (!haptics->arizona->dapm) { ··· 68 66 return; 69 67 } 70 68 71 - ret = snd_soc_dapm_enable_pin(arizona->dapm, "HAPTICS"); 69 + ret = snd_soc_component_enable_pin(component, "HAPTICS"); 72 70 if (ret != 0) { 73 71 dev_err(arizona->dev, "Failed to start HAPTICS: %d\n", 74 72 ret); ··· 83 81 } 84 82 } else { 85 83 /* This disable sequence will be a noop if already enabled */ 86 - ret = snd_soc_dapm_disable_pin(arizona->dapm, "HAPTICS"); 84 + ret = snd_soc_component_disable_pin(component, "HAPTICS"); 87 85 if (ret != 0) { 88 86 dev_err(arizona->dev, "Failed to disable HAPTICS: %d\n", 89 87 ret); ··· 142 140 static void arizona_haptics_close(struct input_dev *input) 143 141 { 144 142 struct arizona_haptics *haptics = input_get_drvdata(input); 143 + struct snd_soc_component *component; 145 144 146 145 cancel_work_sync(&haptics->work); 147 146 148 - if (haptics->arizona->dapm) 149 - snd_soc_dapm_disable_pin(haptics->arizona->dapm, "HAPTICS"); 147 + if (haptics->arizona->dapm) { 148 + component = snd_soc_dapm_to_component(haptics->arizona->dapm); 149 + snd_soc_component_disable_pin(component, "HAPTICS"); 150 + } 150 151 } 151 152 152 153 static int arizona_haptics_probe(struct platform_device *pdev)