aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinaro CI <ci_notify@linaro.org>2021-01-19 23:20:50 +0000
committerLinaro CI <ci_notify@linaro.org>2021-01-19 23:20:50 +0000
commitd4258a95c1e59226791d7554ded554453d4b189c (patch)
tree6cdcbe74f7447731162f3c8d9c6bff50efc90bb4
parent3e0f99d78a8a040b4d425b02dd5c27ef3c700f2d (diff)
parentf7f2607b87b75e3c1cdf0a932f645b900e5e70fa (diff)
Merge remote-tracking branch 'audio/tracking-qcomlt-audio' into integration-linux-qcomlt
-rw-r--r--Documentation/devicetree/bindings/slimbus/slim-ngd-qcom-ctrl.txt1
-rw-r--r--drivers/mfd/mfd-core.c7
-rw-r--r--drivers/mfd/wcd934x.c4
-rw-r--r--drivers/slimbus/qcom-ngd-ctrl.c3
-rw-r--r--sound/soc/codecs/wcd934x.c10
-rw-r--r--sound/soc/qcom/apq8096.c48
6 files changed, 72 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/slimbus/slim-ngd-qcom-ctrl.txt b/Documentation/devicetree/bindings/slimbus/slim-ngd-qcom-ctrl.txt
index e94a2ad3a710..1c615b622d07 100644
--- a/Documentation/devicetree/bindings/slimbus/slim-ngd-qcom-ctrl.txt
+++ b/Documentation/devicetree/bindings/slimbus/slim-ngd-qcom-ctrl.txt
@@ -14,6 +14,7 @@ Please refer to slimbus/bus.txt for details of the common SLIMBus bindings.
must be one of the following.
"qcom,slim-ngd-v1.5.0" for MSM8996
"qcom,slim-ngd-v2.1.0" for SDM845
+ "qcom,slim-ngd-v2.2.0" for SM8250
- reg:
Usage: required
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index fc00aaccb5f7..3e845be895ac 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -359,6 +359,7 @@ static int mfd_remove_devices_fn(struct device *dev, void *data)
struct platform_device *pdev;
const struct mfd_cell *cell;
int *level = data;
+ struct mfd_of_node_entry *of_entry, *tmp;
if (dev->type != &mfd_dev_type)
return 0;
@@ -372,6 +373,12 @@ static int mfd_remove_devices_fn(struct device *dev, void *data)
regulator_bulk_unregister_supply_alias(dev, cell->parent_supplies,
cell->num_parent_supplies);
+ list_for_each_entry_safe(of_entry, tmp, &mfd_of_node_list, list)
+ if (of_entry->dev == &pdev->dev) {
+ list_del(&of_entry->list);
+ kfree(of_entry);
+ }
+
platform_device_unregister(pdev);
return 0;
}
diff --git a/drivers/mfd/wcd934x.c b/drivers/mfd/wcd934x.c
index c274d733b656..b5252053a624 100644
--- a/drivers/mfd/wcd934x.c
+++ b/drivers/mfd/wcd934x.c
@@ -194,10 +194,14 @@ static int wcd934x_slim_status_up(struct slim_device *sdev)
static int wcd934x_slim_status(struct slim_device *sdev,
enum slim_device_status status)
{
+ struct wcd934x_ddata *ddata;
+
switch (status) {
case SLIM_DEVICE_STATUS_UP:
return wcd934x_slim_status_up(sdev);
case SLIM_DEVICE_STATUS_DOWN:
+ ddata = dev_get_drvdata(&sdev->dev);
+ regcache_cache_only(ddata->regmap, true);
mfd_remove_devices(&sdev->dev);
break;
default:
diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index c054e83ab636..871ed721dcfd 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -1351,6 +1351,9 @@ static const struct of_device_id qcom_slim_ngd_dt_match[] = {
},{
.compatible = "qcom,slim-ngd-v2.1.0",
.data = &ngd_v1_5_offset_info,
+ },{
+ .compatible = "qcom,slim-ngd-v2.2.0",
+ .data = &ngd_v1_5_offset_info,
},
{}
};
diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c
index 40f682f5dab8..3197c701cdc5 100644
--- a/sound/soc/codecs/wcd934x.c
+++ b/sound/soc/codecs/wcd934x.c
@@ -2112,7 +2112,7 @@ static struct clk *wcd934x_register_mclk_output(struct wcd934x_codec *wcd)
wcd->hw.init = &init;
hw = &wcd->hw;
- ret = clk_hw_register(wcd->dev->parent, hw);
+ ret = devm_clk_hw_register(wcd->dev->parent, hw);
if (ret)
return ERR_PTR(ret);
@@ -5050,6 +5050,13 @@ static int wcd934x_codec_probe(struct platform_device *pdev)
wcd934x_slim_dais,
ARRAY_SIZE(wcd934x_slim_dais));
}
+static int wcd934x_codec_remove(struct platform_device *pdev)
+{
+ of_clk_del_provider(pdev->dev.of_node);
+
+ return 0;
+}
+
static const struct platform_device_id wcd934x_driver_id[] = {
{
@@ -5061,6 +5068,7 @@ MODULE_DEVICE_TABLE(platform, wcd934x_driver_id);
static struct platform_driver wcd934x_codec_driver = {
.probe = &wcd934x_codec_probe,
+ .remove = wcd934x_codec_remove,
.id_table = wcd934x_driver_id,
.driver = {
.name = "wcd934x-codec",
diff --git a/sound/soc/qcom/apq8096.c b/sound/soc/qcom/apq8096.c
index 1a69baefc5ce..2426f5e0e10d 100644
--- a/sound/soc/qcom/apq8096.c
+++ b/sound/soc/qcom/apq8096.c
@@ -5,14 +5,21 @@
#include <linux/platform_device.h>
#include <linux/of_device.h>
#include <sound/soc.h>
+#include <sound/jack.h>
#include <sound/soc-dapm.h>
#include <sound/pcm.h>
+#include <uapi/linux/input-event-codes.h>
#include "common.h"
#define SLIM_MAX_TX_PORTS 16
#define SLIM_MAX_RX_PORTS 16
#define WCD9335_DEFAULT_MCLK_RATE 9600000
+struct apq8096_card_data {
+ struct snd_soc_jack jack;
+ bool jack_setup;
+};
+
static int apq8096_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params)
{
@@ -67,6 +74,7 @@ static struct snd_soc_ops apq8096_ops = {
static int apq8096_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
+ struct apq8096_card_data *data = snd_soc_card_get_drvdata(rtd->card);
/*
* Codec SLIMBUS configuration
@@ -79,6 +87,8 @@ static int apq8096_init(struct snd_soc_pcm_runtime *rtd)
unsigned int tx_ch[SLIM_MAX_TX_PORTS] = {128, 129, 130, 131, 132, 133,
134, 135, 136, 137, 138, 139,
140, 141, 142, 143};
+ struct snd_soc_card *card = rtd->card;
+ int rval;
snd_soc_dai_set_channel_map(codec_dai, ARRAY_SIZE(tx_ch),
tx_ch, ARRAY_SIZE(rx_ch), rx_ch);
@@ -86,6 +96,38 @@ static int apq8096_init(struct snd_soc_pcm_runtime *rtd)
snd_soc_dai_set_sysclk(codec_dai, 0, WCD9335_DEFAULT_MCLK_RATE,
SNDRV_PCM_STREAM_PLAYBACK);
+ if (!data->jack_setup) {
+ struct snd_jack *jack;
+
+ rval = snd_soc_card_jack_new(card, "Headset Jack",
+ SND_JACK_HEADSET |
+ SND_JACK_HEADPHONE |
+ SND_JACK_BTN_0 | SND_JACK_BTN_1 |
+ SND_JACK_BTN_2 | SND_JACK_BTN_3 |
+ SND_JACK_BTN_4,
+ &data->jack, NULL, 0);
+
+ if (rval < 0) {
+ dev_err(card->dev, "Unable to add Headphone Jack\n");
+ return rval;
+ }
+
+ jack = data->jack.jack;
+
+ snd_jack_set_key(jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
+ snd_jack_set_key(jack, SND_JACK_BTN_1, KEY_VOICECOMMAND);
+ snd_jack_set_key(jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
+ snd_jack_set_key(jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
+ data->jack_setup = true;
+ }
+
+ rval = snd_soc_component_set_jack(codec_dai->component,
+ &data->jack, NULL);
+ if (rval != 0 && rval != -ENOTSUPP) {
+ dev_warn(card->dev, "Failed to set jack: %d\n", rval);
+ return rval;
+ }
+
return 0;
}
@@ -105,6 +147,7 @@ static void apq8096_add_be_ops(struct snd_soc_card *card)
static int apq8096_platform_probe(struct platform_device *pdev)
{
+ struct apq8096_card_data *data;
struct snd_soc_card *card;
struct device *dev = &pdev->dev;
int ret;
@@ -113,9 +156,14 @@ static int apq8096_platform_probe(struct platform_device *pdev)
if (!card)
return -ENOMEM;
+ data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
card->dev = dev;
card->owner = THIS_MODULE;
dev_set_drvdata(dev, card);
+ snd_soc_card_set_drvdata(card, data);
ret = qcom_snd_parse_of(card);
if (ret)
return ret;