Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6015c2a3 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "asoc: wsa883x: Fix speaker noise issue"

parents daf14ff1 be581c2c
Loading
Loading
Loading
Loading
+42 −0
Original line number Diff line number Diff line
@@ -1264,6 +1264,19 @@ static int wsa883x_swr_up(struct wsa883x_priv *wsa883x)
	return ret;
}

static int wsa883x_swr_device_up(struct swr_device *pdev)
{
	struct wsa883x_priv *wsa883x;

	wsa883x = swr_get_dev_data(pdev);
	if (!wsa883x) {
		dev_err(&pdev->dev, "%s: wsa883x is NULL\n", __func__);
		return -EINVAL;
	}
	wsa883x_swr_up(wsa883x);
	return 0;
}

static int wsa883x_swr_down(struct wsa883x_priv *wsa883x)
{
	int ret;
@@ -1275,6 +1288,19 @@ static int wsa883x_swr_down(struct wsa883x_priv *wsa883x)
	return ret;
}

static int wsa883x_swr_device_down(struct swr_device *pdev)
{
	struct wsa883x_priv *wsa883x;

	wsa883x = swr_get_dev_data(pdev);
	if (!wsa883x) {
		dev_err(&pdev->dev, "%s: wsa883x is NULL\n", __func__);
		return -EINVAL;
	}
	wsa883x_swr_down(wsa883x);
	return 0;
}

static int wsa883x_swr_reset(struct wsa883x_priv *wsa883x)
{
	u8 retry = WSA883X_NUM_RETRY;
@@ -1292,6 +1318,19 @@ static int wsa883x_swr_reset(struct wsa883x_priv *wsa883x)
	return 0;
}

static int wsa883x_swr_device_reset(struct swr_device *pdev)
{
	struct wsa883x_priv *wsa883x;

	wsa883x = swr_get_dev_data(pdev);
	if (!wsa883x) {
		dev_err(&pdev->dev, "%s: wsa883x is NULL\n", __func__);
		return -EINVAL;
	}
	wsa883x_swr_reset(wsa883x);
	return 0;
}

static int wsa883x_event_notify(struct notifier_block *nb,
				unsigned long val, void *ptr)
{
@@ -1670,6 +1709,9 @@ static struct swr_driver wsa883x_swr_driver = {
	.probe = wsa883x_swr_probe,
	.remove = wsa883x_swr_remove,
	.id_table = wsa883x_swr_id,
	.device_up = wsa883x_swr_device_up,
	.device_down = wsa883x_swr_device_down,
	.reset_device = wsa883x_swr_device_reset,
};

static int __init wsa883x_swr_init(void)