ASoC: add Component level set_jack
[sfrench/cifs-2.6.git] / sound / soc / soc-jack.c
index 7daf21fee355b22c0a522d51c3de723fd6b7a1fd..2f9f496ab14fdde937e43b108d62c01e90f76266 100644 (file)
@@ -40,6 +40,28 @@ int snd_soc_codec_set_jack(struct snd_soc_codec *codec,
 }
 EXPORT_SYMBOL_GPL(snd_soc_codec_set_jack);
 
+/**
+ * snd_soc_component_set_jack - configure component jack.
+ * @component: COMPONENTs
+ * @jack: structure to use for the jack
+ * @data: can be used if codec driver need extra data for configuring jack
+ *
+ * Configures and enables jack detection function.
+ */
+int snd_soc_component_set_jack(struct snd_soc_component *component,
+                              struct snd_soc_jack *jack, void *data)
+{
+       /* will be removed */
+       if (component->set_jack)
+               return component->set_jack(component, jack, data);
+
+       if (component->driver->set_jack)
+               return component->driver->set_jack(component, jack, data);
+
+       return -ENOTSUPP;
+}
+EXPORT_SYMBOL_GPL(snd_soc_component_set_jack);
+
 /**
  * snd_soc_card_jack_new - Create a new jack
  * @card:  ASoC card